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

[livejournal] r19759: LJSUP-9542: RTE - lj-map placeholder

Committer: vkurkin
LJSUP-9542: RTE - lj-map placeholder
U   trunk/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js
===================================================================
--- trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-17 09:29:20 UTC (rev 19758)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-17 09:31:04 UTC (rev 19759)
@@ -1161,17 +1161,11 @@
 						}
 					},
 					'lj-map': function(element){
-						var fakeElement = new CKEDITOR.htmlParser.element('div');
-						fakeElement.attributes['lj-url'] = encodeURIComponent(element.attributes.url);
-						fakeElement.attributes.contentEditable = 'false';
-
-						var width = 'width: ' + (isNaN(element.attributes.width) ? 100 : element.attributes.width) + 'px; ';
-						var height = 'height: ' + (isNaN(element.attributes.height) ? 100 : element.attributes.height) + 'px; ';
-						fakeElement.attributes.style = width + height;
-
-						fakeElement.attributes['class'] = 'lj-map';
-
-						return fakeElement;
+						return new CKEDITOR.htmlParser.fragment.fromHtml('' + '<div style="' + 'width: ' + (isNaN(element.attributes
+							.width) ? 100 : element.attributes.width) + 'px;' + 'height: ' + (isNaN(element.attributes
+							.height) ? 100 : element.attributes
+							.height) + 'px;"' + 'contentEditable="false"' + 'lj-url="' + (encodeURIComponent(element.attributes
+							.url) || '') + '"' + 'class="lj-map"><p>map</p>' + '</div>').children[0];
 					},
 					a: function(element) {
 						element.attributes['lj-cmd'] = 'LJLink';

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