Committer: dpetrov
LJSUP-11904: Disable image wizards in RTE and HTML tabs at update.bmlU trunk/cgi-bin/LJ/Widget/EntryForm.pm U trunk/htdocs/js/basic.js U trunk/htdocs/js/ck/config.js U trunk/htdocs/js/ck/plugins/image/dialogs/image.js U trunk/htdocs/js/ck/plugins/livejournal/plugin.js U trunk/htdocs/js/ck/plugins/livejournal/plugin.orig.js U trunk/htdocs/js/ck/skins/v2/editor.css U trunk/htdocs/js/entry.js
Modified: trunk/cgi-bin/LJ/Widget/EntryForm.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/EntryForm.pm 2012-04-24 12:32:40 UTC (rev 21789) +++ trunk/cgi-bin/LJ/Widget/EntryForm.pm 2012-04-24 13:09:39 UTC (rev 21790) @@ -793,7 +793,8 @@ my $opts = $self->opts; - my $insert_image = qq{ + my $remote = LJ::get_remote(); + my $insert_image = ($remote && ($remote->prop ('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_NONE()) && $remote->can_use_ljphoto) ? qq{ <li class='image'> <a href='javascript:void(0);' @@ -803,15 +804,14 @@ $BML::ML{'entryform.insert.image2'} </a> </li> - }; + } : ""; - my $remote = LJ::get_remote(); $insert_image .= ($remote && ($remote->prop ('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_DONE()) && $remote->can_use_ljphoto) ? qq{ - <li class='image-beta'> + <li class='image'> <a href='javascript:void(0);' onclick='InOb.handleInsertImageBeta();' - title='$BML::ML{'ljimage.beta'}' + title='$BML::ML{'fckland.ljimage'}' > $BML::ML{'entryform.insert.image2'} </a> @@ -1697,13 +1697,11 @@ my $photouploader_params_out = LJ::JSON->to_json($photouploader_params); - my $migration_started = $remote && LJ::Pics::Migration->user_under_maintenance ($remote) ? 1 : 0; - my $migration_finished = $remote && $remote->prop('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_DONE() ? 1 : 0; + my $migration_status = $remote ? ($remote->prop ('fotki_migration_status') || 0) : 0; $out .= <<JS ; <script type="text/javascript"> - window.ljphotoMigrationStarted = $migration_started; - window.ljphotoMigrationFinished = $migration_finished; + window.ljphotoMigrationStatus = $migration_status; window.ljphotoEnabled = $ljphoto_enabled; jQuery('#updateForm').photouploader($photouploader_params_out); </script> @@ -1919,13 +1917,11 @@ DISABLE_HTML } - my $show_button = 0; - $show_button = 1 if $remote && ($remote->prop('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_DONE()) && $remote->can_use_ljphoto; - my $migration_started = $remote && LJ::Pics::Migration->user_under_maintenance ($remote) ? 1 : 0; - my $migration_finished = $remote && $remote->prop('fotki_migration_status') == LJ::Pics::Migration::MIGRATION_STATUS_DONE() ? 1 : 0; - $$js .= "window.ljphotoMigrationStarted = $migration_started;"; - $$js .= "window.ljphotoMigrationFinished = $migration_finished;"; - $$js .= "window.ljphotoEnabled = $show_button;"; + my $ljphoto_enabled = 0; + $ljphoto_enabled = 1 if $remote && $remote->can_use_ljphoto && !LJ::Pics::Migration->user_under_maintenance ($remote); + my $migration_status = $remote ? ($remote->prop ('fotki_migration_status') || 0) : 0; + $$js .= "window.ljphotoMigrationStatus = $migration_status;"; + $$js .= "window.ljphotoEnabled = $ljphoto_enabled;"; $$js .= "window.ljphotoUploadEnabled = $ljphoto_enabled;"; $$js = $self->wrap_js($$js); Modified: trunk/htdocs/js/basic.js =================================================================== --- trunk/htdocs/js/basic.js 2012-04-24 12:32:40 UTC (rev 21789) +++ trunk/htdocs/js/basic.js 2012-04-24 13:09:39 UTC (rev 21790) @@ -277,6 +277,38 @@ return consoleShim; }(); +LJ._const = {}; + +/** + * Define a constant. + * + * @param {string} name name of the constant. All spaces will be replaced with underline. + * if constant was already defined, the function will throw the exception. + * @param {*} value A value of the constant. + */ +LJ.defineConst = function(name, value) { + name = name.toUpperCase().replace(/\s+/g, '_'); + + if (LJ._const.hasOwnProperty(name)) { + throw new Error('constant was already defined'); + } else { + LJ._const[name] = value; + } + +} + +/** + * Get the value of the constant. + * + * @param {string} name The name of the constant. + * @return {*} The value of the constant or undefined if constant was not defined. + */ +LJ.getConst = function(name) { + name = name.toUpperCase().replace(/\s+/g, '_'); + + return (LJ._const.hasOwnProperty(name) ? LJ._const[name] : void 0); +} + LJ.DOM = LJ.DOM || {}; Modified: trunk/htdocs/js/ck/config.js =================================================================== --- trunk/htdocs/js/ck/config.js 2012-04-24 12:32:40 UTC (rev 21789) +++ trunk/htdocs/js/ck/config.js 2012-04-24 13:09:39 UTC (rev 21790) @@ -59,9 +59,9 @@ 'image'] ]; - if (window.ljphotoEnabled) { - config.toolbar_Full[0].push('LJImage_beta'); - } + // if (window.ljphotoEnabled) { + // config.toolbar_Full[0].push('LJImage_beta'); + // } if (top.Site.media_embed_enabled) { config.toolbar_Full[0].push('LJEmbedLink'); @@ -126,4 +126,4 @@ config.extraPlugins = 'livejournal'; config.protectedSource.push(/<lj-poll-\d+\s*\/?>/gi); // created lj polls; config.protectedSource.push(/<lj-replace name="first_post"\s*\/?>/gi); -}; \ No newline at end of file +}; Modified: trunk/htdocs/js/ck/plugins/image/dialogs/image.js =================================================================== --- trunk/htdocs/js/ck/plugins/image/dialogs/image.js 2012-04-24 12:32:40 UTC (rev 21789) +++ trunk/htdocs/js/ck/plugins/image/dialogs/image.js 2012-04-24 13:09:39 UTC (rev 21790) @@ -462,19 +462,19 @@ accessKey : 'I', elements : [ +// { +// type: 'html', +// html: (CKEDITOR.env.ie && CKEDITOR.env.version <= 9) || Site.pics_production ? '' : '' + +// '<div class="b-pics-promo-wrapper">' + +// '<i class="b-pics-promo-box"></i>' + +// '<a target="_blank" href="http://lj-pics-beta.livejournal.com/472.html" class="b-pics-promo-link">' + +// '<span class="b-pics-promo-arrow"></span>' + +// '<span class="b-pics-promo-content b-pics-promo-content-header">' + Site.ml_text['/update.bml.msg.newalbums'] + '</span>' + +// '<span class="b-pics-promo-content">' + Site.ml_text['/update.bml.msg.newalbums.organise'] + '</span>' + +// '</a>' + +// '</div>' +// }, { - type: 'html', - html: (CKEDITOR.env.ie && CKEDITOR.env.version <= 9) || Site.pics_production ? '' : '' + - '<div class="b-pics-promo-wrapper">' + - '<i class="b-pics-promo-box"></i>' + - '<a target="_blank" href="http://lj-pics-beta.livejournal.com/472.html" class="b-pics-promo-link">' + - '<span class="b-pics-promo-arrow"></span>' + - '<span class="b-pics-promo-content b-pics-promo-content-header">' + Site.ml_text['/update.bml.msg.newalbums'] + '</span>' + - '<span class="b-pics-promo-content">' + Site.ml_text['/update.bml.msg.newalbums.organise'] + '</span>' + - '</a>' + - '</div>' - }, - { type : 'vbox', padding : 0, children : Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js =================================================================== --- trunk/htdocs/js/ck/plugins/livejournal/plugin.js 2012-04-24 12:32:40 UTC (rev 21789) +++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js 2012-04-24 13:09:39 UTC (rev 21790) @@ -1 +1,58 @@ -(function(){function t(d){function f(){var b=this.getAttribute("lj-cmd");c.hasOwnProperty(b)&&(i[b].node=c[b].node,(new CKEDITOR.dom.selection(d.document)).selectElement(i[b].node),s=!0,d.execCommand(b),CKEDITOR.note.hide(!0));return!1}function l(){window.switchedRteOn||CKEDITOR.note.hide(!0);if(a){c=j;j=null;var d="",g;for(g in c)c.hasOwnProperty(g)&&(d+='<div class="noteItem">'+c[g].content+"</div>");e.innerHTML=decodeURIComponent(d);d=e.getElementsByTagName("a");g=0;for(var r=d.length;g<r;g++){var n= d[g];i.hasOwnProperty(n.getAttribute("lj-cmd"))&&(n.onclick=f)}}else c=null;p(a);b=null}var b,a,c,j,e=document.createElement("lj-note"),h="string"!=typeof document.body.style.opacity,p=function(){function b(){var d=p.shift(),d=(c?d.time/a:-(d.time/a-1)).toFixed(1);p.length||(d=c?1:0);h?e.style.filter=1<=d?null:"progid:DXImageTransform.Microsoft.Alpha(opacity="+100*d+")":e.style.opacity=d;0==d&&e&&e.parentNode&&e.parentNode.removeChild(e)}var a=100,d=60*a/1E3,p=[],c,k=document.getElementById("draft-container")|| document.body;return function(a){if((c=a)&&e.parentNode)h?e.style.filter=null:e.style.opacity=1;else for(a=1;a<=d;a++){var g=Math.floor(1E3/60)*a;p.push({time:g,timer:setTimeout(b,g)})}k.appendChild(e);e.style.marginTop=-e.offsetHeight/2+"px";e.style.marginLeft=-e.offsetWidth/2+"px"}}();e.className="note-popup";e.onmouseout=function(){(!c||!c.cmd)&&CKEDITOR.note.hide()};e.onmouseover=function(){b&&!a&&(a=1,b=clearTimeout(b))};h?e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)":e.style.opacity= 0;CKEDITOR.note={show:function(d,p){if((p||d!=j)&&window.switchedRteOn)b&&(b=clearTimeout(b)),a=1,j=d,!0===p?l():b=setTimeout(l,1E3)},hide:function(d){a&&(a=0,b&&(b=clearTimeout(b)),e.parentNode&&(!0===d?l():b=setTimeout(l,500)))}}}var l=[{label:top.CKLang.LJLike_button_facebook,id:"facebook",abbr:"fb",html:'<span class="lj-like-item fb">'+top.CKLang.LJLike_button_facebook+"</span>",htmlOpt:'<li class="like-fb"><input type="checkbox" id="like-fb" /><label for="like-fb">'+top.CKLang.LJLike_button_facebook+ "</label></li>"},{label:top.CKLang.LJLike_button_twitter,id:"twitter",abbr:"tw",html:'<span class="lj-like-item tw">'+top.CKLang.LJLike_button_twitter+"</span>",htmlOpt:'<li class="like-tw"><input type="checkbox" id="like-tw" /><label for="like-tw">'+top.CKLang.LJLike_button_twitter+"</label></li>"},{label:top.CKLang.LJLike_button_google,id:"google",abbr:"go",html:'<span class="lj-like-item go">'+top.CKLang.LJLike_button_google+"</span>",htmlOpt:'<li class="like-go"><input type="checkbox" id="like-go" /><label for="like-go">'+ top.CKLang.LJLike_button_google+"</label></li>"},{label:top.CKLang.LJLike_button_vkontakte,id:"vkontakte",abbr:"vk",html:'<span class="lj-like-item vk">'+top.CKLang.LJLike_button_vkontakte+"</span>",htmlOpt:window.isSupUser?'<li class="like-vk"><input type="checkbox" id="like-vk" /><label for="like-vk">'+top.CKLang.LJLike_button_vkontakte+"</label></li>":""},{label:top.CKLang.LJLike_button_give,id:"livejournal",abbr:"lj",html:'<span class="lj-like-item lj">'+top.CKLang.LJLike_button_give+"</span>", htmlOpt:'<li class="like-lj"><input type="checkbox" id="like-lj" /><label for="like-lj">'+top.CKLang.LJLike_button_give+"</label></li>"}],i={LJPollLink:{html:encodeURIComponent(top.CKLang.Poll_PollWizardNotice+'<br /><a href="#" lj-cmd="LJPollLink">'+top.CKLang.Poll_PollWizardNoticeLink+"</a>")},LJLike:{html:encodeURIComponent(top.CKLang.LJLike_WizardNotice+'<br /><a href="#" lj-cmd="LJLike">'+top.CKLang.LJLike_WizardNoticeLink+"</a>")},LJUserLink:{html:encodeURIComponent(top.CKLang.LJUser_WizardNotice+ '<br /><a href="#" lj-cmd="LJUserLink">'+top.CKLang.LJUser_WizardNoticeLink+"</a>")},LJLink:{html:encodeURIComponent(top.CKLang.LJLink_WizardNotice+'<br /><a href="#" lj-cmd="LJLink">'+top.CKLang.LJLink_WizardNoticeLink+"</a>")},image:{html:encodeURIComponent(top.CKLang.LJImage_WizardNotice+'<br /><a href="#" lj-cmd="image">'+top.CKLang.LJImage_WizardNoticeLink+"</a>")},LJCut:{html:encodeURIComponent(top.CKLang.LJCut_WizardNotice+'<br /><a href="#" lj-cmd="LJCut">'+top.CKLang.LJCut_WizardNoticeLink+ "</a>")},LJSpoiler:{html:encodeURIComponent(top.CKLang.LJSpoiler_WizardNotice+'<br /><a href="#" lj-cmd="LJSpoiler">'+top.CKLang.LJSpoiler_WizardNoticeLink+"</a>")}},o={},s,f=CKEDITOR.dtd;f.$block["lj-template"]=1;f.$block["lj-raw"]=1;f.$block["lj-cut"]=1;f.$block["lj-spoiler"]=1;f.$block["lj-poll"]=1;f.$block["lj-repost"]=1;f.$block["lj-pq"]=1;f.$block["lj-pi"]=1;f.$nonEditable["lj-template"]=1;f["lj-template"]={};f["lj-map"]={};f["lj-repost"]={};f["lj-raw"]=f.div;f["lj-poll"]={"lj-pq":1};f["lj-pq"]= {"#":1,"lj-pi":1};f["lj-pi"]={"#":1};f.$block.iframe=f.$inline.iframe;delete f.$inline.iframe;CKEDITOR.tools.extend(f["lj-cut"]={},f.$block);CKEDITOR.tools.extend(f["lj-spoiler"]={},f.$block);CKEDITOR.tools.extend(f["lj-cut"],f.$inline);CKEDITOR.tools.extend(f["lj-spoiler"],f.$inline);CKEDITOR.tools.extend(f.div,f.$block);CKEDITOR.tools.extend(f.$body,f.$block);delete f["lj-cut"]["lj-cut"];CKEDITOR.plugins.add("livejournal",{init:function(d){function f(b){var a=b.data.element||b.data.getTarget(); for(1!=a.type&&(a=a.getParent());a;){var g=a.getAttribute("lj-cmd");if(i.hasOwnProperty(g)){var c=d.getCommand(g);if(c.state==CKEDITOR.TRISTATE_ON){var n=new CKEDITOR.dom.selection(d.document);i[g].node=a.is("body")?new CKEDITOR.dom.element.get(a.getWindow().$.frameElement):a;n.selectElement(i[g].node);b.data.dialog="";s=!0;c.exec();break}}a=a.getParent()}}function u(a){this.$!=d.document.$&&(this.$.className=(this.frame.getAttribute("lj-class")||"")+" lj-selected","LJPollLink"==this.getAttribute("lj-cmd")&& this.frame.setStyle("height",this.getDocument().$.body.scrollHeight+"px"),(new CKEDITOR.dom.selection(d.document)).selectElement(this.frame));1==a.data.getKey()&&a.data.preventDefault()}function b(a){if(46==a.data.getKey())for(var a=(new CKEDITOR.dom.selection(d.document)).getRanges(),b=a.length;b--;)a[b].deleteContents()}function a(){var a=this.$.contentWindow.document,d=new CKEDITOR.dom.element.get(a.body);d.on&&(d.on("dblclick",f),d.on("click",u),d.on("keyup",b),"LJPollLink"==this.getAttribute("lj-cmd")&& this.hasAttribute("style")&&(a.body.className="lj-poll lj-poll-open"));a=new CKEDITOR.dom.element.get(a);a.frame=d.frame=this}function c(){var b=d.document.getElementsByTag("iframe"),c=b.count(),g,e,n,m;for(s=!1;c--;)g=b.getItem(c),e=g.getAttribute("lj-cmd"),n=g.$.contentWindow,n=n.document,m=g.getAttribute("lj-style")||"",g.removeListener("load",a),g.on("load",a),n.open(),n.write('<!DOCTYPE html><html style="'+m+'"><head><link rel="stylesheet" href="'+CKEDITOR.styleText+'" /></head><body scroll="no" class="'+ (g.getAttribute("lj-class")||"")+'" style="'+m+'" '+(e?'lj-cmd="'+e+'"':"")+">"+decodeURIComponent(g.getAttribute("lj-content")||"")+"</body></html>"),n.close()}function j(a){if(!0===d.onSwitch)delete d.onSwitch;else{var b,g="click"==a.name,c="selectionChange"==a.name||g,e=a.data.element||a.data.getTarget(),m;g&&(1==a.data.getKey()||0==a.data.$.button)&&a.data.preventDefault();1!=e.type&&(e=e.getParent());a=e;if(c){var e=d.document.getElementsByTag("iframe"),k;g&&a.is("iframe")&&(k=a.$.contentWindow.document.body, k.className=(a.getAttribute("lj-class")||"")+" lj-selected","LJPollLink"==a.getAttribute("lj-cmd")&&a.setStyle("height",k.scrollHeight+"px"));for(var h=0,q=e.count();h<q;h++)g=e.getItem(h),g.$!=a.$&&(k=g.$.contentWindow.document.body,k.className=g.getAttribute("lj-class")||"","LJPollLink"==g.getAttribute("lj-cmd")&&"lj-poll"==k.className&&g.removeAttribute("style"))}do if(e=a.getAttribute("lj-cmd"),!e&&1==a.type&&(g=a.getParent(),a.is("img")&&g.getParent()&&!g.getParent().hasAttribute("lj:user")? (e="image",a.setAttribute("lj-cmd",e)):a.is("a")&&!g.hasAttribute("lj:user")&&(e="LJLink",a.setAttribute("lj-cmd",e))),e&&i.hasOwnProperty(e))c&&(i[e].node=a,d.getCommand(e).setState(CKEDITOR.TRISTATE_ON)),(b||(b={}))[e]={content:i[e].html,node:a};while(a=a.getParent());if(c)for(m in i)if(i.hasOwnProperty(m)&&(!b||!b.hasOwnProperty(m)))delete i[m].node,d.getCommand(m).setState(CKEDITOR.TRISTATE_OFF);b?CKEDITOR.note.show(b):CKEDITOR.note.hide()}}function e(a,b,g){var c,e=i[b].node;if(e){if(c=prompt(g.title, e.getAttribute("text")||g.text))c==g.text?e.removeAttribute("text"):e.setAttribute("text",c)}else{if(c=prompt(g.title,g.text)){d.focus();var e=new CKEDITOR.dom.selection(d.document),m=e.getRanges(),k=new CKEDITOR.dom.element("iframe",d.document),h=k.clone();k.setAttribute("lj-cmd",b);k.setAttribute("lj-class",a+" "+a+"-open");k.setAttribute("class",a+"-wrap");k.setAttribute("frameBorder",0);k.setAttribute("allowTransparency","true");c!=g.text&&k.setAttribute("text",c);h.setAttribute("lj-class",a+ " "+a+"-close");h.setAttribute("class",a+"-wrap");h.setAttribute("frameBorder",0);h.setAttribute("allowTransparency","true");a=m[0];e.lock();b=new CKEDITOR.dom.element("br",d.document);g=b.clone();c=b.clone();var q=new CKEDITOR.dom.documentFragment(d.document);q.append(b.clone());q.append(k);q.append(g);if(!1===a.collapsed)for(var k=0,j=m.length;k<j;k++)q.append(m[k].extractContents());q.append(c);d.insertElement(h);b.clone().insertAfter(h);h.insertBeforeMe(q);a.setStart(g,0);a.setEnd(c,0);e.unlock(); e.selectRanges(m)}CKEDITOR.note&&CKEDITOR.note.hide(!0)}}(function(){function a(b){return"/>"==b.slice(-2)?b:b.slice(0,-1)+"/>"}function b(a){a=new Poll(a);return'<iframe class="lj-poll-wrap" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+a.outputLJtags()+'" lj-content="'+a.outputHTML()+'"></iframe>'}function c(a,b,d){return'<iframe class="lj-embed-wrap" lj-class="lj-embed" frameborder="0" allowTransparency="true" lj-data="'+encodeURIComponent(d)+'"'+b+ "></iframe>"}function e(a,b,d,c){return b+d.replace(/\n/g,"")+c}function h(a,b,d,c){a=b||d||top.CKLang.LJRepost_Value;b=c.replace(/"/g,""");c=b+('<br /><input type="button" value="'+a+'" />').replace(/"/g,""");return'<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+b+'" lj-button="'+a+'" lj-content="'+c+'"></iframe>'}d.dataProcessor.toHtml=function(d,k){d=d.replace(/<lj [^>]*?>/gi,a).replace(/<lj-map [^>]*?>/gi,a).replace(/<lj-template[^>]*?>/gi, a).replace(/(<lj-cut[^>]*?)\/>/gi,"$1>").replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,"<$1$2></$1>").replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,b).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,h).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,c);$("event_format").checked||(d=d.replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,e),window.switchedRteOn||(d=d.replace(/\n/g,"<br />")));d=CKEDITOR.htmlDataProcessor.prototype.toHtml.call(this,d,k);CKEDITOR.env.ie&& (d='<xml:namespace ns="livejournal" prefix="lj" />'+d);return d}})();d.dataProcessor.toDataFormat=function(a,b){a=CKEDITOR.htmlDataProcessor.prototype.toDataFormat.call(this,a,b);$("event_format").checked||(a=a.replace(/<br\s*\/>/gi,"\n"));return a.replace(/\t/g," ")};d.dataProcessor.writer.indentationChars="";d.dataProcessor.writer.lineBreakChars="";d.on("selectionChange",j);d.on("doubleclick",f);d.on("afterCommandExec",c);d.on("dialogHide",c);d.on("dataReady",function(){CKEDITOR.note||t(d);CKEDITOR.env.ie&& (d.document.getBody().on("dragend",c),d.document.getBody().on("paste",function(){setTimeout(c,0)}));d.document.on("click",j);d.document.on("mouseout",CKEDITOR.note.hide);d.document.on("mouseover",j);d.document.getBody().on("keyup",b);c()});(function(){var a=top.Site.siteroot+"/tools/endpoints/ljuser.bml";d.addCommand("LJUserLink",{exec:function(b){var c="",b=new CKEDITOR.dom.selection(b.document),e=i.LJUserLink.node,h;e?(CKEDITOR.note&&CKEDITOR.note.hide(!0),h=i.LJUserLink.node.getElementsByTag("b").getItem(0).getText(), c=prompt(top.CKLang.UserPrompt,h)):2==b.getType()&&(c=b.getSelectedText());""==c&&(c=prompt(top.CKLang.UserPrompt,c));c&&h!=c&&parent.HTTPReq.getJSON({data:parent.HTTPReq.formEncoded({username:c}),method:"POST",url:a,onData:function(a){var b=c;if(a.error)alert(a.error);else if(a.success){a.ljuser=a.ljuser.replace('<span class="useralias-value">*</span>',"");o[b]=a.ljuser;a=new CKEDITOR.dom.element.createFromHtml(a.ljuser);a.setAttribute("lj-cmd","LJUserLink");e?e.$.parentNode.replaceChild(a.$,e.$): d.insertElement(a)}}})}});d.ui.addButton("LJUserLink",{label:top.CKLang.LJUser,command:"LJUserLink"})})();d.ui.addButton("image",{label:top.CKLang.LJImage_Title,command:"image"});window.ljphotoEnabled&&(d.addCommand("LJImage_beta",{exec:function(){InOb.handleInsertImageBeta("upload")},editorFocus:!1}),d.ui.addButton("LJImage_beta",{label:top.CKLang.LJImage_BetaTitle,command:"LJImage_beta"}));d.addCommand("LJLink",{exec:function(a){!s&&this.state==CKEDITOR.TRISTATE_ON?a.execCommand("unlink"):a.openDialog("link"); CKEDITOR.note&&CKEDITOR.note.hide(true)},editorFocus:!1});d.ui.addButton("LJLink",{label:d.lang.link.toolbar,command:"LJLink"});(function(){function a(b){if(b&&b.length&&window.switchedRteOn){var e=new CKEDITOR.dom.element("iframe",d.document);e.setAttribute("lj-data",encodeURIComponent(b));e.setAttribute("lj-class","lj-embed");e.setAttribute("class","lj-embed-wrap");e.setAttribute("frameBorder",0);e.setAttribute("allowTransparency","true");d.insertElement(e);c()}}d.addCommand("LJEmbedLink",{exec:function(){top.LJ_IPPU.textPrompt(top.CKLang.LJEmbedPromptTitle, top.CKLang.LJEmbedPrompt,a,{width:"350px"})}});d.ui.addButton("LJEmbedLink",{label:top.CKLang.LJEmbed,command:"LJEmbedLink"})})();d.addCommand("LJCut",{exec:function(){e("lj-cut","LJCut",{title:top.CKLang.LJCut_PromptTitle,text:top.CKLang.LJCut_PromptText})},editorFocus:!1});d.ui.addButton("LJCut",{label:top.CKLang.LJCut_Title,command:"LJCut"});d.addCommand("LJSpoiler",{exec:function(){e("lj-spoiler","LJSpoiler",{title:top.CKLang.LJSpoiler_PromptTitle,text:top.CKLang.LJSpoiler_PromptText})},editorFocus:!1}); d.ui.addButton("LJSpoiler",{label:top.CKLang.LJSpoiler_Title,command:"LJSpoiler"});(function(){function a(b,d){var d=d===void 0||d,c;if(i.LJLike.node)c=(c=b.getAttribute("lj-style"))?c.replace(/text-align:\s*(left|right|center)/i,"$1"):"left";else if(d)c=b.getComputedStyle("text-align");else{for(;!b.hasAttribute||!b.hasAttribute("align")&&!b.getStyle("text-align");){c=b.getParent();if(!c)break;b=c}c=b.getStyle("text-align")||b.getAttribute("align")||""}c&&(c=c.replace(/-moz-|-webkit-|start|auto/i, ""));!c&&d&&(c=b.getComputedStyle("direction")=="rtl"?"right":"left");return c}function b(c){if(!c.editor.readOnly){var e=c.editor.getCommand(this.name),c=c.data.element;e.state=(c.type==1&&c.hasAttribute("lj-cmd")&&c.getAttribute("lj-cmd"))=="LJLike"?a(c,d.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF:!c||c.type!=1||c.getName()=="body"||c.getName()=="iframe"?CKEDITOR.TRISTATE_OFF:a(c,d.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF; e.fire("state")}}function c(a,b,d){this.name=b;this.value=d;if(a=a.config.justifyClasses){switch(d){case "left":this.cssClassName=a[0];break;case "center":this.cssClassName=a[1];break;case "right":this.cssClassName=a[2]}this.cssClassRegex=RegExp("(?:^|\\s+)(?:"+a.join("|")+")(?=$|\\s)")}}c.prototype={exec:function(b){var c=b.getSelection(),d=b.config.enterMode;if(c){var e=c.createBookmarks();if(i.LJLike.node)i.LJLike.node.setAttribute("lj-style","text-align: "+this.value);else for(var h=c.getRanges(true), g=this.cssClassName,j,f,n=b.config.useComputedState,n=n===void 0||n,r=h.length-1;r>=0;r--){j=h[r];if((f=j.getEnclosedNode())&&f.is("iframe"))return;j=j.createIterator();for(j.enlargeBr=d!=CKEDITOR.ENTER_BR;f=j.getNextParagraph(d==CKEDITOR.ENTER_P?"p":"div");){f.removeAttribute("align");f.removeStyle("text-align");var m=g&&(f.$.className=CKEDITOR.tools.ltrim(f.$.className.replace(this.cssClassRegex,""))),l=this.state==CKEDITOR.TRISTATE_OFF&&(!n||a(f,true)!=this.value);g?l?f.addClass(g):m||f.removeAttribute("class"): l&&f.setStyle("text-align",this.value)}}b.focus();b.forceNextSelectionCheck();c.selectBookmarks(e)}}};var e=new c(d,"LJJustifyLeft","left"),h=new c(d,"LJJustifyCenter","center"),j=new c(d,"LJJustifyRight","right");d.addCommand("LJJustifyLeft",e);d.addCommand("LJJustifyCenter",h);d.addCommand("LJJustifyRight",j);d.ui.addButton("LJJustifyLeft",{label:d.lang.justify.left,command:"LJJustifyLeft"});d.ui.addButton("LJJustifyCenter",{label:d.lang.justify.center,command:"LJJustifyCenter"});d.ui.addButton("LJJustifyRight", {label:d.lang.justify.right,command:"LJJustifyRight"});d.on("selectionChange",CKEDITOR.tools.bind(b,e));d.on("selectionChange",CKEDITOR.tools.bind(b,j));d.on("selectionChange",CKEDITOR.tools.bind(b,h));d.on("dirChanged",function(a){var b=a.editor,c=new CKEDITOR.dom.range(b.document);c.setStartBefore(a.data.node);c.setEndAfter(a.data.node);for(var d=new CKEDITOR.dom.walker(c),e;e=d.next();)if(e.type==CKEDITOR.NODE_ELEMENT){var g=b.config.justifyClasses;if(!e.equals(a.data.node)&&e.getDirection()){c.setStartAfter(e); d=new CKEDITOR.dom.walker(c)}else{if(g)if(e.hasClass(g[0])){e.removeClass(g[0]);e.addClass(g[2])}else if(e.hasClass(g[2])){e.removeClass(g[2]);e.addClass(g[0])}switch(e.getStyle("text-align")){case "left":e.setStyle("text-align","right");break;case "right":e.setStyle("text-align","left")}}}})})();if(top.canmakepoll){var h;CKEDITOR.dialog.add("LJPollDialog",function(){var a=0,b,e,j,f=function(){this.removeListener&&this.removeListener("load",f);if(a&&b){h=new Poll(i.LJPollLink.node&&decodeURIComponent(i.LJPollLink.node.getAttribute("lj-data")), e.document,j.document,e.Questions);e.ready(h);j.ready(h);b.style.display="block";CKEDITOR.note&&CKEDITOR.note.hide(true)}else a++},m=[new CKEDITOR.ui.button({type:"button",id:"LJPoll_Ok",label:d.lang.common.ok,onClick:function(a){a.data.dialog.hide();var b=new Poll(h,e.document,j.document,e.Questions),a=b.outputHTML(),b=b.outputLJtags();if(a.length>0){var f=i.LJPollLink.node;if(f){f.setAttribute("lj-content",a);f.setAttribute("lj-data",b);f.removeAttribute("style");f.$.contentWindow.document.body.className= "lj-poll"}else{f=new CKEDITOR.dom.element("iframe",d.document);f.setAttribute("lj-content",a);f.setAttribute("lj-cmd","LJPollLink");f.setAttribute("lj-data",b);f.setAttribute("lj-class","lj-poll");f.setAttribute("class","lj-poll-wrap");f.setAttribute("frameBorder",0);f.setAttribute("allowTransparency","true");d.insertElement(f)}i.LJPollLink.node=null;c()}}}),CKEDITOR.dialog.cancelButton];CKEDITOR.env.mac&&m.reverse();return{title:top.CKLang.Poll_PollWizardTitle,width:420,height:270,resizable:false, onShow:function(){if(a){h=new Poll(i.LJPollLink.node&&unescape(i.LJPollLink.node.getAttribute("data")),e.document,j.document,e.Questions);e.ready(h);j.ready(h)}},contents:[{id:"LJPoll_Setup",label:"Setup",padding:0,elements:[{type:"html",html:'<iframe src="/tools/ck_poll_setup.bml" allowTransparency="true" frameborder="0" style="width:100%; height:320px;"></iframe>',onShow:function(a){if(!b)(b=document.getElementById(a.sender.getButton("LJPoll_Ok").domId).parentNode).style.display="none";a=this.getElement("iframe"); j=a.$.contentWindow;if(j.ready)f();else a.on("load",f)}}]},{id:"LJPoll_Questions",label:"Questions",padding:0,elements:[{type:"html",html:'<iframe src="/tools/ck_poll_questions.bml" allowTransparency="true" frameborder="0" style="width:100%; height:320px;"></iframe>',onShow:function(){var a=this.getElement("iframe");e=a.$.contentWindow;if(e.ready)f();else a.on("load",f)}}]}],buttons:m}});d.addCommand("LJPollLink",new CKEDITOR.dialogCommand("LJPollDialog"))}else d.addCommand("LJPollLink",{exec:function(){CKEDITOR.note&& CKEDITOR.note.show(top.CKLang.Poll_AccountLevelNotice,null,null,true)}}),d.getCommand("LJPollLink").setState(CKEDITOR.TRISTATE_DISABLED);d.ui.addButton("LJPollLink",{label:top.CKLang.Poll_Title,command:"LJPollLink"});(function(){function a(){if(d.getCommand("LJLike")==CKEDITOR.TRISTATE_OFF){this.$.checked?e++:e--;h.getButton("LJLike_Ok").getElement()[e==0?"addClass":"removeClass"]("btn-disabled")}}var b=l.length,c='<div class="cke-dialog-likes"><ul class="cke-dialog-likes-list">',e=0,h,f;l.defaultButtons= [];for(var j=0;j<b;j++){var o=l[j];l[o.id]=l[o.abbr]=o;l.defaultButtons.push(o.id);c=c+o.htmlOpt}c=c+('</ul><p class="cke-dialog-likes-faq">'+window.faqLink+"</p></div>");CKEDITOR.dialog.add("LJLikeDialog",function(){var j=[new CKEDITOR.ui.button({type:"button",id:"LJLike_Ok",label:d.lang.common.ok,onClick:function(){var a=[],c='<span class="lj-like-wrapper">',e=i.LJLike.node;if(h.getButton("LJLike_Ok").getElement().hasClass("btn-disabled"))return false;for(var f=0;f<b;f++){var j=l[f],g=document.getElementById("like-"+ j.abbr),k=e&&e.getAttribute("buttons");if(g&&g.checked||k&&!j.htmlOpt&&(k.indexOf(j.abbr)+1||k.indexOf(j.id)+1)){a.push(j.id);c=c+j.html}}c=c+"</span>";if(a.length)if(e){i.LJLike.node.setAttribute("buttons",a.join(","));i.LJLike.node.setAttribute("lj-content",encodeURIComponent(c))}else{e=new CKEDITOR.dom.element("iframe",d.document);e.setAttribute("lj-class","lj-like");e.setAttribute("class","lj-like-wrap");e.setAttribute("buttons",a.join(","));e.setAttribute("lj-content",encodeURIComponent(c)); e.setAttribute("lj-cmd","LJLike");e.setAttribute("frameBorder",0);e.setAttribute("allowTransparency","true");d.insertElement(e)}else e&&i.LJLike.node.remove();h.hide()}}),CKEDITOR.dialog.cancelButton];CKEDITOR.env.mac&&j.reverse();return{title:top.CKLang.LJLike_name,width:145,height:window.isSupUser?180:145,resizable:false,contents:[{id:"LJLike_Options",elements:[{type:"html",html:c}]}],onShow:function(){var a=d.getCommand("LJLike"),c=e=0,a=a.state==CKEDITOR.TRISTATE_ON,j=i.LJLike.node&&i.LJLike.node.getAttribute("buttons"); for(CKEDITOR.note&&CKEDITOR.note.hide(true);c<b;c++){var f=j?!!(j.indexOf(l[c].abbr)+1||j.indexOf(l[c].id)+1):true,g=document.getElementById("like-"+l[c].abbr);if(g){f&&!a&&e++;g.checked=f}}e>0&&h.getButton("LJLike_Ok").getElement().removeClass("btn-disabled")},onLoad:function(){h=this;f=h.parts.contents.getElementsByTag("input");for(var c=0;c<b;c++){var e=f.getItem(c);e&&e.on("click",a)}},buttons:j}});d.addCommand("LJLike",new CKEDITOR.dialogCommand("LJLikeDialog"));d.ui.addButton("LJLike",{label:top.CKLang.LJLike_name, command:"LJLike"})})()},afterInit:function(d){function f(b,a,c,d){var d=d||"text",e=new CKEDITOR.htmlParser.element("iframe");e.attributes["lj-class"]=a+" "+a+"-open";e.attributes["class"]=a+"-wrap";e.attributes["lj-cmd"]=c;e.attributes.frameBorder=0;e.attributes.allowTransparency="true";b.attributes.hasOwnProperty(d)&&(e.attributes.text=b.attributes[d]);b.children.unshift(e);c=new CKEDITOR.htmlParser.element("iframe");c.attributes["lj-class"]=a+" "+a+"-close";c.attributes["class"]=a+"-wrap";c.attributes.frameBorder= 0;c.attributes.allowTransparency="true";b.children.push(c);delete b.name}var i=d.dataProcessor;i.dataFilter.addRules({elements:{"lj-like":function(b){var a=[],c=new CKEDITOR.htmlParser.element("iframe");c.attributes["lj-class"]="lj-like";c.attributes["class"]="lj-like-wrap";b.attributes.hasOwnProperty("style")&&(c.attributes["lj-style"]=b.attributes.style);c.attributes["lj-cmd"]="LJLike";c.attributes["lj-content"]='<span class="lj-like-wrapper">';c.attributes.frameBorder=0;c.attributes.allowTransparency= "true";for(var b=b.attributes.buttons&&b.attributes.buttons.split(",")||l.defaultButtons,d=b.length,e=0;e<d;e++){var f=b[e].replace(/^\s*([a-z]{2,})\s*$/i,"$1"),i=l[f];i&&(c.attributes["lj-content"]+=encodeURIComponent(i.html),a.push(f))}c.attributes["lj-content"]+="</span>";c.attributes.buttons=a.join(",");return c},lj:function(){function b(a){for(var c=d.document.getElementsByTag("lj"),f=0,e=c.count();f<e;f++){var h=c.getItem(f);if(h){var i=h.getAttribute("user"),l=h.getAttribute("title");if(a== (l?i+":"+l:i))i=new CKEDITOR.dom.element.createFromHtml(o[a],d.document),i.setAttribute("lj-cmd","LJUserLink"),h.insertBeforeMe(i),h.remove()}}d.removeListener("dataReady",b)}return function(a){var c=a.attributes.user;if(c&&c.length){var f=(a=a.attributes.title)?c+":"+a:c;if(o.hasOwnProperty(f))return a=(new CKEDITOR.htmlParser.fragment.fromHtml(o[f])).children[0],a.attributes["lj-cmd"]="LJUserLink",a;var e={username:c};a&&(e.usertitle=a);HTTPReq.getJSON({data:HTTPReq.formEncoded(e),method:"POST", url:Site.siteroot+"/tools/endpoints/ljuser.bml",onError:function(a){alert(a+' "'+c+'"')},onData:function(a){if(a.error)return alert(a.error+' "'+c+'"');if(a.success){o[f]=a.ljuser;a.ljuser=a.ljuser.replace('<span class="useralias-value">*</span>',"");if(d.document)b(f);else d.on("dataReady",function(){b(f)})}}})}}}(),"lj-map":function(b){var a=new CKEDITOR.htmlParser.element("iframe"),c="",d="",e=Number(b.attributes.width),f=Number(b.attributes.height);isNaN(e)||(c+="width:"+e+"px;",d+="width:"+(e- 2)+"px;");isNaN(f)||(c+="height:"+f+"px;",d+="height:"+(f-2)+"px;");c.length&&(a.attributes.style=c,a.attributes["lj-style"]=d);a.attributes["lj-url"]=b.attributes.url?encodeURIComponent(b.attributes.url):"";a.attributes["lj-class"]="lj-map";a.attributes["class"]="lj-map-wrap";a.attributes["lj-content"]='<p class="lj-map">map</p>';a.attributes.frameBorder=0;a.attributes.allowTransparency="true";return a},"lj-raw":function(b){b.name="lj:raw"},"lj-wishlist":function(b){b.name="lj:wishlist"},"lj-template":function(b){var a= new CKEDITOR.htmlParser.element("iframe");a.attributes["lj-class"]="lj-template";a.attributes["class"]="lj-template-wrap";a.attributes.frameBorder=0;a.attributes.allowTransparency="true";a.attributes["lj-attributes"]=encodeURIComponent(LiveJournal.JSON.stringify(b.attributes));return a},"lj-cut":function(b){f(b,"lj-cut","LJCut")},"lj-spoiler":function(b){f(b,"lj-spoiler","LJSpoiler","title")},iframe:function(b){if(b.attributes["lj-class"]&&1==b.attributes["lj-class"].indexOf("lj-")+1)return b;var a= new CKEDITOR.htmlParser.element("iframe"),c="",d="",e=Number(b.attributes.width),f=Number(b.attributes.height);isNaN(e)||(c+="width:"+e+"px;",d+="width:"+(e-2)+"px;");isNaN(f)||(c+="height:"+f+"px;",d+="height:"+(f-2)+"px;");c.length&&(a.attributes.style=c,a.attributes["lj-style"]=d);a.attributes["lj-url"]=b.attributes.src?encodeURIComponent(b.attributes.src):"";a.attributes["lj-class"]="lj-iframe";a.attributes["class"]="lj-iframe-wrap";a.attributes["lj-content"]='<p class="lj-iframe">iframe</p>'; a.attributes.frameBorder=0;a.attributes.allowTransparency="true";return a},a:function(b){b.parent.attributes&&!b.parent.attributes["lj:user"]&&(b.attributes["lj-cmd"]="LJLink")},img:function(b){var a=b.parent&&b.parent.parent;if(!a||!a.attributes||!a.attributes["lj:user"])b.attributes["lj-cmd"]="image"},div:function(b){"lj-cut"==b.attributes["class"]&&f(b,"lj-cut","LJCut")}}},5);i.htmlFilter.addRules({elements:{iframe:function(b){var a=b,c=!1,d="text",e=/lj-[a-z]+/i.exec(b.attributes["lj-class"]); if(e)e=e[0];else return b;switch(e){case "lj-like":a=new CKEDITOR.htmlParser.element("lj-like");a.attributes.buttons=b.attributes.buttons;b.attributes.hasOwnProperty("lj-style")&&(a.attributes.style=b.attributes["lj-style"]);a.isEmpty=!0;a.isOptionalClose=!0;break;case "lj-embed":a=new CKEDITOR.htmlParser.element("lj-embed");a.attributes.id=b.attributes.id;b.attributes.hasOwnProperty("source_user")&&(a.attributes.source_user=b.attributes.source_user);a.children=(new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b.attributes["lj-data"]))).children; a.isOptionalClose=!0;break;case "lj-map":a=new CKEDITOR.htmlParser.element("lj-map");a.attributes.url=decodeURIComponent(b.attributes["lj-url"]);b.attributes.style&&(b.attributes.style+";").replace(/([a-z-]+):(.*?);/gi,function(b,c,d){a.attributes[c.toLowerCase()]=parseInt(d)});a.isOptionalClose=a.isEmpty=!0;break;case "lj-iframe":a=new CKEDITOR.htmlParser.element("iframe");a.attributes.src=decodeURIComponent(b.attributes["lj-url"]);b.attributes.style&&(b.attributes.style+";").replace(/([a-z-]+):(.*?);/gi, function(b,c,d){a.attributes[c.toLowerCase()]=parseInt(d)});a.attributes.frameBorder=0;break;case "lj-poll":a=(new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b.attributes["lj-data"]))).children[0];break;case "lj-repost":a=new CKEDITOR.htmlParser.element("lj-repost");a.attributes.button=b.attributes["lj-button"];a.children=(new CKEDITOR.htmlParser.fragment.fromHtml(b.attributes["lj-text"])).children;break;case "lj-template":a=new CKEDITOR.htmlParser.element("lj-template");a.attributes= LiveJournal.JSON.parse(encodeURIComponent(b.attributes["lj-attributes"]));a.isOptionalClose=a.isEmpty=!0;break;case "lj-spoiler":c=!0,d="title";case "lj-cut":if(b.attributes["lj-class"].indexOf(e+"-open")+1){var f=b.next,i=0,a=new CKEDITOR.htmlParser.element(e);for(b.attributes.hasOwnProperty("text")&&(a.attributes[d]=b.attributes.text);f;){if("iframe"==f.name)if(b=f.attributes["lj-class"],b.indexOf(e+"-close")+1)if(c&&i)i--;else{a.next=f;break}else if(b.indexOf(e+"-open")+1)if(c)i++;else{a.next= f;break}f.parent.children.remove(f);a.add(f);b=f.next;f.next=null;f=b}}else a=!1;break;default:b.children.length||(a=!1)}return a},span:function(b){var a=b.attributes["lj:user"];if(a){var c=new CKEDITOR.htmlParser.element("lj");c.attributes.user=a;try{var d=b.children[1].children[0].children[0].value}catch(e){return!1}d&&d!=a&&(c.attributes.title=d);c.isOptionalClose=c.isEmpty=!0;return c}if("display: none;"==b.attributes.style||!b.children.length)return!1},div:function(b){if(!b.children.length)return!1}, "lj:raw":function(b){b.name="lj-raw"},"lj:wishlist":function(b){b.name="lj-wishlist"}},attributes:{"lj-cmd":function(){return!1},contenteditable:function(){return!1}}})},requires:["fakeobjects","domiterator"]})})(); \ No newline at end of file +(function(){function t(d){function f(){var b=this.getAttribute("lj-cmd");c.hasOwnProperty(b)&&(i[b].node=c[b].node,(new CKEDITOR.dom.selection(d.document)).selectElement(i[b].node),s=!0,d.execCommand(b),CKEDITOR.note.hide(!0));return!1}function l(){window.switchedRteOn||CKEDITOR.note.hide(!0);if(a){c=j;j=null;var d="",g;for(g in c)c.hasOwnProperty(g)&&(d+='<div class="noteItem">'+c[g].content+"</div>");e.innerHTML=decodeURIComponent(d);d=e.getElementsByTagName("a");g=0;for(var r=d.length;g<r;g++){var n= +d[g];i.hasOwnProperty(n.getAttribute("lj-cmd"))&&(n.onclick=f)}}else c=null;p(a);b=null}var b,a,c,j,e=document.createElement("lj-note"),h="string"!=typeof document.body.style.opacity,p=function(){function b(){var d=p.shift(),d=(c?d.time/a:-(d.time/a-1)).toFixed(1);p.length||(d=c?1:0);h?e.style.filter=1<=d?null:"progid:DXImageTransform.Microsoft.Alpha(opacity="+100*d+")":e.style.opacity=d;0==d&&e&&e.parentNode&&e.parentNode.removeChild(e)}var a=100,d=60*a/1E3,p=[],c,k=document.getElementById("draft-container")|| +document.body;return function(a){if((c=a)&&e.parentNode)h?e.style.filter=null:e.style.opacity=1;else for(a=1;a<=d;a++){var g=Math.floor(1E3/60)*a;p.push({time:g,timer:setTimeout(b,g)})}k.appendChild(e);e.style.marginTop=-e.offsetHeight/2+"px";e.style.marginLeft=-e.offsetWidth/2+"px"}}();e.className="note-popup";e.onmouseout=function(){(!c||!c.cmd)&&CKEDITOR.note.hide()};e.onmouseover=function(){b&&!a&&(a=1,b=clearTimeout(b))};h?e.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)":e.style.opacity= +0;CKEDITOR.note={show:function(d,p){if((p||d!=j)&&window.switchedRteOn)b&&(b=clearTimeout(b)),a=1,j=d,!0===p?l():b=setTimeout(l,1E3)},hide:function(d){a&&(a=0,b&&(b=clearTimeout(b)),e.parentNode&&(!0===d?l():b=setTimeout(l,500)))}}}var l=[{label:top.CKLang.LJLike_button_facebook,id:"facebook",abbr:"fb",html:'<span class="lj-like-item fb">'+top.CKLang.LJLike_button_facebook+"</span>",htmlOpt:'<li class="like-fb"><input type="checkbox" id="like-fb" /><label for="like-fb">'+top.CKLang.LJLike_button_facebook+ +"</label></li>"},{label:top.CKLang.LJLike_button_twitter,id:"twitter",abbr:"tw",html:'<span class="lj-like-item tw">'+top.CKLang.LJLike_button_twitter+"</span>",htmlOpt:'<li class="like-tw"><input type="checkbox" id="like-tw" /><label for="like-tw">'+top.CKLang.LJLike_button_twitter+"</label></li>"},{label:top.CKLang.LJLike_button_google,id:"google",abbr:"go",html:'<span class="lj-like-item go">'+top.CKLang.LJLike_button_google+"</span>",htmlOpt:'<li class="like-go"><input type="checkbox" id="like-go" /><label for="like-go">'+ +top.CKLang.LJLike_button_google+"</label></li>"},{label:top.CKLang.LJLike_button_vkontakte,id:"vkontakte",abbr:"vk",html:'<span class="lj-like-item vk">'+top.CKLang.LJLike_button_vkontakte+"</span>",htmlOpt:window.isSupUser?'<li class="like-vk"><input type="checkbox" id="like-vk" /><label for="like-vk">'+top.CKLang.LJLike_button_vkontakte+"</label></li>":""},{label:top.CKLang.LJLike_button_give,id:"livejournal",abbr:"lj",html:'<span class="lj-like-item lj">'+top.CKLang.LJLike_button_give+"</span>", +htmlOpt:'<li class="like-lj"><input type="checkbox" id="like-lj" /><label for="like-lj">'+top.CKLang.LJLike_button_give+"</label></li>"}],i={LJPollLink:{html:encodeURIComponent(top.CKLang.Poll_PollWizardNotice+'<br /><a href="#" lj-cmd="LJPollLink">'+top.CKLang.Poll_PollWizardNoticeLink+"</a>")},LJLike:{html:encodeURIComponent(top.CKLang.LJLike_WizardNotice+'<br /><a href="#" lj-cmd="LJLike">'+top.CKLang.LJLike_WizardNoticeLink+"</a>")},LJUserLink:{html:encodeURIComponent(top.CKLang.LJUser_WizardNotice+ +'<br /><a href="#" lj-cmd="LJUserLink">'+top.CKLang.LJUser_WizardNoticeLink+"</a>")},LJLink:{html:encodeURIComponent(top.CKLang.LJLink_WizardNotice+'<br /><a href="#" lj-cmd="LJLink">'+top.CKLang.LJLink_WizardNoticeLink+"</a>")},image:{html:encodeURIComponent(top.CKLang.LJImage_WizardNotice+'<br /><a href="#" lj-cmd="image">'+top.CKLang.LJImage_WizardNoticeLink+"</a>")},LJCut:{html:encodeURIComponent(top.CKLang.LJCut_WizardNotice+'<br /><a href="#" lj-cmd="LJCut">'+top.CKLang.LJCut_WizardNoticeLink+ +"</a>")},LJSpoiler:{html:encodeURIComponent(top.CKLang.LJSpoiler_WizardNotice+'<br /><a href="#" lj-cmd="LJSpoiler">'+top.CKLang.LJSpoiler_WizardNoticeLink+"</a>")}},o={},s,f=CKEDITOR.dtd;f.$block["lj-template"]=1;f.$block["lj-raw"]=1;f.$block["lj-cut"]=1;f.$block["lj-spoiler"]=1;f.$block["lj-poll"]=1;f.$block["lj-repost"]=1;f.$block["lj-pq"]=1;f.$block["lj-pi"]=1;f.$nonEditable["lj-template"]=1;f["lj-template"]={};f["lj-map"]={};f["lj-repost"]={};f["lj-raw"]=f.div;f["lj-poll"]={"lj-pq":1};f["lj-pq"]= +{"#":1,"lj-pi":1};f["lj-pi"]={"#":1};f.$block.iframe=f.$inline.iframe;delete f.$inline.iframe;CKEDITOR.tools.extend(f["lj-cut"]={},f.$block);CKEDITOR.tools.extend(f["lj-spoiler"]={},f.$block);CKEDITOR.tools.extend(f["lj-cut"],f.$inline);CKEDITOR.tools.extend(f["lj-spoiler"],f.$inline);CKEDITOR.tools.extend(f.div,f.$block);CKEDITOR.tools.extend(f.$body,f.$block);delete f["lj-cut"]["lj-cut"];CKEDITOR.plugins.add("livejournal",{init:function(d){function f(b){var a=b.data.element||b.data.getTarget(); +for(1!=a.type&&(a=a.getParent());a;){var g=a.getAttribute("lj-cmd");if(i.hasOwnProperty(g)){var c=d.getCommand(g);if(c.state==CKEDITOR.TRISTATE_ON){var n=new CKEDITOR.dom.selection(d.document);i[g].node=a.is("body")?new CKEDITOR.dom.element.get(a.getWindow().$.frameElement):a;n.selectElement(i[g].node);b.data.dialog="";s=!0;c.exec();break}}a=a.getParent()}}function u(a){this.$!=d.document.$&&(this.$.className=(this.frame.getAttribute("lj-class")||"")+" lj-selected","LJPollLink"==this.getAttribute("lj-cmd")&& +this.frame.setStyle("height",this.getDocument().$.body.scrollHeight+"px"),(new CKEDITOR.dom.selection(d.document)).selectElement(this.frame));1==a.data.getKey()&&a.data.preventDefault()}function b(a){if(46==a.data.getKey())for(var a=(new CKEDITOR.dom.selection(d.document)).getRanges(),b=a.length;b--;)a[b].deleteContents()}function a(){var a=this.$.contentWindow.document,d=new CKEDITOR.dom.element.get(a.body);d.on&&(d.on("dblclick",f),d.on("click",u),d.on("keyup",b),"LJPollLink"==this.getAttribute("lj-cmd")&& +this.hasAttribute("style")&&(a.body.className="lj-poll lj-poll-open"));a=new CKEDITOR.dom.element.get(a);a.frame=d.frame=this}function c(){var b=d.document.getElementsByTag("iframe"),c=b.count(),g,e,n,m;for(s=!1;c--;)g=b.getItem(c),e=g.getAttribute("lj-cmd"),n=g.$.contentWindow,n=n.document,m=g.getAttribute("lj-style")||"",g.removeListener("load",a),g.on("load",a),n.open(),n.write('<!DOCTYPE html><html style="'+m+'"><head><link rel="stylesheet" href="'+CKEDITOR.styleText+'" /></head><body scroll="no" class="'+ +(g.getAttribute("lj-class")||"")+'" style="'+m+'" '+(e?'lj-cmd="'+e+'"':"")+">"+decodeURIComponent(g.getAttribute("lj-content")||"")+"</body></html>"),n.close()}function j(a){if(!0===d.onSwitch)delete d.onSwitch;else{var b,g="click"==a.name,c="selectionChange"==a.name||g,e=a.data.element||a.data.getTarget(),m;g&&(1==a.data.getKey()||0==a.data.$.button)&&a.data.preventDefault();1!=e.type&&(e=e.getParent());a=e;if(c){var e=d.document.getElementsByTag("iframe"),k;g&&a.is("iframe")&&(k=a.$.contentWindow.document.body, +k.className=(a.getAttribute("lj-class")||"")+" lj-selected","LJPollLink"==a.getAttribute("lj-cmd")&&a.setStyle("height",k.scrollHeight+"px"));for(var h=0,q=e.count();h<q;h++)g=e.getItem(h),g.$!=a.$&&(k=g.$.contentWindow.document.body,k.className=g.getAttribute("lj-class")||"","LJPollLink"==g.getAttribute("lj-cmd")&&"lj-poll"==k.className&&g.removeAttribute("style"))}do if(e=a.getAttribute("lj-cmd"),!e&&1==a.type&&(g=a.getParent(),a.is("img")&&g.getParent()&&!g.getParent().hasAttribute("lj:user")? +(e="image",a.setAttribute("lj-cmd",e)):a.is("a")&&!g.hasAttribute("lj:user")&&(e="LJLink",a.setAttribute("lj-cmd",e))),e&&i.hasOwnProperty(e))c&&(i[e].node=a,d.getCommand(e).setState(CKEDITOR.TRISTATE_ON)),(b||(b={}))[e]={content:i[e].html,node:a};while(a=a.getParent());if(c)for(m in i)if(i.hasOwnProperty(m)&&(!b||!b.hasOwnProperty(m)))delete i[m].node,d.getCommand(m).setState(CKEDITOR.TRISTATE_OFF);b?CKEDITOR.note.show(b):CKEDITOR.note.hide()}}function e(a,b,g){var c,e=i[b].node;if(e){if(c=prompt(g.title, +e.getAttribute("text")||g.text))c==g.text?e.removeAttribute("text"):e.setAttribute("text",c)}else{if(c=prompt(g.title,g.text)){d.focus();var e=new CKEDITOR.dom.selection(d.document),m=e.getRanges(),k=new CKEDITOR.dom.element("iframe",d.document),h=k.clone();k.setAttribute("lj-cmd",b);k.setAttribute("lj-class",a+" "+a+"-open");k.setAttribute("class",a+"-wrap");k.setAttribute("frameBorder",0);k.setAttribute("allowTransparency","true");c!=g.text&&k.setAttribute("text",c);h.setAttribute("lj-class",a+ +" "+a+"-close");h.setAttribute("class",a+"-wrap");h.setAttribute("frameBorder",0);h.setAttribute("allowTransparency","true");a=m[0];e.lock();b=new CKEDITOR.dom.element("br",d.document);g=b.clone();c=b.clone();var q=new CKEDITOR.dom.documentFragment(d.document);q.append(b.clone());q.append(k);q.append(g);if(!1===a.collapsed)for(var k=0,j=m.length;k<j;k++)q.append(m[k].extractContents());q.append(c);d.insertElement(h);b.clone().insertAfter(h);h.insertBeforeMe(q);a.setStart(g,0);a.setEnd(c,0);e.unlock(); +e.selectRanges(m)}CKEDITOR.note&&CKEDITOR.note.hide(!0)}}(function(){function a(b){return"/>"==b.slice(-2)?b:b.slice(0,-1)+"/>"}function b(a){a=new Poll(a);return'<iframe class="lj-poll-wrap" lj-class="lj-poll" frameborder="0" lj-cmd="LJPollLink" allowTransparency="true" lj-data="'+a.outputLJtags()+'" lj-content="'+a.outputHTML()+'"></iframe>'}function c(a,b,d){return'<iframe class="lj-embed-wrap" lj-class="lj-embed" frameborder="0" allowTransparency="true" lj-data="'+encodeURIComponent(d)+'"'+b+ +"></iframe>"}function e(a,b,d,c){return b+d.replace(/\n/g,"")+c}function h(a,b,d,c){a=b||d||top.CKLang.LJRepost_Value;b=c.replace(/"/g,""");c=b+('<br /><input type="button" value="'+a+'" />').replace(/"/g,""");return'<iframe class="lj-repost-wrap" lj-class="lj-repost" frameborder="0" allowTransparency="true" lj-text="'+b+'" lj-button="'+a+'" lj-content="'+c+'"></iframe>'}d.dataProcessor.toHtml=function(d,k){d=d.replace(/<lj [^>]*?>/gi,a).replace(/<lj-map [^>]*?>/gi,a).replace(/<lj-template[^>]*?>/gi, +a).replace(/(<lj-cut[^>]*?)\/>/gi,"$1>").replace(/<((?!br)[^\s>]+)([^>]*?)\/>/gi,"<$1$2></$1>").replace(/<lj-poll.*?>[\s\S]*?<\/lj-poll>/gi,b).replace(/<lj-repost\s*(?:button\s*=\s*(?:"([^"]*?)")|(?:"([^']*?)"))?.*?>([\s\S]*?)<\/lj-repost>/gi,h).replace(/<lj-embed(.*?)>([\s\S]*?)<\/lj-embed>/gi,c);$("event_format").checked||(d=d.replace(/(<lj-raw.*?>)([\s\S]*?)(<\/lj-raw>)/gi,e),window.switchedRteOn||(d=d.replace(/\n/g,"<br />")));d=CKEDITOR.htmlDataProcessor.prototype.toHtml.call(this,d,k);CKEDITOR.env.ie&& +(d='<xml:namespace ns="livejournal" prefix="lj" />'+d);return d}})();d.dataProcessor.toDataFormat=function(a,b){a=CKEDITOR.htmlDataProcessor.prototype.toDataFormat.call(this,a,b);$("event_format").checked||(a=a.replace(/<br\s*\/>/gi,"\n"));return a.replace(/\t/g," ")};d.dataProcessor.writer.indentationChars="";d.dataProcessor.writer.lineBreakChars="";d.on("selectionChange",j);d.on("doubleclick",f);d.on("afterCommandExec",c);d.on("dialogHide",c);d.on("dataReady",function(){CKEDITOR.note||t(d);CKEDITOR.env.ie&& +(d.document.getBody().on("dragend",c),d.document.getBody().on("paste",function(){setTimeout(c,0)}));d.document.on("click",j);d.document.on("mouseout",CKEDITOR.note.hide);d.document.on("mouseover",j);d.document.getBody().on("keyup",b);c()});(function(){var a=top.Site.siteroot+"/tools/endpoints/ljuser.bml";d.addCommand("LJUserLink",{exec:function(b){var c="",b=new CKEDITOR.dom.selection(b.document),e=i.LJUserLink.node,h;e?(CKEDITOR.note&&CKEDITOR.note.hide(!0),h=i.LJUserLink.node.getElementsByTag("b").getItem(0).getText(), +c=prompt(top.CKLang.UserPrompt,h)):2==b.getType()&&(c=b.getSelectedText());""==c&&(c=prompt(top.CKLang.UserPrompt,c));c&&h!=c&&parent.HTTPReq.getJSON({data:parent.HTTPReq.formEncoded({username:c}),method:"POST",url:a,onData:function(a){var b=c;if(a.error)alert(a.error);else if(a.success){a.ljuser=a.ljuser.replace('<span class="useralias-value">*</span>',"");o[b]=a.ljuser;a=new CKEDITOR.dom.element.createFromHtml(a.ljuser);a.setAttribute("lj-cmd","LJUserLink");e?e.$.parentNode.replaceChild(a.$,e.$): +d.insertElement(a)}}})}});d.ui.addButton("LJUserLink",{label:top.CKLang.LJUser,command:"LJUserLink"})})();window.ljphotoEnabled&&window.ljphotoMigrationStatus===LJ.getConst("LJPHOTO_MIGRATION_NONE")?d.ui.addButton("image",{label:top.CKLang.LJImage_Title,command:"image"}):(d.addCommand("LJImage",{exec:function(){InOb.handleInsertImageBeta("upload")},editorFocus:!1}),d.ui.addButton("image",{label:top.CKLang.LJImage_Title,command:"LJImage"}));d.addCommand("LJLink",{exec:function(a){!s&&this.state==CKEDITOR.TRISTATE_ON? +a.execCommand("unlink"):a.openDialog("link");CKEDITOR.note&&CKEDITOR.note.hide(true)},editorFocus:!1});d.ui.addButton("LJLink",{label:d.lang.link.toolbar,command:"LJLink"});(function(){function a(b){if(b&&b.length&&window.switchedRteOn){var e=new CKEDITOR.dom.element("iframe",d.document);e.setAttribute("lj-data",encodeURIComponent(b));e.setAttribute("lj-class","lj-embed");e.setAttribute("class","lj-embed-wrap");e.setAttribute("frameBorder",0);e.setAttribute("allowTransparency","true");d.insertElement(e); +c()}}d.addCommand("LJEmbedLink",{exec:function(){top.LJ_IPPU.textPrompt(top.CKLang.LJEmbedPromptTitle,top.CKLang.LJEmbedPrompt,a,{width:"350px"})}});d.ui.addButton("LJEmbedLink",{label:top.CKLang.LJEmbed,command:"LJEmbedLink"})})();d.addCommand("LJCut",{exec:function(){e("lj-cut","LJCut",{title:top.CKLang.LJCut_PromptTitle,text:top.CKLang.LJCut_PromptText})},editorFocus:!1});d.ui.addButton("LJCut",{label:top.CKLang.LJCut_Title,command:"LJCut"});d.addCommand("LJSpoiler",{exec:function(){e("lj-spoiler", +"LJSpoiler",{title:top.CKLang.LJSpoiler_PromptTitle,text:top.CKLang.LJSpoiler_PromptText})},editorFocus:!1});d.ui.addButton("LJSpoiler",{label:top.CKLang.LJSpoiler_Title,command:"LJSpoiler"});(function(){function a(b,d){var d=d===void 0||d,c;if(i.LJLike.node)c=(c=b.getAttribute("lj-style"))?c.replace(/text-align:\s*(left|right|center)/i,"$1"):"left";else if(d)c=b.getComputedStyle("text-align");else{for(;!b.hasAttribute||!b.hasAttribute("align")&&!b.getStyle("text-align");){c=b.getParent();if(!c)break; +b=c}c=b.getStyle("text-align")||b.getAttribute("align")||""}c&&(c=c.replace(/-moz-|-webkit-|start|auto/i,""));!c&&d&&(c=b.getComputedStyle("direction")=="rtl"?"right":"left");return c}function b(c){if(!c.editor.readOnly){var e=c.editor.getCommand(this.name),c=c.data.element;e.state=(c.type==1&&c.hasAttribute("lj-cmd")&&c.getAttribute("lj-cmd"))=="LJLike"?a(c,d.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF:!c||c.type!=1||c.getName()=="body"||c.getName()=="iframe"? +CKEDITOR.TRISTATE_OFF:a(c,d.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;e.fire("state")}}function c(a,b,d){this.name=b;this.value=d;if(a=a.config.justifyClasses){switch(d){case "left":this.cssClassName=a[0];break;case "center":this.cssClassName=a[1];break;case "right":this.cssClassName=a[2]}this.cssClassRegex=RegExp("(?:^|\\s+)(?:"+a.join("|")+")(?=$|\\s)")}}c.prototype={exec:function(b){var c=b.getSelection(),d=b.config.enterMode;if(c){var e=c.createBookmarks(); +if(i.LJLike.node)i.LJLike.node.setAttribute("lj-style","text-align: "+this.value);else for(var h=c.getRanges(true),g=this.cssClassName,j,f,n=b.config.useComputedState,n=n===void 0||n,r=h.length-1;r>=0;r--){j=h[r];if((f=j.getEnclosedNode())&&f.is("iframe"))return;j=j.createIterator();for(j.enlargeBr=d!=CKEDITOR.ENTER_BR;f=j.getNextParagraph(d==CKEDITOR.ENTER_P?"p":"div");){f.removeAttribute("align");f.removeStyle("text-align");var m=g&&(f.$.className=CKEDITOR.tools.ltrim(f.$.className.replace(this.cssClassRegex, +""))),l=this.state==CKEDITOR.TRISTATE_OFF&&(!n||a(f,true)!=this.value);g?l?f.addClass(g):m||f.removeAttribute("class"):l&&f.setStyle("text-align",this.value)}}b.focus();b.forceNextSelectionCheck();c.selectBookmarks(e)}}};var e=new c(d,"LJJustifyLeft","left"),h=new c(d,"LJJustifyCenter","center"),j=new c(d,"LJJustifyRight","right");d.addCommand("LJJustifyLeft",e);d.addCommand("LJJustifyCenter",h);d.addCommand("LJJustifyRight",j);d.ui.addButton("LJJustifyLeft",{label:d.lang.justify.left,command:"LJJustifyLeft"}); +d.ui.addButton("LJJustifyCenter",{label:d.lang.justify.center,command:"LJJustifyCenter"});d.ui.addButton("LJJustifyRight",{label:d.lang.justify.right,command:"LJJustifyRight"});d.on("selectionChange",CKEDITOR.tools.bind(b,e));d.on("selectionChange",CKEDITOR.tools.bind(b,j));d.on("selectionChange",CKEDITOR.tools.bind(b,h));d.on("dirChanged",function(a){var b=a.editor,c=new CKEDITOR.dom.range(b.document);c.setStartBefore(a.data.node);c.setEndAfter(a.data.node);for(var d=new CKEDITOR.dom.walker(c),e;e= +d.next();)if(e.type==CKEDITOR.NODE_ELEMENT){var g=b.config.justifyClasses;if(!e.equals(a.data.node)&&e.getDirection()){c.setStartAfter(e);d=new CKEDITOR.dom.walker(c)}else{if(g)if(e.hasClass(g[0])){e.removeClass(g[0]);e.addClass(g[2])}else if(e.hasClass(g[2])){e.removeClass(g[2]);e.addClass(g[0])}switch(e.getStyle("text-align")){case "left":e.setStyle("text-align","right");break;case "right":e.setStyle("text-align","left")}}}})})();if(top.canmakepoll){var h;CKEDITOR.dialog.add("LJPollDialog",function(){var a= +0,b,e,j,f=function(){this.removeListener&&this.removeListener("load",f);if(a&&b){h=new Poll(i.LJPollLink.node&&decodeURIComponent(i.LJPollLink.node.getAttribute("lj-data")),e.document,j.document,e.Questions);e.ready(h);j.ready(h);b.style.display="block";CKEDITOR.note&&CKEDITOR.note.hide(true)}else a++},m=[new CKEDITOR.ui.button({type:"button",id:"LJPoll_Ok",label:d.lang.common.ok,onClick:function(a){a.data.dialog.hide();var b=new Poll(h,e.document,j.document,e.Questions),a=b.outputHTML(),b=b.outputLJtags(); +if(a.length>0){var f=i.LJPollLink.node;if(f){f.setAttribute("lj-content",a);f.setAttribute("lj-data",b);f.removeAttribute("style");f.$.contentWindow.document.body.className="lj-poll"}else{f=new CKEDITOR.dom.element("iframe",d.document);f.setAttribute("lj-content",a);f.setAttribute("lj-cmd","LJPollLink");f.setAttribute("lj-data",b);f.setAttribute("lj-class","lj-poll");f.setAttribute("class","lj-poll-wrap");f.setAttribute("frameBorder",0);f.setAttribute("allowTransparency","true");d.insertElement(f)}i.LJPollLink.node= +null;c()}}}),CKEDITOR.dialog.cancelButton];CKEDITOR.env.mac&&m.reverse();return{title:top.CKLang.Poll_PollWizardTitle,width:420,height:270,resizable:false,onShow:function(){if(a){h=new Poll(i.LJPollLink.node&&unescape(i.LJPollLink.node.getAttribute("data")),e.document,j.document,e.Questions);e.ready(h);j.ready(h)}},contents:[{id:"LJPoll_Setup",label:"Setup",padding:0,elements:[{type:"html",html:'<iframe src="/tools/ck_poll_setup.bml" allowTransparency="true" frameborder="0" style="width:100%; height:320px;"></iframe>', +onShow:function(a){if(!b)(b=document.getElementById(a.sender.getButton("LJPoll_Ok").domId).parentNode).style.display="none";a=this.getElement("iframe");j=a.$.contentWindow;if(j.ready)f();else a.on("load",f)}}]},{id:"LJPoll_Questions",label:"Questions",padding:0,elements:[{type:"html",html:'<iframe src="/tools/ck_poll_questions.bml" allowTransparency="true" frameborder="0" style="width:100%; height:320px;"></iframe>',onShow:function(){var a=this.getElement("iframe");e=a.$.contentWindow;if(e.ready)f(); +else a.on("load",f)}}]}],buttons:m}});d.addCommand("LJPollLink",new CKEDITOR.dialogCommand("LJPollDialog"))}else d.addCommand("LJPollLink",{exec:function(){CKEDITOR.note&&CKEDITOR.note.show(top.CKLang.Poll_AccountLevelNotice,null,null,true)}}),d.getCommand("LJPollLink").setState(CKEDITOR.TRISTATE_DISABLED);d.ui.addButton("LJPollLink",{label:top.CKLang.Poll_Title,command:"LJPollLink"});(function(){function a(){if(d.getCommand("LJLike")==CKEDITOR.TRISTATE_OFF){this.$.checked?e++:e--;h.getButton("LJLike_Ok").getElement()[e== +0?"addClass":"removeClass"]("btn-disabled")}}var b=l.length,c='<div class="cke-dialog-likes"><ul class="cke-dialog-likes-list">',e=0,h,f;l.defaultButtons=[];for(var j=0;j<b;j++){var o=l[j];l[o.id]=l[o.abbr]=o;l.defaultButtons.push(o.id);c=c+o.htmlOpt}c=c+('</ul><p class="cke-dialog-likes-faq">'+window.faqLink+"</p></div>");CKEDITOR.dialog.add("LJLikeDialog",function(){var j=[new CKEDITOR.ui.button({type:"button",id:"LJLike_Ok",label:d.lang.common.ok,onClick:function(){var a=[],c='<span class="lj-like-wrapper">', +e=i.LJLike.node;if(h.getButton("LJLike_Ok").getElement().hasClass("btn-disabled"))return false;for(var f=0;f<b;f++){var j=l[f],g=document.getElementById("like-"+j.abbr),k=e&&e.getAttribute("buttons");if(g&&g.checked||k&&!j.htmlOpt&&(k.indexOf(j.abbr)+1||k.indexOf(j.id)+1)){a.push(j.id);c=c+j.html}}c=c+"</span>";if(a.length)if(e){i.LJLike.node.setAttribute("buttons",a.join(","));i.LJLike.node.setAttribute("lj-content",encodeURIComponent(c))}else{e=new CKEDITOR.dom.element("iframe",d.document);e.setAttribute("lj-class", +"lj-like");e.setAttribute("class","lj-like-wrap");e.setAttribute("buttons",a.join(","));e.setAttribut... (truncated)