spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23419: LJSUP-14456: [RTE] Cursor jumps to the b...

Committer: atyurin
LJSUP-14456: [RTE] Cursor jumps to the beginnig of sentense after clicking over the button "Change font"
U   trunk/htdocs/js/ck/ckeditor.js
Modified: trunk/htdocs/js/ck/ckeditor.js
===================================================================
--- trunk/htdocs/js/ck/ckeditor.js	2012-12-05 11:42:01 UTC (rev 23418)
+++ trunk/htdocs/js/ck/ckeditor.js	2012-12-05 12:02:02 UTC (rev 23419)
@@ -154,7 +154,7 @@
 i.colorButton_backStyle={element:'span',styles:{'background-color':'#(color)'}};j.colordialog={init:function(m){m.addCommand('colordialog',new a.dialogCommand('colordialog'));a.dialog.add('colordialog',this.path+'dialogs/colordialog.js');}};j.add('colordialog',j.colordialog);j.add('ljcolor',{requires:['styles'],init:function(m){var n='LJColor';m.on('selectionChange',function(t){var u=t.data.element,v=m.getCommand(n);if(u.is('span')&&u.getStyle('color'))v.setState(1);else v.setState(2);});var o=m.config,p=m.lang.colorButton;function q(t){t=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);var u='#'+('0'+parseInt(t[1],10).toString(16)).slice(-2)+('0'+parseInt(t[2],10).toString(16)).slice(-2)+('0'+parseInt(t[3],10).toString(16)).slice(-2);return u.toUpperCase();};function r(t,u){m.focus();m.fire('saveSnapshot');new a.style(o['colorButton_'+u+'Style'],{color:'inherit'}).remove(m.document);if(t){var v=o['colorButton_'+u+'Style'];v.childRule=u=='back'?function(w){return s(w);}:function(w){return!(w.is('a')||w.getElementsByTag('a').count())||s(w);};new a.style(v,{color:t}).apply(m.document);}m.fire('saveSnapshot');};LiveJournal.register_hook('selectedColor',function(t){r(t,'fore');});m.ui.addButton(n,{label:p.textColorTitle,command:n});m.addCommand(n,{exec:function(t){var u=null,v=t.getSelection();if(v){var w=v.getRanges()[0],x=w.startContainer.getParent();if(x.is('span')){u=x.getStyle('color');if(u)u=q(u);}}t.rteButton(n,'color',{selectedColor:u});}});function s(t){return t.getAttribute('contentEditable')=='false'||t.getAttribute('data-nostyle');};}});i.colorButton_foreStyle={element:'span',styles:{color:'#(color)'},overrides:[{element:'font',attributes:{color:null}}]};j.add('ljlink',{init:function(m){m.addCommand('link',new a.dialogCommand('link'));m.addCommand('unlink',new a.unlinkCommand());if(jQuery.browser.webkit)m.on('contentDom',function(){this.document.on('keydown',function(B){if(B.data.getKey()===13){var C=m.getSelection(),D,E;if(!C)return;D=C.getRanges()[0];E=D.endContainer.getParent();var F=D.checkStartOfBlock(),G=D.checkEndOfBlock();if(E.is('a')&&D.collapsed||D.endContainer.type===1&&D.endContainer.is('a')){m.insertHtml('<span>&nbsp;</span>');setTimeout(function(){if(G&&E&&E.getNext())E.getNext().remove();},100);}}});});m.on('selectionChange',function(B){if(m.readOnly)return;var C=m.getCommand('unlink'),D=B.data.path.lastElement&&B.data.path.lastElement.getAscendant('a',true);if(D&&D.getName()=='a'&&D.getAttribute('href')&&D.getChildCount())C.setState(2);else C.setState(0);
 });var n=/^javascript:/,o=/^mailto:([^?]+)(?:\?(.+))?$/,p=/subject=([^;?:@&=$,\/]*)/,q=/body=([^;?:@&=$,\/]*)/,r=/^#(.*)$/,s=/^((?:http|https|ftp|news):\/\/)?(.*)$/,t=/^(_(?:self|top|parent|blank))$/,u=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,v=/^javascript:([^(]+)\(([^)]+)\)$/,w=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,x=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,y=function(B,C){var D=C&&(C.data('cke-saved-href')||C.getAttribute('href'))||'',E,F,G,H,I={};if(E=D.match(n))if(emailProtection=='encode')D=D.replace(u,function(aa,ab,ac){return 'mailto:'+String.fromCharCode.apply(String,ab.split(','))+(ac&&unescapeSingleQuote(ac));});else if(emailProtection)D.replace(v,function(aa,ab,ac){if(ab==compiledProtectionFunction.name){I.type='email';var ad=I.email={},ae=/[^,\s]+/g,af=/(^')|('$)/g,ag=ac.match(ae),ah=ag.length,ai,aj;for(var ak=0;ak<ah;ak++){aj=decodeURIComponent(unescapeSingleQuote(ag[ak].replace(af,'')));ai=compiledProtectionFunction.params[ak].toLowerCase();ad[ai]=aj;}ad.address=[ad.name,ad.domain].join('@');}});if(!I.type)if(G=D.match(r)){I.type='anchor';I.anchor={};I.anchor.name=I.anchor.id=G[1];}else if(F=D.match(o)){var J=D.match(p),K=D.match(q);I.type='email';var L=I.email={};L.address=F[1];J&&(L.subject=decodeURIComponent(J[1]));K&&(L.body=decodeURIComponent(K[1]));}else if(D&&(H=D.match(s))){I.type='url';I.url={};I.url.protocol=H[1];I.url.url=H[2];}else I.type='url';if(C){var M=C.getAttribute('target');I.target={};I.adv={};if(!M){var N=C.data('cke-pa-onclick')||C.getAttribute('onclick'),O=N&&N.match(w);if(O){I.target.type='popup';I.target.name=O[1];var P;while(P=x.exec(O[2])){if((P[2]=='yes'||P[2]=='1')&&!(P[1] in {height:1,width:1,top:1,left:1}))I.target[P[1]]=true;else if(isFinite(P[2]))I.target[P[1]]=P[2];}}}else{var Q=M.match(t);if(Q)I.target.type=I.target.name=M;else{I.target.type='frame';I.target.name=M;}}var R=this,S=function(aa,ab){var ac=C.getAttribute(ab);if(ac!==null)I.adv[aa]=ac||'';};S('advId','id');S('advLangDir','dir');S('advAccessKey','accessKey');I.adv.advName=C.data('cke-saved-name')||C.getAttribute('name')||'';S('advLangCode','lang');S('advTabIndex','tabindex');S('advTitle','title');S('advContentType','type');j.link.synAnchorSelector?I.adv.advCSSClasses=getLinkClass(C):S('advCSSClasses','class');S('advCharset','charset');S('advStyles','style');S('advRel','rel');}var T=I.anchors=[],U;if(j.link.emptyAnchorFix){var V=B.document.getElementsByTag('a');
 for(i=0,count=V.count();i<count;i++){U=V.getItem(i);if(U.data('cke-saved-name')||U.hasAttribute('name'))T.push({name:U.data('cke-saved-name')||U.getAttribute('name'),id:U.getAttribute('id')});}}else{var W=new d.nodeList(B.document.$.anchors);for(var X=0,Y=W.count();X<Y;X++){U=W.getItem(X);T[X]={name:U.getAttribute('name'),id:U.getAttribute('id')};}}if(j.link.fakeAnchor){var Z=B.document.getElementsByTag('img');for(X=0,Y=Z.count();X<Y;X++){if(U=j.link.tryRestoreFakeAnchor(B,Z.getItem(X)))T.push({name:U.getAttribute('name'),id:U.getAttribute('id')});}}this.selectedElement=C;return I;};LiveJournal.register_hook('link_response',function(B){var K=this;var C=B.url,D=B.target||'';if(C.length===0){m.execCommand('unlink');delete K.selectedElement;return;}if(!C.match(/^[a-z+]+:(\/\/)?/))C='http://'+C;var E={};E['data-cke-saved-href']=C;E.href=C;if(D)E.target=D;if(!K.selectedElement){var F=new h('a'),G=m.getSelection();F.setAttributes({'data-cke-saved-href':C,href:C});if(D)F.setAttribute('target',D);F.setText(z||C);m.insertElement(F);}else{var H=K.selectedElement,I=H.data('cke-saved-href'),J=H.getHtml();if(!E[D])H.removeAttribute('target');H.setAttributes(E);delete K.selectedElement;}});var z;LiveJournal.register_hook('link_hide',function(B){if(this.selectedElement)delete this.selectedElement;z='';});var A='LJLink2';m.addCommand(A,{exec:function(B){var C=B.getSelection(),D={},E=null;z=C.getSelectedText();if((E=j.link.getSelectedLink(B))&&E.hasAttribute('href'))C.selectElement(E);else E=null;var F='';if(E){var G=y(B,E).url;F=(G.protocol||'http://')+G.url;}D.defaultText=F;D.hasSelectedText=!!E;D.editMode=!!E;if(E)D.hasTarget=E.hasAttribute('target')?true:false;B.rteButton(A,'link',D);},editorFocus:false});m.ui.addButton(A,{label:m.lang.link.toolbar,command:A});},afterInit:function(m){var n=m.dataProcessor,o=n&&n.dataFilter,p=n&&n.htmlFilter,q=m._.elementsPath&&m._.elementsPath.filters;if(o)o.addRules({elements:{a:function(r){var s=r.attributes;if(!s.name)return null;var t=!r.children.length;if(j.link.synAnchorSelector){var u=t?'cke_anchor_empty':'cke_anchor',v=s['class'];if(s.name&&(!v||v.indexOf(u)<0))s['class']=(v||'')+' '+u;if(t&&j.link.emptyAnchorFix){s.contenteditable='false';s['data-cke-editable']=1;}}else if(j.link.fakeAnchor&&t)return m.createFakeParserElement(r,'cke_anchor','anchor');return null;}}});if(j.link.emptyAnchorFix&&p)p.addRules({elements:{a:function(r){delete r.attributes.contenteditable;}}});if(q)q.push(function(r,s){if(s=='a')if(j.link.tryRestoreFakeAnchor(m,r)||r.getAttribute('name')&&(!r.getAttribute('href')||!r.getChildCount()))return 'anchor';
-});},requires:['fakeobjects']});j.link={getSelectedLink:function(m){try{var n=m.getSelection();if(n.getType()==3){var o=n.getSelectedElement();if(o.is('a'))return o;}var p=n.getRanges(true)[0];p.shrink(2);var q=p.getCommonAncestor();return q.getAscendant('a',true);}catch(r){return null;}},fakeAnchor:b.opera||b.webkit,synAnchorSelector:c,emptyAnchorFix:c&&b.version<8,tryRestoreFakeAnchor:function(m,n){if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='anchor'){var o=m.restoreRealElement(n);if(o.data('cke-saved-name'))return o;}}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p=n.getRanges(),q,r;for(var s=0;s<p.length;s++){q=p[s].getCommonAncestor(true);r=q.getAscendant('a',true);if(!r)continue;p[s].selectNodeContents(r);}n.selectRanges(p);m.document.$.execCommand('unlink',false,null);n.selectBookmarks(o);},startDisabled:true};a.removeAnchorCommand=function(){};a.removeAnchorCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p;if(n&&(p=n.getSelectedElement())&&(j.link.fakeAnchor&&!p.getChildCount()?j.link.tryRestoreFakeAnchor(m,p):p.is('a')))p.remove(1);else if(p=j.link.getSelectedLink(m))if(p.hasAttribute('href')){p.removeAttributes({name:1,'data-cke-saved-name':1});p.removeClass('cke_anchor');}else p.remove(1);n.selectBookmarks(o);}};(function(m){'use strict';j.add('ljfont',{init:function(p){var q='LJFont',r=p.config,s=false,t={},u='normal',v=r.LJFontDefault,w=r.LJFontSize,x=r.LJFontStyle,y='b-fontsize-select-item-active',z,A=m();for(z in w){t[z]=new a.style(x,{size:w[z]});t[z]._.definition.name=z;}function B(C){v=C;A.removeClass(y).filter('.b-fontsize-select-item-'+v).addClass(y);};p.addCommand(q,{exec:function(C){C.rteButton(q,'font');if(!s){A=m('.b-fontsize-select-item');LiveJournal.register_hook('font_response',function(E){C.focus();C.fire('saveSnapshot');var F=t[E],G,H,I;if(v===E)F.remove(C.document);else{H=C.getSelection();I=parseFloat(F._.definition.styles['font-size']);for(G in t)t[G].remove(C.document);F.apply(C.document);}C.fire('saveSnapshot');});s=true;var D=C.getCommand(q);D.setState(1);B(v);}}});p.ui.addButton(q,{label:a.CKLang[q],command:q});p.on('selectionChange',function(C){var D=C.data.path,E=D.elements,F=p.getCommand(q),G,H,I;for(G=0;G<E.length;G++){H=E[G];for(I in t){if(t[I].checkElementRemovable(H,true)){if(I!==v){B(I);F.setState(1);}return;}}}B(u);F.setState(2);});},requires:['styles']});i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};
+});},requires:['fakeobjects']});j.link={getSelectedLink:function(m){try{var n=m.getSelection();if(n.getType()==3){var o=n.getSelectedElement();if(o.is('a'))return o;}var p=n.getRanges(true)[0];p.shrink(2);var q=p.getCommonAncestor();return q.getAscendant('a',true);}catch(r){return null;}},fakeAnchor:b.opera||b.webkit,synAnchorSelector:c,emptyAnchorFix:c&&b.version<8,tryRestoreFakeAnchor:function(m,n){if(n&&n.data('cke-real-element-type')&&n.data('cke-real-element-type')=='anchor'){var o=m.restoreRealElement(n);if(o.data('cke-saved-name'))return o;}}};a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p=n.getRanges(),q,r;for(var s=0;s<p.length;s++){q=p[s].getCommonAncestor(true);r=q.getAscendant('a',true);if(!r)continue;p[s].selectNodeContents(r);}n.selectRanges(p);m.document.$.execCommand('unlink',false,null);n.selectBookmarks(o);},startDisabled:true};a.removeAnchorCommand=function(){};a.removeAnchorCommand.prototype={exec:function(m){var n=m.getSelection(),o=n.createBookmarks(),p;if(n&&(p=n.getSelectedElement())&&(j.link.fakeAnchor&&!p.getChildCount()?j.link.tryRestoreFakeAnchor(m,p):p.is('a')))p.remove(1);else if(p=j.link.getSelectedLink(m))if(p.hasAttribute('href')){p.removeAttributes({name:1,'data-cke-saved-name':1});p.removeClass('cke_anchor');}else p.remove(1);n.selectBookmarks(o);}};(function(m){'use strict';j.add('ljfont',{init:function(p){var q='LJFont',r=p.config,s=false,t={},u='normal',v=r.LJFontDefault,w=r.LJFontSize,x=r.LJFontStyle,y='b-fontsize-select-item-active',z,A=m();for(z in w){t[z]=new a.style(x,{size:w[z]});t[z]._.definition.name=z;}function B(C){v=C;A.removeClass(y).filter('.b-fontsize-select-item-'+v).addClass(y);};p.addCommand(q,{exec:function(C){C.rteButton(q,'font');if(!s){A=m('.b-fontsize-select-item');LiveJournal.register_hook('font_response',function(E){C.focus();C.fire('saveSnapshot');var F=t[E],G,H,I;if(v===E)F.remove(C.document);else{H=C.getSelection();I=parseFloat(F._.definition.styles['font-size']);for(G in t)t[G].remove(C.document);F.apply(C.document);}C.fire('saveSnapshot');});s=true;var D=C.getCommand(q);D.setState(1);B(v);}},editorFocus:false});p.ui.addButton(q,{label:a.CKLang[q],command:q});p.on('selectionChange',function(C){var D=C.data.path,E=D.elements,F=p.getCommand(q),G,H,I;for(G=0;G<E.length;G++){H=E[G];for(I in t){if(t[I].checkElementRemovable(H,true)){if(I!==v){B(I);F.setState(1);}return;}}}B(u);F.setState(2);});},requires:['styles']});i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};
 var n={tiny:'0.7em',small:'0.9em',normal:'1.0em',large:'1.4em',huge:'1.8em'};i.fontSize_sizes='';for(var o in n)i.fontSize_sizes+=Site.ml_text['talk.font.'+o]+'/'+n[o]+';';i.fontSize_defaultLabel=Site.ml_text['talk.font.normal'];i.fontSize_style={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};})(jQuery);(function(m){'use strict';var n={LJCut:{tag:'lj-cut',widget:'cut'},LJSpoiler:{tag:'lj-spoiler',widget:'spoiler'}};j.add('ljcut',{init:function(o){var p,q,r=null;function s(y){var z=y;while(!z.getParent().is('body'))z=z.getParent();if(z!==y)y.breakParent(z);};function t(){var y=jQuery(o.document.getBody().$),z=false;y.find('ul, ol, li').each(function(){if(m(this).text().length===0){m(this).remove();z=true;}});};function u(y,z){var A=new d.selection(o.document),B=false,C=n[y].tag,D=new h('iframe',o.document),E=new h('br',o.document);D.setAttributes({'lj-cmd':y,'lj-class':C+' '+C+'-open','class':C+'-wrap',frameBorder:0,allowTransparency:'true'});if(typeof z!=='undefined')D.setAttribute('text',z);var F=D.clone();F.setAttribute('lj-class',C+' '+C+'-close');if(q.cloneContents().getChildCount()===0)B=true;q.insertNode(D);q.collapse();q.insertNode(F);s(D);s(F);if(B){E.clone().insertAfter(D);E.clone().insertBefore(F);}var G=new d.range(o.document);G.setStartAfter(D);G.setEndBefore(F);A.selectRanges([G]);o.focus();t();};function v(y,z){if(r&&r.getAttribute('lj-cmd')===y)r.setAttribute('text',z);else{u(y,z===Site.page.rtedata[y+'_PromptText']?undefined:z);o.updateFrames();}};function w(y,z){o.addCommand(y,{exec:function(){var A=new d.selection(o.document);p=A&&A.getSelectedElement();q=A.getRanges()[0];var B={defaultText:r?r.getAttribute('text'):'',editMode:r?true:false};if(r&&r.getAttribute('lj-cmd')!==y)B=null;o.rteButton(y,z,B);},editorFocus:false});o.ui.addButton(y,{label:a.CKLang[y+'_Title'],command:y});};LiveJournal.register_hook('cut_response',function(y){v('LJCut',y);});LiveJournal.register_hook('spoiler_response',function(y){v('LJSpoiler',y);});o.on('selectionChange',function(y){var z=y.data.element;if(z&&z.is('iframe')&&n[z.getAttribute('lj-cmd')])r=z;else r=null;});o.on('contentDom',function(){o.updateFrames();});for(var x in n)w(x,n[x].widget);},afterInit:function(o){function p(q,r,s){var t=n[r].tag;s=s||'text';var u=new a.htmlParser.element('iframe');u.attributes['lj-class']=t+' '+t+'-open';u.attributes['class']=t+'-wrap';u.attributes['lj-cmd']=r;u.attributes.frameBorder=0;u.attributes.allowTransparency='true';
 if(q.attributes.hasOwnProperty(s))u.attributes.text=q.attributes[s];q.children.unshift(u);var v=new a.htmlParser.element('iframe');v.attributes['lj-class']=t+' '+t+'-close';v.attributes['class']=t+'-wrap';v.attributes.frameBorder=0;v.attributes.allowTransparency='true';q.children.push(v);delete q.name;};o.dataProcessor.dataFilter.addRules({elements:{'lj-cut':function(q){p(q,'LJCut');},'lj-spoiler':function(q){p(q,'LJSpoiler','title');}}});}});})(jQuery);(function(m){'use strict';var n='LJUser2',o='user',p={},q={},r='/img/userinfo-disabled.gif';j.add('ljuser2',{init:function(s){var t=null,u=new Image();u.src='/img/preloader/preloader-blue-white-xl.gif';s.on('selectionChange',function(y){var z=y.data.element;s.getCommand(n).setState(z.hasAttribute('data-user')?1:2);t=z.hasAttribute('data-user')?z:null;});function v(y){var z={};if(!y)return null;if(y.is('img')){z.head=y;z.link=y.getNextSourceNode(true,1);}else{z.link=y;z.head=y.getPreviousSourceNode(true,1);}return z;};function w(y){if(!y)return;var z=new d.range(s.document),A=v(y),B=A.head,C=A.link,D=s.document.getSelection();if(C&&B){z.setStartBefore(B);z.setEndAfter(C);if(D)D.selectRanges([z]);}else D.selectElement(y);return C||y;};s.on('contentDom',function(){this.document.on('keydown',function(y){var z=s.document.getSelection(),A=z&&z.getRanges()[0];if(A.collapsed&&y.data.getKey()===8){var B=A.getTouchedEndNode();if(B.type===3)B=B.getParent();if(B.hasAttribute('data-user')){y.data.preventDefault();w(B);}}});this.document.on('click',function(y){var z=y.data.getTarget();if(z&&z.hasAttribute('data-user'))w(z);});});function x(y,z){var A=new h('img'),B=new h('a');A.setAttributes({src:u.src,width:'16',height:'16','data-user':y.journal,'data-title':z});A.setStyle('cursor','default');var C=new Image();C.onload=function(){p[y.journal]=y.userhead_url;A.setAttribute('src',C.src);s.fire('updateSnapshot');};C.src=y.userhead_url;B.setAttributes({href:'#','data-cke-saved-href':'#','data-user':y.journal,'data-title':z,seen:true});B.setStyles({color:'blue',fontWeight:'bold'});B.setText(z||y.journal);s.insertElement(A);s.insertElement(B);s.fire('updateSnapshot');};LiveJournal.register_hook('user_response',function(y,z){if(y&&y.hasOwnProperty('ljuser'))x(y.ljuser,z);});s.addCommand(n,{exec:function(y){if(t){var z=t.getAttribute('data-user'),A=t.getAttribute('data-title');y.rteButton(n,o,{user:z,title:A,fromRte:true});}else y.rteButton(n,o);}});s.ui.addButton(n,{label:n,command:n});s.dataProcessor.htmlFilter.addRules({elements:{img:function(y){if(y.attributes['data-user'])return false;
 return y;},a:function(y){var z=y;if(y.attributes['data-user']){z=new a.htmlParser.element('lj');z.isEmpty=true;z.isOptionalClose=true;if(y.attributes.hasOwnProperty('data-user'))z.attributes.user=y.attributes['data-user'];if(y.attributes['data-title'])z.attributes.title=y.attributes['data-title'];return z;}else return y;}}});s.on('doubleclick',function(y){var z=y.data.element;if(z&&z.hasAttribute('data-user')){w(z);s.execFromEditor=true;s.execCommand(n);}});s.on('contentDom',function(){var y=m(a.instances.ck.document.$);y.find('a[data-user]').each(function(z,A){if(A.seen)return;var B=A.getAttribute('data-user'),C=m('<img/>',{style:'cursor: default; width: 16px; height: 16px;','data-user':B,'data-title':A.getAttribute('data-title'),src:q[B]&&r||p[B]||u.src}).insertBefore(m(A));if(q[B])m(A).addClass('lj-user-undefined');if(!p[B]&&!q[B])LJ.Api.call('ljuser.get',{user:B,raw:1},function(D){if(D.error){m(A).addClass('lj-user-undefined');C.attr('src',r);q[B]=true;return;}p[B]=D.ljuser.userhead_url;C.attr('src',D.ljuser.userhead_url);A.seen=true;});});});s.dataProcessor.dataFilter.addRules({elements:{lj:function(y){var z=y.attributes.user,A=new a.htmlParser.element('a');A.add(new a.htmlParser.text(y.attributes.title||z));A.attributes.href='#';A.attributes['data-cke-saved-href']='#';A.attributes.style='font-weight: bold; color: #00C;';A.attributes['data-user']=z;A.attributes['data-title']=y.attributes.title||'';return A;}}});}});})(jQuery);(function(m){'use strict';var n={minHeight:400,maxHeight:0},o=null,p=false,q=['contentDom','selectionChange','insertElement'],r,s,t;function u(){var x,y;if(!r)return;x=o.document.getBody().$.clientHeight+30,y=Math.max(n.minHeight,x);if(y>n.maxHeight&&n.maxHeight!==0)y=n.maxHeight;o.resize('',y,true);};function v(){if(r||!p)return;r=true;q.forEach(function(x){o.on(x,u);});o.document.on('keyup',u);s=o.document.getBody().getStyle('overflow-y')||'visible';o.document.getBody().setStyle('overflow-y','hidden');t=o.window.getViewPaneSize().height;u();};function w(){if(!r)return;r=false;q.forEach(function(x){o.removeListener(x,u);});o.document.removeListener('keyup',u);o.resize('',t,true);o.document.getBody().setStyle('overflow-y',s);};j.add('ljautogrow',{init:function(x){o=x;o.on('instanceReady',function(){o.on('contentDom',function(){if(p)return;p=true;v();});});}});a.editor.prototype.autogrow={enable:v,disable:w,resize:u,config:function(x,y){if(typeof y==='undefined')return n[x];else{n[x]=y;u();}}};})(jQuery);a.editorConfig=function(m){'use strict';

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