spacevillain (spacevillain) wrote in changelog,
spacevillain
spacevillain
changelog

[livejournal] r23382: LJSUP-14391: [RTE] Unknown username styl...

Committer: atyurin
LJSUP-14391: [RTE] Unknown username styling
U   trunk/htdocs/js/ck/ckeditor.js
Modified: trunk/htdocs/js/ck/ckeditor.js
===================================================================
--- trunk/htdocs/js/ck/ckeditor.js	2012-11-28 13:00:57 UTC (rev 23381)
+++ trunk/htdocs/js/ck/ckeditor.js	2012-11-28 13:18:04 UTC (rev 23382)
@@ -156,8 +156,8 @@
 });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(){function m(p,q,r,s,t,u,v){var w=p.config,x=t.split(';'),y=[],z={};for(var A=0;A<x.length;A++){var B=x[A];if(B){B=B.split('/');var C={},D=x[A]=B[0];C[r]=y[A]=B[1]||D;z[D]=new a.style(v,C);z[D]._.definition.name=D;}else x.splice(A--,1);}p.ui.addRichCombo(q,{label:s.label,title:s.panelTitle,className:'cke_'+(r=='size'?'fontSize':'font'),panel:{css:p.skin.editor.css.concat(w.contentsCss),multiSelect:false,attributes:{'aria-label':s.panelTitle}},init:function(){this.startGroup(s.panelTitle);for(var E=0;E<x.length;E++){var F=x[E];this.add(F,z[F].buildPreview(),F);}},onClick:function(E){p.focus();p.fire('saveSnapshot');var F=z[E];if(this.getValue()==E)F.remove(p.document);else{var G=p.getSelection(),H=parseFloat(z[E]._.definition.styles['font-size']);for(var I in z)z[I].remove(p.document);F.apply(p.document);}p.fire('saveSnapshot');},onRender:function(){p.on('selectionChange',function(E){var F=this.getValue(),G=E.data.path,H=G.elements;for(var I=0,J;I<H.length;I++){J=H[I];for(var K in z){if(z[K].checkElementRemovable(J,true)){if(K!=F)this.setValue(K);return;}}}this.setValue('',u);},this);}});};j.add('ljfont',{requires:['richcombo','styles'],init:function(p){var q=p.config;m(p,'ljFontSize','size',p.lang.fontSize,q.fontSize_sizes,q.fontSize_defaultLabel,q.fontSize_style);}});i.font_style={element:'span',styles:{'font-family':'#(family)'},overrides:[{element:'font',attributes:{face:null}}]};var n={tiny:'0.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}}]};})();(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(){'use strict';
-var m='LJUser2',n='user',o={};j.add('ljuser2',{init:function(p){var q=null,r=new Image();r.src='/img/preloader/preloader-blue-white-xl.gif';p.on('selectionChange',function(u){var v=u.data.element;p.getCommand(m).setState(v.hasAttribute('data-user')?1:2);q=v.hasAttribute('data-user')?v:null;});function s(u){if(!u)return;var v=new d.range(p.document),w,x;if(u.is('img')){w=u;x=u.getNextSourceNode(true,1);}else{x=u;w=u.getPreviousSourceNode(true,1);}var y=p.document.getSelection();if(x&&w){v.setStartBefore(w);v.setEndAfter(x);if(y)y.selectRanges([v]);}else y.selectElement(u);return x||u;};p.on('contentDom',function(){this.document.on('keydown',function(u){var v=p.document.getSelection(),w=v&&v.getRanges()[0];if(w.collapsed&&u.data.getKey()===8){var x=w.getTouchedEndNode();if(x.type===3)x=x.getParent();if(x.hasAttribute('data-user')){u.data.preventDefault();s(x);}}});this.document.on('click',function(u){var v=u.data.getTarget();if(v&&v.hasAttribute('data-user'))s(v);});});function t(u,v){var w=new h('img'),x=new h('a');w.setAttributes({src:r.src,width:'16',height:'16','data-user':u.journal,'data-title':v});w.setStyle('cursor','default');var y=new Image();y.onload=function(){o[u.journal]=u.userhead_url;w.setAttribute('src',y.src);p.fire('updateSnapshot');};y.src=u.userhead_url;x.setAttributes({href:'#','data-cke-saved-href':'#','data-user':u.journal,'data-title':v,seen:true});x.setStyles({color:'blue',fontWeight:'bold'});x.setText(v||u.journal);p.insertElement(w);p.insertElement(x);p.fire('updateSnapshot');};LiveJournal.register_hook('user_response',function(u,v){if(u&&u.hasOwnProperty('ljuser'))t(u.ljuser,v);});p.addCommand(m,{exec:function(u){if(q){var v=q.getAttribute('data-user'),w=q.getAttribute('data-title');u.rteButton(m,n,{user:v,title:w,fromRte:true});}else u.rteButton(m,n);}});p.ui.addButton(m,{label:m,command:m});p.dataProcessor.htmlFilter.addRules({elements:{img:function(u){if(u.attributes['data-user'])return false;return u;},a:function(u){var v=u;if(u.attributes['data-user']){v=new a.htmlParser.element('lj');v.isEmpty=true;v.isOptionalClose=true;if(u.attributes.hasOwnProperty('data-user'))v.attributes.user=u.attributes['data-user'];if(u.attributes['data-title'])v.attributes.title=u.attributes['data-title'];return v;}else return u;}}});p.on('doubleclick',function(u){var v=u.data.element;if(v&&v.hasAttribute('data-user')){s(v);p.execFromEditor=true;p.execCommand(m);}});p.on('contentDom',function(){var u=jQuery(a.instances.ck.document.$);u.find('a[data-user]').each(function(v,w){if(w.seen)return;
-var x=w.getAttribute('data-user'),y=jQuery('<img/>',{style:'cursor: default; width: 16px; height: 16px;','data-user':x,'data-title':w.getAttribute('data-title'),src:o[x]||r.src}).insertBefore(jQuery(w));if(!o[x])LJ.Api.call('ljuser.get',{user:w.getAttribute('data-user'),raw:1},function(z){o[x]=z.ljuser.userhead_url;y.attr('src',z.ljuser.userhead_url);w.seen=true;});});});p.dataProcessor.dataFilter.addRules({elements:{lj:function(u){var v=u.attributes.user,w=new a.htmlParser.element('a');w.add(new a.htmlParser.text(u.attributes.title||v));w.attributes.href='#';w.attributes['data-cke-saved-href']='#';w.attributes.style='font-weight: bold; color: #00C;';w.attributes['data-user']=v;w.attributes['data-title']=u.attributes.title||'';return w;}}});}});})();(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';var n,o;if(Site.page.ljpost)n={livejournal:'plugins/livejournal/plugin.js',ljcolor:'plugins/lj/ljcolor/plugin.js',ljlink:'plugins/lj/ljlink/plugin.js',ljfont:'plugins/lj/ljfont/plugin.js',ljcut:'plugins/lj/ljcut/plugin.js',ljuser2:'plugins/lj/ljuser/plugin.js',ljautogrow:'plugins/lj/ljautogrow/plugin.js',ljspell:'plugins/ljspell/plugin.js'};else n={livejournal_old:'plugins/livejournal_old/plugin.js'};for(o in n)j.addExternal(o,n[o]);var p=['ajax','basicstyles','bidi','blockquote','button','colorbutton','colordialog','enterkey','entities','format','htmldataprocessor','keystrokes','list','liststyle','pastefromword','specialchar','tab','table','toolbar','undo','wysiwygarea','onchange'];
-if(!Site.page.ljpost)p.push('dialog','image','link','font');m.extraPlugins=Object.keys(n).join(',');if(Site.is_dev_server){console.warn('Development server, loading plugins as external files');for(o in n){delete j.registered[o];j.addExternal(o,n[o]);}}m.plugins=p.join(',');m.language='ru';m.autoParagraph=false;m.autoUpdateElement=false;m.docType='<!DOCTYPE html>';if(Site.page.ljpost){m.contentsCss='/js/ck/contents_new.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;m.bodyClass='lj-main-body';}else{m.contentsCss='/js/ck/contents.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents.css?t='+Site.version;}m.contentsLangDirection='ltr';m.fillEmptyBlocks=false;m.tabIndex=41;m.tabSpaces=2;m.startupShowBorders=false;m.toolbarCanCollapse=false;m.disableNativeSpellChecker=Site.page.ljpost?true:false;var q=[];function r(s,t){return s?t:undefined;};if(Site.page.ljpost)q=['Bold','Italic','Underline','Strike','LJFont','LJColor','-','LJLink2','LJUser2','-','LJImage',r(Site.media_embed_enabled,'LJEmbedLink'),'LJCut','LJSpoiler','LJMap','LJLike','LJPollLink','NumberedList','BulletedList','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','LJSpell','Undo','Redo'];else q=['Bold','Italic','Underline','Strike','TextColor','FontSize','-','LJLink','LJUserLink','image',r(Site.media_embed_enabled,'LJEmbedLink'),'LJPollLink','LJCutLink','LJCut','LJLike','LJSpoiler','-','UnorderedList','OrderedList','NumberedList','BulletedList','-','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','-','Undo','Redo'];m.toolbar_Full=[q.filter(function(s){return s;})];m.enterMode=2;m.shiftEnterMode=1;m.keystrokes=[[2228224+121,'contextMenu'],[1114112+90,'undo'],[1114112+89,'redo'],[1114112+2228224+90,'redo'],[1114112+76,'LJLink2'],[1114112+66,'bold'],[1114112+73,'italic'],[1114112+85,'underline']];m.colorButton_colors='000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';m.fontSize_sizes='smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large';m.disableObjectResizing=true;m.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address';m.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';m.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';m.coreStyles_bold={element:'b',overrides:'strong'};
-m.coreStyles_italic={element:'i',overrides:'em'};m.indentClasses=[];m.indentOffset=0;m.pasteFromWordRemoveFontStyles=false;m.pasteFromWordRemoveStyles=false;if(!Site.page.ljpost)m.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi);m.LJFontDefault='normal';m.LJFontStyle={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};m.LJFontSize={tiny:'0.7em',small:'0.9em',normal:'1.0em',large:'1.4em',huge:'1.8em'};m.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi);};if(!Site.is_dev_server)a.editorConfig(i);})();
+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';var n,o;if(Site.page.ljpost)n={livejournal:'plugins/livejournal/plugin.js',ljcolor:'plugins/lj/ljcolor/plugin.js',ljlink:'plugins/lj/ljlink/plugin.js',ljfont:'plugins/lj/ljfont/plugin.js',ljcut:'plugins/lj/ljcut/plugin.js',ljuser2:'plugins/lj/ljuser/plugin.js',ljautogrow:'plugins/lj/ljautogrow/plugin.js',ljspell:'plugins/ljspell/plugin.js'};else n={livejournal_old:'plugins/livejournal_old/plugin.js'};for(o in n)j.addExternal(o,n[o]);
+var p=['ajax','basicstyles','bidi','blockquote','button','colorbutton','colordialog','enterkey','entities','format','htmldataprocessor','keystrokes','list','liststyle','pastefromword','specialchar','tab','table','toolbar','undo','wysiwygarea','onchange'];if(!Site.page.ljpost)p.push('dialog','image','link','font');m.extraPlugins=Object.keys(n).join(',');if(Site.is_dev_server){console.warn('Development server, loading plugins as external files');for(o in n){delete j.registered[o];j.addExternal(o,n[o]);}}m.plugins=p.join(',');m.language='ru';m.autoParagraph=false;m.autoUpdateElement=false;m.docType='<!DOCTYPE html>';if(Site.page.ljpost){m.contentsCss='/js/ck/contents_new.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents_new.css?t='+Site.version;m.bodyClass='lj-main-body';}else{m.contentsCss='/js/ck/contents.css?t='+Site.version;m.styleText=Site.statprefix+'/js/ck/contents.css?t='+Site.version;}m.contentsLangDirection='ltr';m.fillEmptyBlocks=false;m.tabIndex=41;m.tabSpaces=2;m.startupShowBorders=false;m.toolbarCanCollapse=false;m.disableNativeSpellChecker=Site.page.ljpost?true:false;var q=[];function r(s,t){return s?t:undefined;};if(Site.page.ljpost)q=['Bold','Italic','Underline','Strike','LJFont','LJColor','-','LJLink2','LJUser2','-','LJImage',r(Site.media_embed_enabled,'LJEmbedLink'),'LJCut','LJSpoiler','LJMap','LJLike','LJPollLink','NumberedList','BulletedList','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','LJSpell','Undo','Redo'];else q=['Bold','Italic','Underline','Strike','TextColor','FontSize','-','LJLink','LJUserLink','image',r(Site.media_embed_enabled,'LJEmbedLink'),'LJPollLink','LJCutLink','LJCut','LJLike','LJSpoiler','-','UnorderedList','OrderedList','NumberedList','BulletedList','-','LJJustifyLeft','LJJustifyCenter','LJJustifyRight','-','Undo','Redo'];m.toolbar_Full=[q.filter(function(s){return s;})];m.enterMode=2;m.shiftEnterMode=1;m.keystrokes=[[2228224+121,'contextMenu'],[1114112+90,'undo'],[1114112+89,'redo'],[1114112+2228224+90,'redo'],[1114112+76,'LJLink2'],[1114112+66,'bold'],[1114112+73,'italic'],[1114112+85,'underline']];m.colorButton_colors='000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF';m.fontSize_sizes='smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large';m.disableObjectResizing=true;
+m.format_tags='p;h1;h2;h3;h4;h5;h6;pre;address';m.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';m.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';m.coreStyles_bold={element:'b',overrides:'strong'};m.coreStyles_italic={element:'i',overrides:'em'};m.indentClasses=[];m.indentOffset=0;m.pasteFromWordRemoveFontStyles=false;m.pasteFromWordRemoveStyles=false;if(!Site.page.ljpost)m.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi);m.LJFontDefault='normal';m.LJFontStyle={element:'span',styles:{'font-size':'#(size)'},overrides:[{element:'font',attributes:{size:null}}]};m.LJFontSize={tiny:'0.7em',small:'0.9em',normal:'1.0em',large:'1.4em',huge:'1.8em'};m.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi);};if(!Site.is_dev_server)a.editorConfig(i);})();

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