Committer: vkurkin
LJSV-1790: When edit "old" entries, created with RTE, lj-cut brokenU trunk/htdocs/js/ck/contents.css U trunk/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: trunk/htdocs/js/ck/contents.css =================================================================== --- trunk/htdocs/js/ck/contents.css 2011-09-15 03:15:31 UTC (rev 20044) +++ trunk/htdocs/js/ck/contents.css 2011-09-15 03:30:52 UTC (rev 20045) @@ -2,61 +2,84 @@ Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ +@namespace lj "livejournal"; BODY { - position: relative; - /* Font */ + position: relative; /* Font */ font-family: Arial, Verdana, sans-serif; - font-size: 12px; - - /* Text color */ - color: #222; - - /* Remove the background color to make it transparent */ + font-size: 12px; /* Text color */ + color: #222; /* Remove the background color to make it transparent */ background-color: #fff; } -ol,ul,dl -{ - /* IE7: reset rtl list margin. (#7334) */ - *margin-right:0px; - /* preserved spaces for rtl list item bullets. (#6249)*/ - padding-right:40px; +ol, ul, dl { +/* IE7: reset rtl list margin. (#7334) */ + *margin-right: 0px; /* preserved spaces for rtl list item bullets. (#6249)*/ + padding-right: 40px; } pre { - display:block; + display: block; margin: 0; } /* LJ CSS */ -.lj-template { +.lj\:template { background-color: #000; color: #fff; display: none; } -lj\:wishlist, -lj-wishlist { +.lj|template { + background-color: #000; + color: #fff; + display: none; +} + +lj\:wishlist { display: block; width: 212px; height: 212px; border: 1px solid #d2d2d2; background: url(/img/widget/wishlist/bag_212x212.png?v=1) no-repeat 0 0; } +lj|wishlist { + display: block; + width: 212px; + height: 212px; + border: 1px solid #d2d2d2; + background: url(/img/widget/wishlist/bag_212x212.png?v=1) no-repeat 0 0; +} -lj\:raw, -lj-raw { +lj|wishlist { + display: block; + width: 212px; + height: 212px; + border: 1px solid #d2d2d2; + background: url(/img/widget/wishlist/bag_212x212.png?v=1) no-repeat 0 0; +} + +lj\:raw { border: #000000 1px dotted; } +lj|raw { + border: #000000 1px dotted; +} -lj-cut { +lj\:cut { display: block; border: #000 1px dotted; background-color: #d2d2d2; min-height: 14px; } +lj|cut { + display: block; + border: #000 1px dotted; + background-color: #d2d2d2; + min-height: 14px; +} + .lj-map P { position: relative; top: 40%; @@ -70,14 +93,19 @@ line-height: 12px; font-size: 12px; color: #FF0000; - } +} /* fix inline behavior, for no IE */ -lj-cut ul, -lj-cut ol { +lj\:cut ul, +lj\:cut ol { background-color: #d2d2d2; border: #000 1px dotted; } +lj|cut ul, +lj|cut ol { + background-color: #d2d2d2; + border: #000 1px dotted; +} .ljuser { white-space: nowrap; @@ -102,6 +130,7 @@ background-color: #d2d2d2; font-style: italic; } + /* Note popup */ .note { position: fixed; @@ -111,12 +140,14 @@ background: #FFFFDD; border: 1px solid #FFCC33; color: #000; - display:block; - } - .note A { - color: #555; - cursor:pointer; - } + display: block; +} + +.note A { + color: #555; + cursor: pointer; +} + /* LJ Like buttons */ .lj-like { overflow: hidden; @@ -124,40 +155,47 @@ margin-top: 20px; background: #D2D2D2; border: 1px dotted #000; - } - .lj-like .lj-like-item { - display: inline-block; - margin-right: 15px; - background: url(/js/ck/images/lj-like-buttons.png) no-repeat; - vertical-align: middle; - font-size: 0; - cursor: pointer; - } - .lj-like .fb { - width: 93px; - height: 20px; - background-position: 0 0; - } - .lj-like .tw { - width: 55px; - height: 20px; - background-position: 0 -46px; - } - .lj-like .go { - width: 32px; - height: 20px; - background-position: 0 -90px; - } - .lj-like .vk { - width: 40px; - height: 22px; - background-position: 0 -67px; - } - .lj-like .lj { - width: 67px; - height: 24px; - background-position: 0 -21px; - } +} + +.lj-like .lj-like-item { + display: inline-block; + margin-right: 15px; + background: url(/js/ck/images/lj-like-buttons.png) no-repeat; + vertical-align: middle; + font-size: 0; + cursor: pointer; +} + +.lj-like .fb { + width: 93px; + height: 20px; + background-position: 0 0; +} + +.lj-like .tw { + width: 55px; + height: 20px; + background-position: 0 -46px; +} + +.lj-like .go { + width: 32px; + height: 20px; + background-position: 0 -90px; +} + +.lj-like .vk { + width: 40px; + height: 22px; + background-position: 0 -67px; +} + +.lj-like .lj { + width: 67px; + height: 24px; + background-position: 0 -21px; +} + /* LJ map */ .lj-map { overflow: hidden; @@ -166,4 +204,4 @@ margin-top: 20px; background: #D2D2D2; border: 1px dotted #000; - } +} Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js =================================================================== --- trunk/htdocs/js/ck/plugins/livejournal/plugin.js 2011-09-15 03:15:31 UTC (rev 20044) +++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js 2011-09-15 03:30:52 UTC (rev 20045) @@ -1,4 +1,6 @@ (function() { + // For IE 8- + document.namespaces && document.namespaces.add('lj', 'livejournal'); var likeButtons = [ { @@ -718,9 +720,9 @@ } ////////// LJ Cut Button ////////////// - CKEDITOR.dtd.$block['lj-cut'] = 1; + CKEDITOR.dtd.$block['lj-cut'] = CKEDITOR.dtd.$block['lj:cut'] = 1; - CKEDITOR.dtd['lj-cut'] = CKEDITOR.dtd.div; + CKEDITOR.dtd['lj:cut'] = CKEDITOR.dtd['lj-cut'] = CKEDITOR.dtd.div; editor.addCommand('LJCut', { exec: function() { @@ -740,7 +742,7 @@ var br = editor.document.createElement('br'), selection = editor.document.getSelection(); - ljNoteData.LJCut.node = editor.document.createElement('lj-cut'); + ljNoteData.LJCut.node = editor.document.createElement('lj:cut'); ljNoteData.LJCut.node.setAttribute('lj-cmd', 'LJCut'); if (text != top.CKLang.ReadMore) { ljNoteData.LJCut.node.setAttribute('text', text); @@ -1154,7 +1156,7 @@ .height) + 'px;"' + 'contentEditable="false"' + 'lj-url="' + (encodeURIComponent(element.attributes .url) || '') + '"' + 'class="lj-map"><p>map</p>' + '</div>').children[0]; }, - 'lj-repost': function(element) { + 'lj-repost': function() { var fakeElement = new CKEDITOR.htmlParser.element('input'); fakeElement.attributes.type = 'button'; fakeElement.attributes.value = top.CKLang.LJRepost_Value; @@ -1162,9 +1164,17 @@ return fakeElement; }, 'lj-cut': function(element) { + element.name = 'lj:cut'; element.attributes['lj-cmd'] = 'LJCut'; }, + 'lj-raw': function(element) { + element.name = 'lj:raw'; + }, + 'lj-wishlist': function(element) { + element.name = 'lj:wishlist'; + }, 'lj-template': function(element){ + element.name = 'lj:template'; element.attributes.contentEditable = 'false'; element.children.length = 0; }, @@ -1181,7 +1191,7 @@ }, div: function(element){ if(element.attributes && element.attributes['class'] == 'ljcut'){ - var newElement = new CKEDITOR.htmlParser.element('lj-cut'); + var newElement = new CKEDITOR.htmlParser.element('lj:cut'); newElement.attributes['lj-cmd'] = 'LJCut'; newElement.children = element.children; return newElement; @@ -1257,8 +1267,18 @@ return new CKEDITOR.htmlParser.fragment.fromHtml(unescape(element.attributes.data)).children[0]; } }, - 'lj-template': function(element){ + 'lj:template': function(element){ + element.name = 'lj-template'; element.isOptionalClose = element.isEmpty = true; + }, + 'lj:cut': function(element){ + element.name = 'lj-cut' + }, + 'lj:raw': function(element) { + element.name = 'lj-raw'; + }, + 'lj:wishlist': function(element) { + element.name = 'lj-wishlist'; } }, attributes: {