Skip to content

Commit

Permalink
#2971 : Introduced the Format combo and the panel and combo systems.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.ckeditor.com/CKEditor/trunk@3113 da63caf2-3823-0410-a1e8-d69ccee00dfb
  • Loading branch information
fredck committed Feb 27, 2009
1 parent df0935c commit cca4a05
Show file tree
Hide file tree
Showing 22 changed files with 1,697 additions and 295 deletions.
2 changes: 1 addition & 1 deletion _source/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ CKEDITOR.config = {
* config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';
*/

plugins: 'basicstyles,blockquote,button,clipboard,elementspath,find,flash,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',
plugins: 'basicstyles,blockquote,button,clipboard,elementspath,find,flash,format,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,newpage,pagebreak,pastefromword,pastetext,preview,print,removeformat,smiley,showblocks,sourcearea,table,specialchar,tab,templates,toolbar,undo,wysiwygarea',

/**
* The theme to be used to build the UI.
Expand Down
6 changes: 5 additions & 1 deletion _source/core/dom/domobject.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ CKEDITOR.dom.domObject.prototype = (function() {
* element.setCustomData( 'hasCustomData', true );
*/
domObjectProto.setCustomData = function( key, value ) {
var expandoNumber = this.$._cke_expando || ( this.$._cke_expando = CKEDITOR.tools.getNextNumber() ),
var expandoNumber = this.getUniqueId(),
dataSlot = customData[ expandoNumber ] || ( customData[ expandoNumber ] = {} );

dataSlot[ key ] = value;
Expand Down Expand Up @@ -170,6 +170,10 @@ CKEDITOR.dom.domObject.prototype = (function() {
return retval || null;
};

domObjectProto.getUniqueId = function() {
return this.$._cke_expando || ( this.$._cke_expando = CKEDITOR.tools.getNextNumber() );
};

// Implement CKEDITOR.event.
CKEDITOR.event.implementOn( domObjectProto );

Expand Down
11 changes: 11 additions & 0 deletions _source/core/dom/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
}
},

hasClass: function( className ) {
var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', '' );
return regex.test( this.$.className );
},

/**
* Append a node as a child of this element.
* @param {CKEDITOR.dom.node|String} node The node or element name to be
Expand Down Expand Up @@ -180,6 +185,12 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
return node;
},

appendHtml: function( html ) {
var temp = new CKEDITOR.dom.element( 'div', this.getDocument() );
temp.setHtml( html );
temp.moveChildren( this );
},

/**
* Append text to this element.
* @param {String} text The text to be appended.
Expand Down
18 changes: 14 additions & 4 deletions _source/core/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
if ( instanceConfig )
CKEDITOR.tools.extend( editor.config, instanceConfig, true );

// Fire the "configLoaded" event.
editor.fireOnce( 'configLoaded' );

loadLang( editor );
onConfigLoaded( editor );
});

// The instance config may override the customConfig setting to avoid
Expand All @@ -87,6 +84,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license

// ##### END: Config Privates

var onConfigLoaded = function( editor ) {
// Set config related properties.

editor.skinPath = CKEDITOR.getUrl( '_source/' + // %REMOVE_LINE%
'skins/' + editor.config.skin + '/' );

// Fire the "configLoaded" event.
editor.fireOnce( 'configLoaded' );

// Load language file.
loadLang( editor );
};

var loadLang = function( editor ) {
CKEDITOR.lang.load( editor.config.defaultLanguage, editor.config.autoLanguage, function( languageCode, lang ) {
editor.langCode = languageCode;
Expand Down
16 changes: 14 additions & 2 deletions _source/core/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@ CKEDITOR.plugins.load = CKEDITOR.tools.override( CKEDITOR.plugins.load, function

if ( requiredPlugins.length )
loadPlugins.call( this, requiredPlugins );
else if ( callback )
callback.call( scope || window, allPlugins );
else {
// Call the "onLoad" function for all plugins.
for ( pluginName in allPlugins ) {
plugin = allPlugins[ pluginName ];
if ( plugin.onLoad && !plugin.onLoad._called ) {
plugin.onLoad();
plugin.onLoad._called = 1;
}
}

// Call the callback.
if ( callback )
callback.call( scope || window, allPlugins );
}
}, this );

};
Expand Down
Loading

0 comments on commit cca4a05

Please sign in to comment.