Skip to content

Commit

Permalink
Updated to CKEditor 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kanduvisla committed Aug 16, 2011
1 parent 06d4b07 commit 1fe1a65
Show file tree
Hide file tree
Showing 13 changed files with 454 additions and 306 deletions.
6 changes: 3 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CKEditor for Symphony CMS

* Version: 1.2.1
* CKEditor version: 3.5.3
* Date: 13-04-2011
* Version: 1.2.2
* CKEditor version: 3.6.1
* Date: 16-08-2011
* Authors: Tony Arnold <[email protected]>, Giel Berkers <[email protected]>
* Repository: <http://github.com/kanduvisla/symphony-ckeditor/>
* Requirements: Symphony CMS 2.2 or higher <http://github.com/symphony/symphony-2/tree/master>
Expand Down
4 changes: 2 additions & 2 deletions extension.driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
public function about() {
return array(
'name' => 'Text Formatter: CKEditor',
'version' => '1.2.1',
'release-date' => '2011-04-13',
'version' => '1.2.2',
'release-date' => '2011-08-16',
'author' => array(
'name' => '<a href="http://thecocoabots.com">Tony Arnold</a>, <a href="http://gielberkers.com">Giel Berkers</a>'
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ckeditor/.htaccess
Original file line number Diff line number Diff line change
@@ -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
#

Expand Down
274 changes: 139 additions & 135 deletions lib/ckeditor/ckeditor.js

Large diffs are not rendered by default.

26 changes: 3 additions & 23 deletions lib/ckeditor/contents.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,10 @@ body
background-color: #fff;
}

/* preserved spaces for rtl list item bullets. (#6249)*/
ol,ul,dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right:0px;
/* preserved spaces for rtl list item bullets. (#6249)*/
padding-right:40px;
}

html
{
/* #3658: [IE6] Editor document has horizontal scrollbar on long lines
To prevent this misbehavior, we show the scrollbar always */
_overflow-y: scroll;
/* #6341: The text cursor must be set on the editor area. */
cursor: text;
/* #6632: Avoid having "text" shape of cursor in IE7 scrollbars.*/
*cursor:auto;
}

img:-moz-broken
{
-moz-force-broken-image-icon : 1;
width : 24px;
height : 24px;
}
img, input, textarea
{
cursor: default;
}
2 changes: 1 addition & 1 deletion lib/ckeditor/lang/en.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions lib/ckeditor/plugins/image/dialogs/image.js

Large diffs are not rendered by default.

123 changes: 84 additions & 39 deletions lib/ckeditor/plugins/link/dialogs/anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,68 +6,113 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
CKEDITOR.dialog.add( 'anchor', function( editor )
{
// Function called in onShow to load selected element.
var loadElements = function( editor, selection, element )
var loadElements = function( element )
{
this.editMode = true;
this.editObj = element;
this._.selectedElement = element;

var attributeValue = this.editObj.getAttribute( 'name' );
if ( attributeValue )
this.setValueOf( 'info','txtName', attributeValue );
else
this.setValueOf( 'info','txtName', "" );
var attributeValue = element.data( 'cke-saved-name' );
this.setValueOf( 'info','txtName', attributeValue || '' );
};

function createFakeAnchor( editor, anchor )
{
return editor.createFakeElement( anchor, 'cke_anchor', 'anchor' );
}

return {
title : editor.lang.anchor.title,
minWidth : 300,
minHeight : 60,
onOk : function()
{
// Always create a new anchor, because of IE BUG.
var name = this.getValueOf( 'info', 'txtName' ),
element = CKEDITOR.env.ie && !( CKEDITOR.document.$.documentMode >= 8 ) ?
editor.document.createElement( '<a name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) :
editor.document.createElement( 'a' );
var name = this.getValueOf( 'info', 'txtName' );
var attributes =
{
name : name,
'data-cke-saved-name' : name
};

// Move contents and attributes of old anchor to new anchor.
if ( this.editMode )
if ( this._.selectedElement )
{
this.editObj.copyAttributes( element, { name : 1 } );
this.editObj.moveChildren( element );
if ( this._.selectedElement.data( 'cke-realelement' ) )
{
var newFake = createFakeAnchor( editor, editor.document.createElement( 'a', { attributes: attributes } ) );
newFake.replace( this._.selectedElement );
}
else
this._.selectedElement.setAttributes( attributes );
}

// Set name.
element.data( 'cke-saved-name', false );
element.setAttribute( 'name', name );

// Insert a new anchor.
var fakeElement = editor.createFakeElement( element, 'cke_anchor', 'anchor' );
if ( !this.editMode )
editor.insertElement( fakeElement );
else
{
fakeElement.replace( this.fakeObj );
editor.getSelection().selectElement( fakeElement );
var sel = editor.getSelection(),
range = sel && sel.getRanges()[ 0 ];

// Empty anchor
if ( range.collapsed )
{
if ( CKEDITOR.plugins.link.synAnchorSelector )
attributes[ 'class' ] = 'cke_anchor_empty';

if ( CKEDITOR.plugins.link.emptyAnchorFix )
{
attributes[ 'contenteditable' ] = 'false';
attributes[ 'data-cke-editable' ] = 1;
}

var anchor = editor.document.createElement( 'a', { attributes: attributes } );

// Transform the anchor into a fake element for browsers that need it.
if ( CKEDITOR.plugins.link.fakeAnchor )
anchor = createFakeAnchor( editor, anchor );

range.insertNode( anchor );
}
else
{
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
attributes['class'] = 'cke_anchor';

// Apply style.
var style = new CKEDITOR.style( { element : 'a', attributes : attributes } );
style.type = CKEDITOR.STYLE_INLINE;
style.apply( editor.document );
}
}
},

return true;
onHide : function()
{
delete this._.selectedElement;
},

onShow : function()
{
this.editObj = false;
this.fakeObj = false;
this.editMode = false;
var selection = editor.getSelection(),
fullySelected = selection.getSelectedElement(),
partialSelected;

var selection = editor.getSelection();
var element = selection.getSelectedElement();
if ( element && element.data( 'cke-real-element-type' ) && element.data( 'cke-real-element-type' ) == 'anchor' )
// Detect the anchor under selection.
if ( fullySelected )
{
this.fakeObj = element;
element = editor.restoreRealElement( this.fakeObj );
loadElements.apply( this, [ editor, selection, element ] );
selection.selectElement( this.fakeObj );
if ( CKEDITOR.plugins.link.fakeAnchor )
{
var realElement = CKEDITOR.plugins.link.tryRestoreFakeAnchor( editor, fullySelected );
realElement && loadElements.call( this, realElement );
this._.selectedElement = fullySelected;
}
else if ( fullySelected.is( 'a' ) && fullySelected.hasAttribute( 'name' ) )
loadElements.call( this, fullySelected );
}
else
{
partialSelected = CKEDITOR.plugins.link.getSelectedLink( editor );
if ( partialSelected )
{
loadElements.call( this, partialSelected );
selection.selectElement( partialSelected );
}
}

this.getContentElement( 'info', 'txtName' ).focus();
},
contents : [
Expand Down
Loading

0 comments on commit 1fe1a65

Please sign in to comment.