Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r19613: LJSUP-9159: Update and improve RTE by CK...

Committer: vkurkin
LJSUP-9159: Update and improve RTE by CKEditor 3.6.1
U   trunk/htdocs/js/ck/plugins/livejournal/plugin.js
U   trunk/htdocs/js/rte.js
Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js
===================================================================
--- trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-05 08:50:13 UTC (rev 19612)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-05 09:06:09 UTC (rev 19613)
@@ -30,7 +30,7 @@
 			id: 'vkontakte',
 			abbr: 'vk',
 			html: '<span class="lj-like-item lj-like-gag 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
+			htmlOpt: window.isSupUser ? '<li class="like-vk"><input type="checkbox" id="like-vk" /><label for="like-vk">' + top.CKLang
 				.LJLike_button_vkontakte + '</label></li>' : ''
 		},
 		{
@@ -222,7 +222,7 @@
 			function addLastTag(){
 				var body = editor.document.getBody();
 				var last = body.getLast();
-				if(last && !last.is('br')){
+				if(last && last.type == 1 && !last.is('br')){
 					body.appendHtml('<br />');
 				}
 			}

Modified: trunk/htdocs/js/rte.js
===================================================================
--- trunk/htdocs/js/rte.js	2011-08-05 08:50:13 UTC (rev 19612)
+++ trunk/htdocs/js/rte.js	2011-08-05 09:06:09 UTC (rev 19613)
@@ -26,35 +26,13 @@
 					};
 
 					CKEditor.on('dataReady', function(){
-						var insobj = $('insobj');
-						if(insobj){
-							insobj.className = 'on';
-						}
 
-						var jrich = $('jrich');
-						if(jrich){
-							jrich.className = 'on';
-						}
+						$('entry-form-wrapper').className = 'hide-html';
 
-						var jplain = $('jplain');
-						if(jplain){
-							jplain.className = '';
-						}
-
-						var htmltools = $('htmltools');
-						if(htmltools){
-							htmltools.style.display = 'none';
-						}
-
-						var preview = $('qotd_html_preview');
-						if(preview){
-							preview.style.display = 'none';
-						}
-
 						CKEditor.container.show();
 						CKEditor.element.hide();
 
-						var ljTags = CKEditor.document.getElementsByTag('lj-template').$,
+						/*var ljTags = CKEditor.document.getElementsByTag('lj-template').$,
 							i = ljTags.length;
 
 						var styleNoEdit = 'cursor: default; -moz-user-select: all; -moz-user-input: none; -moz-user-focus: none; -khtml-user-select: all;';
@@ -81,7 +59,7 @@
 									div.innerHTML = alt;
 									ljTag.parentNode.replaceChild(div, ljTag);
 							}
-						}
+						}*/
 					});
 				});
 			} else {
@@ -113,35 +91,7 @@
 				CKEditor.element.show();
 			}
 
-			var insobj = $('insobj');
-			if(insobj){
-				insobj.className = '';
-			}
-
-			var jrich = $('jrich');
-			if(jrich){
-				jrich.className = '';
-			}
-
-			var jplain = $('jplain');
-			if(jplain){
-				jplain.className = 'on';
-			}
-
-			var htmltools = $('htmltools');
-			if(htmltools){
-				htmltools.style.display = 'block';
-			}
-
-			var preview = $('qotd_html_preview');
-			if(preview){
-				preview.style.display = 'block';
-			}
-
-			var textareaNode = $(textArea);
-			if(textareaNode){
-				textareaNode.style.cssText = 'display:block';
-			}
+			$('entry-form-wrapper').className = 'hide-richtext';
 		}
 
 		return false;

Tags: b_vladi, js, livejournal
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