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.6.6
[ckeditor.git]
/
_source
/
plugins
/
placeholder
/
plugin.js
diff --git
a/_source/plugins/placeholder/plugin.js
b/_source/plugins/placeholder/plugin.js
index
5ea9b24
..
f7d562d
100644
(file)
--- a/
_source/plugins/placeholder/plugin.js
+++ b/
_source/plugins/placeholder/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2013, 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
@@
-14,7
+14,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
CKEDITOR.plugins.add( 'placeholder',
\r
{
\r
requires : [ 'dialog' ],
\r
CKEDITOR.plugins.add( 'placeholder',
\r
{
\r
requires : [ 'dialog' ],
\r
- lang : [ 'en' ],
\r
+ lang : [ 'bg', 'cs', 'cy', 'da', 'de', 'el', 'en', 'eo', 'et', 'fa', 'fi', 'fr', 'he', 'hr', 'it', 'ku', 'nb', 'nl', 'no', 'pl', 'pt-br', 'sk', 'tr', 'ug', 'uk', 'vi', 'zh-cn' ],
\r
init : function( editor )
\r
{
\r
var lang = editor.lang.placeholder;
\r
init : function( editor )
\r
{
\r
var lang = editor.lang.placeholder;
\r
@@
-58,8
+58,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
editor.on( 'doubleclick', function( evt )
\r
{
\r
\r
editor.on( 'doubleclick', function( evt )
\r
{
\r
- var element = evt.data.element;
\r
- if ( element.data( 'cke-placeholder' ) )
\r
+ if ( CKEDITOR.plugins.placeholder.getSelectedPlaceHoder( editor ) )
\r
evt.data.dialog = 'editplaceholder';
\r
});
\r
\r
evt.data.dialog = 'editplaceholder';
\r
});
\r
\r
@@
-156,5
+155,17
@@
CKEDITOR.plugins.placeholder =
}
\r
else
\r
editor.insertElement( element );
\r
}
\r
else
\r
editor.insertElement( element );
\r
+
\r
+ return null;
\r
+ },
\r
+
\r
+ getSelectedPlaceHoder : function( editor )
\r
+ {
\r
+ var range = editor.getSelection().getRanges()[ 0 ];
\r
+ range.shrink( CKEDITOR.SHRINK_TEXT );
\r
+ var node = range.startContainer;
\r
+ while( node && !( node.type == CKEDITOR.NODE_ELEMENT && node.data( 'cke-placeholder' ) ) )
\r
+ node = node.getParent();
\r
+ return node;
\r
}
\r
};
\r
}
\r
};
\r