Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.4b
[ckeditor.git]
/
_source
/
core
/
ui.js
diff --git
a/_source/core/ui.js
b/_source/core/ui.js
index
1d152e2
..
0a66c2e
100644
(file)
--- a/
_source/core/ui.js
+++ b/
_source/core/ui.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-21,7
+21,8
@@
CKEDITOR.ui = function( editor )
this._ =
\r
{
\r
handlers : {},
\r
this._ =
\r
{
\r
handlers : {},
\r
- items : {}
\r
+ items : {},
\r
+ editor : editor
\r
};
\r
\r
return this;
\r
};
\r
\r
return this;
\r
@@
-51,6
+52,8
@@
CKEDITOR.ui.prototype =
this._.items[ name ] =
\r
{
\r
type : type,
\r
this._.items[ name ] =
\r
{
\r
type : type,
\r
+ // The name of {@link CKEDITOR.command} which associate with this UI.
\r
+ command : definition.command || null,
\r
args : Array.prototype.slice.call( arguments, 2 )
\r
};
\r
},
\r
args : Array.prototype.slice.call( arguments, 2 )
\r
};
\r
},
\r
@@
-63,9
+66,16
@@
CKEDITOR.ui.prototype =
create : function( name )
\r
{
\r
var item = this._.items[ name ],
\r
create : function( name )
\r
{
\r
var item = this._.items[ name ],
\r
- handler = item && this._.handlers[ item.type ];
\r
+ handler = item && this._.handlers[ item.type ],
\r
+ command = item && item.command && this._.editor.getCommand( item.command );
\r
\r
\r
- return handler && handler.create.apply( this, item.args );
\r
+ var result = handler && handler.create.apply( this, item.args );
\r
+
\r
+ // Add reference inside command object.
\r
+ if ( command )
\r
+ command.uiItems.push( result );
\r
+
\r
+ return result;
\r
},
\r
\r
/**
\r
},
\r
\r
/**
\r