spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23360: LJSUP-14345: Problem with add pics to en...

Committer: atyurin
LJSUP-14345: Problem with add pics to entry in RTE
U   trunk/htdocs/js/ck/ckeditor.js
Modified: trunk/htdocs/js/ck/ckeditor.js
===================================================================
--- trunk/htdocs/js/ck/ckeditor.js	2012-11-26 11:46:08 UTC (rev 23359)
+++ trunk/htdocs/js/ck/ckeditor.js	2012-11-26 11:47:50 UTC (rev 23360)
@@ -136,22 +136,22 @@
 });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(){a.editor.prototype.lightSetData=function(t){this.document.getBody().setHtml(this.dataProcessor.toHtml(t));this.fire('contentDom');};a.editor.prototype.insertCaret=function(){var w=this;w.focus();var t=w.getSelection(),u=t&&t.getRanges()[0];if(!u||!u.collapsed)return false;var v=new h('span');v.setAttribute('id','__rte_focus');v.setText('|');u.insertNode(v);w.dataWithFocus=w.getData();v.remove();};a.editor.prototype.moveFocus=function(t){var u=this;this.focus();setTimeout(function(){var v=u.getSelection(),w=v&&v.getRanges(),x=w&&w[0].startContainer,y=x&&x.getParents(true);if(!x)return;if(t==='end'){x=y[y.length-2].getFirst();if(!x)return;for(;;){var z=x.getNext();if(z==null)break;x=z;}v.selectElement(x);w=v.getRanges();w[0].collapse(false);v.selectRanges(w);}if(t==='start'){var A=new d.range(u.document);
 A.selectNodeContents(u.document.getBody());A.collapse(true);v.selectRanges([A]);}},100);};a.editor.prototype.isFocusAt=function(t){var u=this.getSelection(),v=u.getRanges()[0],w=this.document.getBody();if(t==='end'&&v.checkEndOfBlock())if(w.equals(v.endContainer)||w.getLast().equals(v.endContainer))return true;if(t==='start')throw new Error('Not implemented');return false;};a.editor.prototype.isSelectionCollapsed=function(){var t=this.getSelection(),u=t&&t.getRanges()[0];if(u)return!!u.collapsed;return false;};var m=a.lang[a.lang.detect()]||{};jQuery.extend(m,LJ.pageVar('rtedata'));window.CKLang=m;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;var n='@focus@',o='<input type="hidden" id="__focus"/>';function p(t,u,v){v=v||{};v&&jQuery.extend(v,{fromDoubleClick:this.execFromEditor});LiveJournal.run_hook('rteButton',u,jQuery('.cke_button_'+t),v);this.execFromEditor=false;};var q=[{label:m.LJLike_button_repost,id:'repost',abbr:'rp',checked:true,html:'<span class="lj-like-item rp">'+m.LJLike_button_repost+'</span>',htmlOpt:'<li class="like-rp"><input type="checkbox" id="like-rp" /><label for="like-rp">'+m.LJLike_button_repost+'</label></li>'},{label:m.LJLike_button_facebook,id:'facebook',abbr:'fb',checked:true,html:'<span class="lj-like-item fb">'+m.LJLike_button_facebook+'</span>',htmlOpt:'<li class="like-fb"><input type="checkbox" id="like-fb" /><label for="like-fb">'+m.LJLike_button_facebook+'</label></li>'},{label:m.LJLike_button_twitter,id:'twitter',abbr:'tw',checked:true,html:'<span class="lj-like-item tw">'+m.LJLike_button_twitter+'</span>',htmlOpt:'<li class="like-tw"><input type="checkbox" id="like-tw" /><label for="like-tw">'+m.LJLike_button_twitter+'</label></li>'},{label:m.LJLike_button_google,id:'google',abbr:'go',checked:true,html:'<span class="lj-like-item go">'+m.LJLike_button_google+'</span>',htmlOpt:'<li class="like-go"><input type="checkbox" id="like-go" /><label for="like-go">'+m.LJLike_button_google+'</label></li>'},{label:m.LJLike_button_vkontakte,id:'vkontakte',abbr:'vk',checked:Site.remote_is_sup?true:false,html:'<span class="lj-like-item vk">'+m.LJLike_button_vkontakte+'</span>',htmlOpt:Site.remote_is_sup?'<li class="like-vk"><input type="checkbox" id="like-vk" /><label for="like-vk">'+m.LJLike_button_vkontakte+'</label></li>':''},{label:m.LJLike_button_surfingbird,id:'surfingbird',abbr:'sb',checked:Site.remote_is_sup?true:false,html:'<span class="lj-like-item sb">'+m.LJLike_button_surfingbird+'</span>',htmlOpt:Site.remote_is_sup?'<li class="like-sb"><input type="checkbox" id="like-sb" /><label for="like-sb">'+m.LJLike_button_surfingbird+'</label></li>':''},{label:m.LJLike_button_tumblr,id:'tumblr',abbr:'tb',checked:true,html:'<span class="lj-like-item tb">'+m.LJLike_button_tumblr+'</span>',htmlOpt:'<li class="like-tb"><input type="checkbox" id="like-tb" /><label for="like-tb">'+m.LJLike_button_tumblr+'</label></li>'},{label:m.LJLike_button_give,id:'livejournal',abbr:'lj',checked:false,html:'<span class="lj-like-item lj">'+m.LJLike_button_give+'</span>',htmlOpt:'<li class="like-lj"><input type="checkbox" id="like-lj" /><label for="like-lj">'+m.LJLike_button_give+'</label></li>'}],r={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:{},LJCut2:{}},s=f;
 s.$block['lj-template']=1;s.$block['lj-raw']=1;s.$block['lj-cut']=1;s.$block['lj-spoiler']=1;s.$block['lj-poll']=1;s.$block['lj-repost']=1;s.$block['lj-pq']=1;s.$block['lj-pi']=1;s.$nonEditable['lj-template']=1;s.$empty['lj-random']=1;s['lj-template']={};s['lj-map']={};s['lj-repost']={};s['lj-raw']=s.div;s['lj-poll']={'lj-pq':1};s['lj-pq']={'#':1,'lj-pi':1};s['lj-pi']={'#':1};['a','b','em','i','img','strong','u','lj-user'].forEach(function(t){s['lj-pq'][t]=1;s['lj-pi'][t]=1;});s.$block.iframe=s.$inline.iframe;delete s.$inline.iframe;e.extend(s['lj-cut']={},s.$block);e.extend(s['lj-spoiler']={},s.$block);e.extend(s['lj-cut'],s.$inline);e.extend(s['lj-spoiler'],s.$inline);e.extend(s.div,s.$block);e.extend(s.$body,s.$block);delete s['lj-cut']['lj-cut'];f.p.iframe=1;f['lj-cut'].iframe=1;f['lj-spoiler'].iframe=1;j.add('livejournal',{init:function(t){t.rteButton=p;function u(B){var C=B.data.element||B.data.getTarget();if(C.type!=1)C=C.getParent();while(C){var D=C.getAttribute('lj-cmd');if(r.hasOwnProperty(D)){var E=t.getCommand(D);if(E.state==1){var F=new d.selection(t.document);r[D].node=C.is('body')?new h.get(C.getWindow().$.frameElement):C;F.selectElement(r[D].node);B.data.dialog='';t.execFromEditor=true;t.execCommand(D,true);break;}}C=C.getParent();}};function v(B){var C=this;if(C.$!=t.document.$){C.$.className=(C.frame.getAttribute('lj-class')||'')+' lj-selected';if(C.getAttribute('lj-cmd')=='LJPollLink')C.frame.setStyle('height',C.getDocument().$.body.scrollHeight+'px');t.focus();new d.selection(t.document).selectElement(C.frame);}B.data.getKey()==1&&B.data.preventDefault();};function w(B){if(B.data.getKey()==46){var C=new d.selection(t.document).getRanges(),D=C.length;while(D--)C[D].deleteContents();}};function x(){var E=this;var B=E.$.contentWindow,C=B.document,D=new h.get(C.body);if(D.on&&!Site.page.disabled_input){D.on('dblclick',u);D.on('click',v);D.on('keyup',w);if(E.getAttribute('lj-cmd')=='LJPollLink'&&E.hasAttribute('style'))C.body.className='lj-poll lj-poll-open';}C=new h.get(C);C.frame=D.frame=E;};function y(){var B=t.document.getElementsByTag('iframe'),C=B.count(),D,E,F,G,H;t.execFromEditor=false;while(C--){D=B.getItem(C),E=D.getAttribute('lj-cmd'),F=D.$.contentWindow,G=F.document,H=D.getAttribute('lj-style')||'';if(D.getAttribute('data-update')==='false')continue;D.removeListener('load',x);D.on('load',x);G.open();G.write('<!DOCTYPE html><html style="'+H+'">'+'<head><link rel="stylesheet" href="'+a.styleText+'" /></head>'+'<body scroll="no" class="'+(D.getAttribute('lj-class')||'')+'" style="'+H+'" '+(E?'lj-cmd="'+E+'"':'')+'>'+decodeURIComponent(D.getAttribute('lj-content')||'')+'</body>'+'</html>');
-G.close();}};t.updateFrames=y;t.on('dataReady',function(){setTimeout(y,100);});function z(B){if(t.onSwitch===true){delete t.onSwitch;return;}var C,D=B.name=='click',E=B.name=='selectionChange'||D,F=B.data.element||B.data.getTarget(),G,H;if(D&&(B.data.getKey()==1||B.data.$.button==0))B.data.preventDefault();if(F.type!=1)F=F.getParent();G=F;if(E){var I=t.document.getElementsByTag('iframe'),J,K;if(D&&G.is('iframe')){K=G.$.contentWindow.document.body;K.className=(G.getAttribute('lj-class')||'')+' lj-selected';if(G.getAttribute('lj-cmd')=='LJPollLink')G.setStyle('height',K.scrollHeight+'px');}for(var L=0,M=I.count();L<M;L++){J=I.getItem(L);if(J.$!=G.$){K=J.$.contentWindow.document.body;K.className=J.getAttribute('lj-class')||'';if(J.getAttribute('lj-cmd')=='LJPollLink'&&K.className.indexOf('lj-poll')!=-1)J.removeAttribute('style');}}}do{var N=G.getAttribute('lj-cmd');if(!N&&G.type==1){var O=G.getParent();if(G.is('img')&&!G.hasAttribute('data-user')&&O.getParent()&&!O.getParent().hasAttribute('data-user')){N='LJImage';G.setAttribute('lj-cmd',N);}else if(G.is('a')&&!G.hasAttribute('data-user')&&!O.hasAttribute('lj:user')){N='LJLink2';G.setAttribute('lj-cmd',N);}}if(N&&r.hasOwnProperty(N)){if(E){r[N].node=G;t.getCommand(N).setState(1);}(C||(C={}))[N]={content:r[N].html,node:G};}}while(G=G.getParent());var P;if(E)for(H in r){if(r.hasOwnProperty(H)&&(!C||!C.hasOwnProperty(H))){delete r[H].node;P=t.getCommand(H);if(P)P.setState(2);}}};(function(){function B(K){return K.slice(-2)=='/>'?K:K.slice(0,-1)+'/>';};function C(K){var L=new Poll(K),M="<div class='lj-poll-inner lj-rtebox-inner'>"+L.outputHTML()+'</div>';return '<iframe class="lj-poll-wrap lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+L.outputLJtags()+'" lj-content="'+M+'"></iframe>';};function D(K,L){var M="<div class='lj-poll-inner lj-rtebox-inner'>Poll id: "+L+'</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(K)+'" lj-content="'+M+'" data-disabledPoll="true"></iframe>';};function E(K,L,M){var N="<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(M)+'"'+L+'lj-content="'+N+'"></iframe>';};function F(K,L,M,N){return L+M.replace(/\n/g,'')+N;};function G(K,L,M,N){var O=L||M||m.LJRepost_Value,P=N.replace(/"/g,'&quot;');
-N=P+('<br /><input type="button" value="'+O+'" />').replace(/"/g,'&quot;');return '<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+P+'" lj-button="'+O+'" lj-content="'+N+'"></iframe>';};function H(K,L){var M,N,O=0;do{if(!M)M=L.call(K,O)===false;if(!M&&(N=K.firstChild))O++;else if(N=K.nextSibling)M=false;else{N=K.parentNode;O--;M=true;}K=N;}while(O>0);};function I(K,L){return K.replace(/<(.|\n)*?>/g,function(M){var N=M;if(N.indexOf(L)!==-1){N=N.replace(L,'');return N+L;}else return M;});};function J(K,L,M){return[K.slice(0,L),M,K.slice(L)].join('');};t.on('contentDom',function(K){var L=this,M=K.editor.document.getById('__focus');if(M){this._domBuilt=true;setTimeout(function(){K.editor.focus();var N=K.editor.getSelection();if(N){var O=new d.range(K.editor.document);O.setEndAfter(M);N.selectRanges([O]);}M.remove();},this._domBuilt?0:100);}});t.dataProcessor.toHtml=function(K,L){var M=Site.page.__htmlLast;if(typeof M==='number')if(K.length>0)K=I(J(K,M,n),n).replace(n,o);else K=o;K=K.replace(/<lj [^>]*?>/gi,B).replace(/<lj-map [^>]*?>/gi,B).replace(/<lj-template[^>]*?>/gi,B).replace(/(<lj-cut[^>]*?)\/>/gi,'$1>').replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,'<$1$2></$1>').replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,C).replace(/<lj-poll-([0-9]+)>/gi,D).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,G).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,E);K=K.replace(/<table[^>]*>((.|\n)*?)<\/table>/i,function(N){var O=document.createElement('span');O.innerHTML=N;H(O,function(){var P=this;if(P.nodeType===3)if(P.parentNode.nodeName.toLowerCase()!=='td')P.nodeValue=P.nodeValue.replace(/\n/ig,'');});return O.innerHTML;});if(!$('event_format').checked){K=K.replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,F);K=K.replace(/\n/g,'<br/>');}K=a.htmlDataProcessor.prototype.toHtml.call(this,K,L);if(c)K='<xml:namespace ns="livejournal" prefix="lj" />'+K;return K;};})();t.dataProcessor.toDataFormat=function(B,C){B=a.htmlDataProcessor.prototype.toDataFormat.call(this,B,C);if(!$('event_format').checked)B=B.replace(/<br\s*\/>/gi,'\n');return B.replace(/\t/g,' ');};t.dataProcessor.writer.indentationChars='';t.dataProcessor.writer.lineBreakChars='';t.on('selectionChange',z);t.on('doubleclick',u);t.on('afterCommandExec',y);t.on('dialogHide',y);t.on('dataReady',function(){if(c){t.document.getBody().on('dragend',y);t.document.getBody().on('paste',function(){setTimeout(y,0);});}if(!Site.page.disabled_input){t.document.on('click',z);
-t.document.on('mouseover',z);t.document.getBody().on('keyup',w);y();}});(function(){var B='LJFont',C=t.config,D=false,E={},F='normal',G=C.LJFontDefault,H=C.LJFontSize,I=C.LJFontStyle,J='b-fontsize-select-item-active',K,L,M,N,O=jQuery();for(N in H){E[N]=new a.style(I,{size:H[N]});E[N]._.definition.name=N;}function P(Q){G=Q;O.removeClass(J).filter('.b-fontsize-select-item-'+G).addClass(J);};t.addCommand(B,{exec:function(Q){Q.rteButton(B,'font');if(!D){O=jQuery('.b-fontsize-select-item');LiveJournal.register_hook('font_response',function(S){Q.focus();Q.fire('saveSnapshot');var T=E[S],U,V,W;if(G===S)T.remove(Q.document);else{V=Q.getSelection();W=parseFloat(T._.definition.styles['font-size']);for(U in E)E[U].remove(Q.document);T.apply(Q.document);}Q.fire('saveSnapshot');});D=true;var R=Q.getCommand(B);R.setState(1);P(G);}}});t.ui.addButton(B,{label:m[B],command:B});t.on('selectionChange',function(Q){var R=Q.data.path,S=R.elements,T=t.getCommand(B),U,V,W;for(U=0;U<S.length;U++){V=S[U];for(W in E){if(E[W].checkElementRemovable(V,true)){if(W!==G){P(W);T.setState(1);}return;}}}P(F);T.setState(2);});})();(function(){var B='LJImage',C=null;LiveJournal.register_hook('editpic_response',function(D){var E=C,F=E&&E.getParent();if(!E)return;if(D.url){E.setAttribute('src',D.url);E.setAttribute('data-cke-saved-src',D.url);}else{if(F&&F.getName()==='a')F.remove();else E.remove();return;}if(D.width)E.setAttribute('width',D.width);else E.removeAttribute('width');if(D.height)E.setAttribute('height',D.height);else E.removeAttribute('height');if(D.title)E.setAttribute('title',D.title);else E.removeAttribute('title');if(D.border)E.setStyle('border-width',D.border+'px');else{E.removeStyle('border-width');E.removeStyle('border-style');}if(D.vspace)E.setStyles({'margin-top':D.vspace+'px','margin-bottom':D.vspace+'px'});else{E.removeStyle('margin-top');E.removeStyle('margin-bottom');}if(D.hspace)E.setStyles({'margin-left':D.hspace+'px','margin-right':D.hspace+'px'});else{E.removeStyle('margin-left');E.removeStyle('margin-right');}var F=E&&E.getParent();if(D.link){D.link=D.link.replace(/^[\s\t]*(?:http:\/\/)?/,'http://');if(F&&F.getName()==='a'){F.setAttribute('href',D.link);F.setAttribute('data-cke-saved-href',D.link);if(D.blank)F.setAttribute('target','_blank');else F.removeAttribute('target');}else{var G=new h('a',t.document);G.setAttribute('href',D.link);if(D.blank)G.setAttribute('target','_blank');E.insertBeforeMe(G);G.append(E);t.getSelection()&&t.getSelection().selectElement(G);}}else if(F.getName()==='a'){F.insertBeforeMe(E);
-F.remove();}if(D.aligment&&D.aligment!=='none')E.setStyle('float',D.aligment);else E.removeStyle('float');C=null;});t.addCommand(B,{exec:function(D,E){var F=D.getSelection();F=F?F.getSelectedElement():null;C=F;if(F){var G=F&&F.getParent(),H=G.getName()==='a',I=H&&G,J=H&&G.getAttribute('href'),K={};if('naturalWidth' in F.$){K.width=F.$.naturalWidth;K.height=F.$.naturalHeight;}else{var L=new Image();L.src=F.$.src;K={width:L.width,height:L.height};}D.rteButton(B,'editpic',{picData:{url:F.getAttribute('src'),title:F.getAttribute('title'),width:F.getAttribute('width')||F.$.width,height:F.getAttribute('height')||F.$.height,defaultWidth:K.width,defaultHeight:K.height,link:J||'',blank:H?!!I.getAttribute('target'):true,border:parseInt(F.getStyle('border-width'),10),vspace:parseInt(F.getStyle('margin-top'),10),hspace:parseInt(F.getStyle('margin-left'),10),aligment:F.getStyle('float')||'none'}});}else jQuery('.b-updatepage-event-section').editor('handleImageUpload','upload');},editorFocus:false});t.ui.addButton(B,{label:m.LJImage_Title,command:B});})();(function(){var B=null;t.on('selectionChange',function(F){var G=F.data.element;if(G.is('iframe'))B=G;else B=null;});var C='LJEmbedLink',D='video';function E(F){var G=new h('iframe',t.document);if(F!==LiveJournal.getEmbed(F)){var H=h.createFromHtml(LiveJournal.getEmbed(F)),I='',J=LiveJournal.parseMediaLink(F);if(J.preview)I='style="background-image: url('+J.preview+');"';G.setAttribute('lj-url',H.getAttribute('src'));G.setAttribute('data-link',F);G.setAttribute('lj-class','lj-iframe');G.setAttribute('class','lj-iframe-wrap lj-rtebox');G.setAttribute('style','width: 490px; height:370px;');G.setAttribute('lj-style','width: 480px; height:360px;');G.setAttribute('allowfullscreen','true');G.setAttribute('lj-content',encodeURIComponent('<div '+I+" class='lj-embed-inner lj-rtebox-inner'>"+(I?'':'iframe')+'</div>'));}else{G.setAttribute('lj-class','lj-embed');G.setAttribute('class','lj-embed-wrap lj-rtebox');G.setAttribute('lj-content',encodeURIComponent('<div '+I+" class='lj-embed-inner lj-rtebox-inner'>Embed</div>"));}G.setAttribute('lj-data',encodeURIComponent(LiveJournal.getEmbed(F)));G.setAttribute('frameBorder',0);G.setAttribute('allowTransparency','true');G.setAttribute('lj-cmd',C);t.insertElement(G);y();};LiveJournal.register_hook(D+'_response',function(F){E(F);});t.addCommand(C,{exec:function(F){var G=r[C].node||B;if(G)p(C,D,{defaultText:G&&decodeURIComponent(G.getAttribute('data-link')||G.getAttribute('lj-url')||G.getAttribute('lj-data')),editMode:true});
-else p(C,D);}});t.ui.addButton(C,{label:m.LJEmbed,command:C});})();function A(B,C,D){var E,F=r[C].node;if(F){if(E=D.skip||prompt(D.title,F.getAttribute('text')||D.text))if(E==D.text)F.removeAttribute('text');else F.setAttribute('text',E);}else if(E=D.skip||prompt(D.title,D.text)){t.focus();var G=new d.selection(t.document),H=G.getRanges(),I=new h('iframe',t.document),J=I.clone();I.setAttribute('lj-cmd',C);I.setAttribute('lj-class',B+' '+B+'-open');I.setAttribute('class',B+'-wrap');I.setAttribute('frameBorder',0);I.setAttribute('allowTransparency','true');if(E!=D.text)I.setAttribute('text',E);J.setAttribute('lj-class',B+' '+B+'-close');J.setAttribute('class',B+'-wrap');J.setAttribute('frameBorder',0);J.setAttribute('allowTransparency','true');var K=H[0];G.lock();var L=new h('br',t.document),M=L.clone(),N=L.clone(),O=new d.documentFragment(t.document);O.append(L.clone());O.append(I);O.append(M);if(K.collapsed===false)for(var P=0,Q=H.length;P<Q;P++){if(G.getSelectedElement())H[P].enlarge(1);O.append(H[P].extractContents());}O.append(N);t.insertElement(J);L.clone().insertAfter(J);J.insertBeforeMe(O);K.setStart(M,0);K.setEnd(N,0);G.unlock();G.selectRanges(H);t.fire('updateSnapshot');y();}};(function(){var B='LJMap',C='map';LiveJournal.register_hook('map_response',function(D){var E=new h('iframe',t.document),F=425,G=350,H='',I='';if(!isNaN(F)){H+='width:'+F+'px;';I+='width:'+(F-2)+'px;';}if(!isNaN(G)){H+='height:'+G+'px;';I+='height:'+(G-2)+'px;';}var J=r[B].node;if(J)J.setAttributes({'lj-url':D});else{E.setAttributes({'lj-url':D,'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:H,'lj-style':I});t.insertElement(E);}y();});t.addCommand(B,{exec:function(){var D=r[B].node;p(B,C,{defaultText:D?D.getAttribute('lj-url'):'',editMode:D?true:false});},editorFocus:false});t.ui.addButton(B,{label:m.LJMap_Title,command:B});})();(function(){var B='LJSpoiler',C='spoiler';LiveJournal.register_hook('spoiler_response',function(D){A('lj-spoiler',B,{title:m.LJCut_PromptTitle,text:m.LJCut_PromptText,skip:D});});t.addCommand(B,{exec:function(){var D=r[B].node;p(B,C,{defaultText:D?D.getAttribute('text'):'',editMode:D?true:false});},editorFocus:false});t.ui.addButton(B,{label:m.LJSpoiler_Title,command:B});})();(function(){function B(I,J){J=J===undefined||J;var K,L=r.LJLike.node;if(L){var M=I.getAttribute('lj-style');K=M?M.replace(/text-align:\s*(left|right|center)/i,'$1'):'left';
-}else if(J)K=I.getComputedStyle('text-align');else{while(!I.hasAttribute||!(I.hasAttribute('align')||I.getStyle('text-align'))){var N=I.getParent();if(!N)break;I=N;}K=I.getStyle('text-align')||I.getAttribute('align')||'';}K&&(K=K.replace(/-moz-|-webkit-|start|auto/i,''));!K&&J&&(K=I.getComputedStyle('direction')=='rtl'?'right':'left');return K;};function C(I){if(I.editor.readOnly)return;var J=I.editor.getCommand(this.name),K=I.data.element;if((K.type==1&&K.hasAttribute('lj-cmd')&&K.getAttribute('lj-cmd'))=='LJLike')J.state=B(K,t.config.useComputedState)==this.value?1:2;else if(!K||K.type!=1||K.getName()=='body'||K.getName()=='iframe')J.state=2;else J.state=B(K,t.config.useComputedState)==this.value?1:2;J.fire('state');};function D(I,J,K){var M=this;M.name=J;M.value=K;var L=I.config.justifyClasses;if(L){switch(K){case 'left':M.cssClassName=L[0];break;case 'center':M.cssClassName=L[1];break;case 'right':M.cssClassName=L[2];break;}M.cssClassRegex=new RegExp('(?:^|\\s+)(?:'+L.join('|')+')(?=$|\\s)');}};function E(I){var J=I.editor,K=new d.range(J.document);K.setStartBefore(I.data.node);K.setEndAfter(I.data.node);var L=new d.walker(K),M;while(M=L.next()){if(M.type==1){var N='text-align',O=J.config.justifyClasses;if(!M.equals(I.data.node)&&M.getDirection()){K.setStartAfter(M);L=new d.walker(K);continue;}if(O)if(M.hasClass(O[0])){M.removeClass(O[0]);M.addClass(O[2]);}else if(M.hasClass(O[2])){M.removeClass(O[2]);M.addClass(O[0]);}switch(M.getStyle(N)){case 'left':M.setStyle(N,'right');break;case 'right':M.setStyle(N,'left');break;}}}};D.prototype={exec:function(I){var W=this;var J=I.getSelection(),K=I.config.enterMode;if(!J)return;var L=J.createBookmarks();if(r.LJLike.node)r.LJLike.node.setAttribute('lj-style','text-align: '+W.value);else{var M=J.getRanges(true),N=W.cssClassName,O,P,Q=I.config.useComputedState;Q=Q===undefined||Q;for(var R=M.length-1;R>=0;R--){var S=M[R],T=S.getEnclosedNode();if(T&&T.type===1&&T.is('iframe'))return;O=S.createIterator();O.enlargeBr=K!=2;while(P=O.getNextParagraph(K==1?'p':'div')){P.removeAttribute('align');P.removeStyle('text-align');var U=N&&(P.$.className=e.ltrim(P.$.className.replace(W.cssClassRegex,''))),V=W.state==2&&(!Q||B(P,true)!=W.value);if(N){if(V)P.addClass(N);else if(!U)P.removeAttribute('class');}else if(V)P.setStyle('text-align',W.value);}}}I.focus();I.forceNextSelectionCheck();J.selectBookmarks(L);}};var F=new D(t,'LJJustifyLeft','left'),G=new D(t,'LJJustifyCenter','center'),H=new D(t,'LJJustifyRight','right');t.addCommand('LJJustifyLeft',F);
-t.addCommand('LJJustifyCenter',G);t.addCommand('LJJustifyRight',H);t.ui.addButton('LJJustifyLeft',{label:t.lang.justify.left,command:'LJJustifyLeft'});t.ui.addButton('LJJustifyCenter',{label:t.lang.justify.center,command:'LJJustifyCenter'});t.ui.addButton('LJJustifyRight',{label:t.lang.justify.right,command:'LJJustifyRight'});t.on('selectionChange',e.bind(C,F));t.on('selectionChange',e.bind(C,H));t.on('selectionChange',e.bind(C,G));t.on('dirChanged',E);})();(function(){var B='LJPollLink';if(!LJ.pageVar('remoteUser',true))return;LiveJournal.register_hook('poll_response',function(C){var D=new Poll(C),E="<div class='lj-poll-inner lj-rtebox-inner'>"+D.outputHTML()+'</div>',F=D.outputLJtags(),G=r[B].node;if(G){G.setAttribute('lj-content',E);G.setAttribute('lj-data',F);G.removeAttribute('style');}else{G=new h('iframe',t.document);G.setAttribute('lj-content',E);G.setAttribute('lj-cmd','LJPollLink');G.setAttribute('lj-data',F);G.setAttribute('lj-class','lj-poll lj-rtebox');G.setAttribute('class','lj-poll-wrap');G.setAttribute('frameBorder',0);G.setAttribute('allowTransparency','true');t.insertElement(G);}y();});t.addCommand(B,{exec:function(C){var D=r.LJPollLink.node;if(D)p(B,'poll',{ljData:decodeURIComponent(D.getAttribute('lj-data')),editMode:true,disabled:D&&(D.getAttribute('data-disabledPoll')?true:false)});else p(B,'poll');},editorFocus:false});t.ui.addButton(B,{label:m.LJPoll_Title,command:B});})();(function(){var B='LJLike',C='like';q.defaultButtons=[];for(var D=0;D<q.length;D++){btn=q[D];q[btn.id]=q[btn.abbr]=btn;q.defaultButtons.push(btn.id);}LiveJournal.register_hook('like_response',function(E){var F=[],G=[],H=typeof E==='string';for(var I=0,J;I<q.length;I++){J=q[I];if(H&&J.checked||E.indexOf(J.id)!=-1){F.push(J.id);G.push(J.html);}}var K=r[B].node,L=encodeURIComponent('<div class="lj-rtebox-inner lj-like-inner"><span class="lj-like-wrapper">'+G.join('')+'</span></div>');if(K){K.setAttribute('buttons',F.join(','));K.setAttribute('lj-content',L);K.removeAttribute('defaults');}else{K=new h('iframe',t.document);K.setAttribute('lj-class','lj-like');K.setAttribute('class','lj-like-wrap lj-rtebox');K.setAttribute('buttons',F.join(','));K.setAttribute('lj-content',L);K.setAttribute('lj-cmd','LJLike');K.setAttribute('frameBorder',0);K.setAttribute('allowTransparency','true');K.setAttribute('defaults',H);t.insertElement(K);}y();});t.addCommand(B,{exec:function(E){var F=r[B].node;if(F)p(B,C,{buttons:F.getAttribute('buttons'),editMode:true});else p(B,C);},editorFocus:false});
-t.ui.addButton(B,{label:m.LJLike_Title,command:B});})();},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 lj-rtebox';if(w.attributes.hasOwnProperty('style'))y.attributes['lj-style']=w.attributes.style;y.attributes['lj-cmd']='LJLike';y.attributes['lj-content']='<div class="lj-rtebox-inner lj-like-inner"><span class="lj-like-wrapper">';y.attributes.frameBorder=0;y.attributes.allowTransparency='true';var z=w.attributes.buttons&&w.attributes.buttons.split(',')||q.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=q[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></div>';y.attributes.buttons=x.join(',');return y;},'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;},'lj-cut':function(w){v(w,'lj-cut','LJCut2');},'lj-spoiler':function(w){v(w,'lj-spoiler','LJSpoiler','title');},iframe:function(w){if(w.attributes['data-update']==='false')return w;var x='';if(w.attributes['data-link']){var y=LiveJournal.parseMediaLink(w.attributes['data-link']);if(y.preview)x='style="background-image: url('+y.preview+');"';}var z=w.attributes.src;if(w.attributes['lj-class']&&w.attributes['lj-class'].indexOf('lj-')+1==1)return w;var A=new a.htmlParser.element('iframe'),B='',C='',D=Number(w.attributes.width),E=Number(w.attributes.height);if(w.attributes.src.indexOf('kroogi.com')!==-1&&w.attributes.style){var F=w.attributes.style.match(/width:\s([0-9]+)px;/i),G=w.attributes.style.match(/height:\s([0-9]+)px;/i);if(G.length===2&&F.length===2){D=Number(F.pop());E=Number(G.pop());}}if(!isNaN(D)){B+='width:'+D+'px;';C+='width:'+(D-10)+'px;';}if(!isNaN(E)){B+='height:'+E+'px;';C+='height:'+(E-10)+'px;';}if(B.length){A.attributes.style=B;A.attributes['lj-style']=C;}A.attributes['lj-url']=w.attributes.src?encodeURIComponent(w.attributes.src):'';A.attributes['lj-class']='lj-iframe';A.attributes['class']='lj-iframe-wrap lj-rtebox';A.attributes['lj-content']='<div '+x+' class="lj-rtebox-inner">'+(x?'':'iframe')+'</div>';A.attributes.frameBorder=0;A.attributes.allowTransparency='true';if(z!=LiveJournal.getEmbed(decodeURIComponent(w.attributes.src))){A.attributes['lj-cmd']='LJEmbedLink';A.attributes['data-link']=w.attributes['data-link'];}return A;},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';},div:function(w){if(w.attributes['class']=='lj-cut')v(w,'lj-cut','LJCut');}}},5);u.htmlFilter.addRules({elements:{input:function(w){if(w.attributes&&w.attributes.id==='__focus')return false;return w;}}});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':var B=decodeURIComponent(w.attributes['lj-data']);
-x=new a.htmlParser.element('lj-embed');x.attributes.id=w.attributes.id;if(w.attributes.id)x.isEmpty=true;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(G,H,I){x.attributes[H.toLowerCase()]=parseInt(I);});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(G,H,I){x.attributes[H.toLowerCase()]=parseInt(I);});x.attributes.frameBorder=0;if(w.attributes['data-link'])x.attributes['data-link']=w.attributes['data-link'];break;case 'lj-poll':var B=decodeURIComponent(w.attributes['lj-data']);x=new a.htmlParser.fragment.fromHtml(B).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 C=w.next,D=0;x=new a.htmlParser.element(A);if(w.attributes.hasOwnProperty('text'))x.attributes[z]=w.attributes.text;while(C){if(C.name=='iframe'){var E=C.attributes['lj-class'];if(E&&E.indexOf(A+'-close')+1){if(y&&D)D--;else{x.next=C;break;}}else if(E&&E.indexOf(A+'-open')+1)if(y)D++;else{x.next=C;break;}}C.parent.children.remove(C);x.add(C);var F=C.next;C.next=null;C=F;}}else x=false;break;default:if(!w.children.length)x=false;}return x;},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">'+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;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(J){return B.tmpl.bubbleItem.supplant({word:J});}),H=null,I;if(G.length===0)G.push(B.tmpl.bubbleItemNoSuggestions);G.push(B.tmpl.bubbleItemSkip);Function.defer(function(){C.html(B.tmpl.bubbleList.supplant({items:G.join('')})).off('click').on('click',B.selectors.bubbleItem,function(){var J=m(this).text(),K=m(this).hasClass(B.classNames.skipError);C.bubble('hide');if(m(this).hasClass(B.classNames.bubbleNoSuggestions))return;if(K)J=F;H=z.find('span[data-id="'+E.data('id')+'"]');
-(function(){var L=h.get(H.first().get(0)),M=new d.range(v.document),N=v.getSelection(),O;N.selectElement(L);N.getRanges()[0].collapse();O=N.getRanges()[0].createBookmark(true);M.moveToBookmark(O);H.first().replaceWith(J);if(H.length)H.slice(1).detach();setTimeout(function(){if(!v.focusManager.hasFocus)v.focus();N.selectRanges([M]);if(K){LiveJournal.run_hook('skipWord',J);a.ljspell.removeHighlightFromWord(J);}},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(ab){var ac=z.document.getBody();return ab?m(ac.$):ac;};function O(ab){var ac=[];E.searchRange=u(1,z);E.matchRange=null;while((range=E.find(ab,false,false,false))!==false)ac.push(range);return ac;};function P(ab){D=ab;if(!J)J=m('.cke_button_'+x);J.toggleClass('active',D);};function Q(ab){var ac=[],ad=null;ab=ab.trim().toLowerCase();if(ab.trim().length===0)return[];ad=ab.replace(/\&nbsp;/ig,' ').match(/[a-zа-яё]+/gi);if(ad)return ad.reduce(function(ae,af){if(ae.indexOf(af)===-1)ae.push(af);return ae;},[]);else return[];};function R(){var ab=m('<div />',{html:z.getData()}).text(),ac=Q(ab);T(ac);return ac;};function S(ab){ab.forEach(function(ac){G[ac]=true;});};function T(ab){H=H.filter(function(ac){return ab.indexOf(ac)!==-1;});ab.forEach(function(ac){if(I.hasOwnProperty(ac)&&H.indexOf(ac)===-1)H.push(ac);});};function U(){var ab=R();ab=ab.filter(function(ac){return!G[ac];});if(ab.length>0){S(ab);return ab;}else return false;return ab.length>0?ab:false;};function V(){var ab=U();if(!ab)return;m.ajax({url:F,type:'POST',dataType:'json',data:{html:ab.join(' ')},async:false,success:function(ac){var ad=Object.keys(ac.words);if(ad.length){m.extend(I,ac.words);H=H.concat(ad);}}});};function W(ab){var ac=this,ad=null;if(!D)return;setTimeout(function(){A.save();ad=s._.definition.attributes;ad['data-word']=ab;O(ab).forEach(function(ae){C+=1;ad['data-id']=C;ae.highlight();});A.restore();},0);};function X(){V();Z();H.forEach(W);};function Y(ab){N(true).find("span[data-incorrect][data-word='"+ab+"']").each(function(){var ac=m(this);ac.replaceWith(ac.text());});};function Z(){if(C===0)return;A.save();m(z.document.getBody().$).find('span[data-incorrect]').each(function(ab,ac){var ad=m(ac);ad.replaceWith(ad.html());});A.restore();C=0;};function aa(ab){delete I[ab];H=H.filter(function(ac){return ac!==ab;
-});};M={init:function(){if(!B){P(D);if(D)setTimeout(X,1000);LiveJournal.register_hook('skipWord',function(ab){aa(ab);S([ab]);});B=true;}},on:function(){P(true);X();},off:function(){P(false);Z();},isEnabled:function(){return D;},toggle:function(){P(!D);},highlightWord:W,removeHighlightFromWord:Y,highlight:X,removeHighlight:Z,skipWord:aa,change:function(){if(K)clearTimeout(K);K=setTimeout(function(){if(D)X();else Z();},L);},getSuggestions:function(ab){return ab===undefined?I:I[ab]||[];},getWordRanges:O,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(R());LJ.console.log('--- new words in the editor');LJ.console.log(U());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,{label:CKLang.LJSpell_Title,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%">');
+G.close();}};t.updateFrames=y;t.on('dataReady',function(){setTimeout(y,100);});function z(B){t.fire('updateSnapshot');if(t.onSwitch===true){delete t.onSwitch;return;}var C,D=B.name=='click',E=B.name=='selectionChange'||D,F=B.data.element||B.data.getTarget(),G,H;if(D&&(B.data.getKey()==1||B.data.$.button==0))B.data.preventDefault();if(F.type!=1)F=F.getParent();G=F;if(E){var I=t.document.getElementsByTag('iframe'),J,K;if(D&&G.is('iframe')){K=G.$.contentWindow.document.body;K.className=(G.getAttribute('lj-class')||'')+' lj-selected';if(G.getAttribute('lj-cmd')=='LJPollLink')G.setStyle('height',K.scrollHeight+'px');}for(var L=0,M=I.count();L<M;L++){J=I.getItem(L);if(J.$!=G.$){K=J.$.contentWindow.document.body;K.className=J.getAttribute('lj-class')||'';if(J.getAttribute('lj-cmd')=='LJPollLink'&&K.className.indexOf('lj-poll')!=-1)J.removeAttribute('style');}}}do{var N=G.getAttribute('lj-cmd');if(!N&&G.type==1){var O=G.getParent();if(G.is('img')&&!G.hasAttribute('data-user')&&O.getParent()&&!O.getParent().hasAttribute('data-user')){N='LJImage';G.setAttribute('lj-cmd',N);}else if(G.is('a')&&!G.hasAttribute('data-user')&&!O.hasAttribute('lj:user')){N='LJLink2';G.setAttribute('lj-cmd',N);}}if(N&&r.hasOwnProperty(N)){if(E){r[N].node=G;t.getCommand(N).setState(1);}(C||(C={}))[N]={content:r[N].html,node:G};}}while(G=G.getParent());var P;if(E)for(H in r){if(r.hasOwnProperty(H)&&(!C||!C.hasOwnProperty(H))){delete r[H].node;P=t.getCommand(H);if(P)P.setState(2);}}t.fire('updateSnapshot');};(function(){function B(K){return K.slice(-2)=='/>'?K:K.slice(0,-1)+'/>';};function C(K){var L=new Poll(K),M="<div class='lj-poll-inner lj-rtebox-inner'>"+L.outputHTML()+'</div>';return '<iframe class="lj-poll-wrap lj-rtebox" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+L.outputLJtags()+'" lj-content="'+M+'"></iframe>';};function D(K,L){var M="<div class='lj-poll-inner lj-rtebox-inner'>Poll id: "+L+'</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(K)+'" lj-content="'+M+'" data-disabledPoll="true"></iframe>';};function E(K,L,M){var N="<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(M)+'"'+L+'lj-content="'+N+'"></iframe>';};function F(K,L,M,N){return L+M.replace(/\n/g,'')+N;
+};function G(K,L,M,N){var O=L||M||m.LJRepost_Value,P=N.replace(/"/g,'&quot;');N=P+('<br /><input type="button" value="'+O+'" />').replace(/"/g,'&quot;');return '<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+P+'" lj-button="'+O+'" lj-content="'+N+'"></iframe>';};function H(K,L){var M,N,O=0;do{if(!M)M=L.call(K,O)===false;if(!M&&(N=K.firstChild))O++;else if(N=K.nextSibling)M=false;else{N=K.parentNode;O--;M=true;}K=N;}while(O>0);};function I(K,L){return K.replace(/<(.|\n)*?>/g,function(M){var N=M;if(N.indexOf(L)!==-1){N=N.replace(L,'');return N+L;}else return M;});};function J(K,L,M){return[K.slice(0,L),M,K.slice(L)].join('');};t.on('contentDom',function(K){var L=this,M=K.editor.document.getById('__focus');if(M){this._domBuilt=true;setTimeout(function(){K.editor.focus();var N=K.editor.getSelection();if(N){var O=new d.range(K.editor.document);O.setEndAfter(M);N.selectRanges([O]);}M.remove();},this._domBuilt?0:100);}});t.dataProcessor.toHtml=function(K,L){var M=Site.page.__htmlLast;if(typeof M==='number')if(K.length>0)K=I(J(K,M,n),n).replace(n,o);else K=o;K=K.replace(/<lj [^>]*?>/gi,B).replace(/<lj-map [^>]*?>/gi,B).replace(/<lj-template[^>]*?>/gi,B).replace(/(<lj-cut[^>]*?)\/>/gi,'$1>').replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,'<$1$2></$1>').replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,C).replace(/<lj-poll-([0-9]+)>/gi,D).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,G).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,E);K=K.replace(/<table[^>]*>((.|\n)*?)<\/table>/i,function(N){var O=document.createElement('span');O.innerHTML=N;H(O,function(){var P=this;if(P.nodeType===3)if(P.parentNode.nodeName.toLowerCase()!=='td')P.nodeValue=P.nodeValue.replace(/\n/ig,'');});return O.innerHTML;});if(!$('event_format').checked){K=K.replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,F);K=K.replace(/\n/g,'<br/>');}K=a.htmlDataProcessor.prototype.toHtml.call(this,K,L);if(c)K='<xml:namespace ns="livejournal" prefix="lj" />'+K;return K;};})();t.dataProcessor.toDataFormat=function(B,C){B=a.htmlDataProcessor.prototype.toDataFormat.call(this,B,C);if(!$('event_format').checked)B=B.replace(/<br\s*\/>/gi,'\n');return B.replace(/\t/g,' ');};t.dataProcessor.writer.indentationChars='';t.dataProcessor.writer.lineBreakChars='';t.on('selectionChange',z);t.on('doubleclick',u);t.on('afterCommandExec',y);t.on('dialogHide',y);t.on('dataReady',function(){if(c){t.document.getBody().on('dragend',y);
+t.document.getBody().on('paste',function(){setTimeout(y,0);});}if(!Site.page.disabled_input){t.document.on('click',z);t.document.on('mouseover',z);t.document.getBody().on('keyup',w);y();}});(function(){var B='LJFont',C=t.config,D=false,E={},F='normal',G=C.LJFontDefault,H=C.LJFontSize,I=C.LJFontStyle,J='b-fontsize-select-item-active',K,L,M,N,O=jQuery();for(N in H){E[N]=new a.style(I,{size:H[N]});E[N]._.definition.name=N;}function P(Q){G=Q;O.removeClass(J).filter('.b-fontsize-select-item-'+G).addClass(J);};t.addCommand(B,{exec:function(Q){Q.rteButton(B,'font');if(!D){O=jQuery('.b-fontsize-select-item');LiveJournal.register_hook('font_response',function(S){Q.focus();Q.fire('saveSnapshot');var T=E[S],U,V,W;if(G===S)T.remove(Q.document);else{V=Q.getSelection();W=parseFloat(T._.definition.styles['font-size']);for(U in E)E[U].remove(Q.document);T.apply(Q.document);}Q.fire('saveSnapshot');});D=true;var R=Q.getCommand(B);R.setState(1);P(G);}}});t.ui.addButton(B,{label:m[B],command:B});t.on('selectionChange',function(Q){var R=Q.data.path,S=R.elements,T=t.getCommand(B),U,V,W;for(U=0;U<S.length;U++){V=S[U];for(W in E){if(E[W].checkElementRemovable(V,true)){if(W!==G){P(W);T.setState(1);}return;}}}P(F);T.setState(2);});})();(function(){var B='LJImage',C=null;LiveJournal.register_hook('editpic_response',function(D){var E=C,F=E&&E.getParent();if(!E)return;if(D.url){E.setAttribute('src',D.url);E.setAttribute('data-cke-saved-src',D.url);}else{if(F&&F.getName()==='a')F.remove();else E.remove();return;}if(D.width)E.setAttribute('width',D.width);else E.removeAttribute('width');if(D.height)E.setAttribute('height',D.height);else E.removeAttribute('height');if(D.title)E.setAttribute('title',D.title);else E.removeAttribute('title');if(D.border)E.setStyle('border-width',D.border+'px');else{E.removeStyle('border-width');E.removeStyle('border-style');}if(D.vspace)E.setStyles({'margin-top':D.vspace+'px','margin-bottom':D.vspace+'px'});else{E.removeStyle('margin-top');E.removeStyle('margin-bottom');}if(D.hspace)E.setStyles({'margin-left':D.hspace+'px','margin-right':D.hspace+'px'});else{E.removeStyle('margin-left');E.removeStyle('margin-right');}var F=E&&E.getParent();if(D.link){D.link=D.link.replace(/^[\s\t]*(?:http:\/\/)?/,'http://');if(F&&F.getName()==='a'){F.setAttribute('href',D.link);F.setAttribute('data-cke-saved-href',D.link);if(D.blank)F.setAttribute('target','_blank');else F.removeAttribute('target');}else{var G=new h('a',t.document);G.setAttribute('href',D.link);if(D.blank)G.setAttribute('target','_blank');
+E.insertBeforeMe(G);G.append(E);t.getSelection()&&t.getSelection().selectElement(G);}}else if(F.getName()==='a'){F.insertBeforeMe(E);F.remove();}if(D.aligment&&D.aligment!=='none')E.setStyle('float',D.aligment);else E.removeStyle('float');C=null;});t.addCommand(B,{exec:function(D,E){var F=D.getSelection();F=F?F.getSelectedElement():null;C=F;if(F){var G=F&&F.getParent(),H=G.getName()==='a',I=H&&G,J=H&&G.getAttribute('href'),K={};if('naturalWidth' in F.$){K.width=F.$.naturalWidth;K.height=F.$.naturalHeight;}else{var L=new Image();L.src=F.$.src;K={width:L.width,height:L.height};}D.rteButton(B,'editpic',{picData:{url:F.getAttribute('src'),title:F.getAttribute('title'),width:F.getAttribute('width')||F.$.width,height:F.getAttribute('height')||F.$.height,defaultWidth:K.width,defaultHeight:K.height,link:J||'',blank:H?!!I.getAttribute('target'):true,border:parseInt(F.getStyle('border-width'),10),vspace:parseInt(F.getStyle('margin-top'),10),hspace:parseInt(F.getStyle('margin-left'),10),aligment:F.getStyle('float')||'none'}});}else jQuery('.b-updatepage-event-section').editor('handleImageUpload','upload');},editorFocus:false});t.ui.addButton(B,{label:m.LJImage_Title,command:B});})();(function(){var B=null;t.on('selectionChange',function(F){var G=F.data.element;if(G.is('iframe'))B=G;else B=null;});var C='LJEmbedLink',D='video';function E(F){var G=new h('iframe',t.document);if(F!==LiveJournal.getEmbed(F)){var H=h.createFromHtml(LiveJournal.getEmbed(F)),I='',J=LiveJournal.parseMediaLink(F);if(J.preview)I='style="background-image: url('+J.preview+');"';G.setAttribute('lj-url',H.getAttribute('src'));G.setAttribute('data-link',F);G.setAttribute('lj-class','lj-iframe');G.setAttribute('class','lj-iframe-wrap lj-rtebox');G.setAttribute('style','width: 490px; height:370px;');G.setAttribute('lj-style','width: 480px; hei...
 (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