X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Flink%2Fplugin.js;h=e5b7044ec8b8a0ee53913db1af9fe931507789d8;hb=refs%2Ftags%2Fv3.5.3;hp=3cdc6fb8e699a428ae224c3d437019068ff49012;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7;p=ckeditor.git diff --git a/_source/plugins/link/plugin.js b/_source/plugins/link/plugin.js index 3cdc6fb..e5b7044 100644 --- a/_source/plugins/link/plugin.js +++ b/_source/plugins/link/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -30,6 +30,7 @@ CKEDITOR.plugins.add( 'link', CKEDITOR.dialog.add( 'anchor', this.path + 'dialogs/anchor.js' ); // Add the CSS styles for anchor placeholders. + var side = editor.lang.dir == 'rtl' ? 'right' : 'left'; editor.addCss( 'img.cke_anchor' + '{' + @@ -43,10 +44,10 @@ CKEDITOR.plugins.add( 'link', 'a.cke_anchor' + '{' + 'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/anchor.gif' ) + ');' + - 'background-position: 0 center;' + + 'background-position: ' + side + ' center;' + 'background-repeat: no-repeat;' + 'border: 1px solid #a9a9a9;' + - 'padding-left: 18px;' + + 'padding-' + side + ': 18px;' + '}' ); @@ -69,10 +70,13 @@ CKEDITOR.plugins.add( 'link', { var element = CKEDITOR.plugins.link.getSelectedLink( editor ) || evt.data.element; - if ( element.is( 'a' ) ) - evt.data.dialog = ( element.getAttribute( 'name' ) && !element.getAttribute( 'href' ) ) ? 'anchor' : 'link'; - else if ( element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' ) - evt.data.dialog = 'anchor'; + if ( !element.isReadOnly() ) + { + if ( element.is( 'a' ) ) + evt.data.dialog = ( element.getAttribute( 'name' ) && !element.getAttribute( 'href' ) ) ? 'anchor' : 'link'; + else if ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'anchor' ) + evt.data.dialog = 'anchor'; + } }); // If the "menu" plugin is loaded, register the menu items. @@ -113,7 +117,7 @@ CKEDITOR.plugins.add( 'link', if ( !element || element.isReadOnly() ) return null; - var isAnchor = ( element.is( 'img' ) && element.getAttribute( '_cke_real_element_type' ) == 'anchor' ); + var isAnchor = ( element.is( 'img' ) && element.data( 'cke-real-element-type' ) == 'anchor' ); if ( !isAnchor ) {