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.5.1
[ckeditor.git]
/
_source
/
plugins
/
templates
/
dialogs
/
templates.js
diff --git
a/_source/plugins/templates/dialogs/templates.js
b/_source/plugins/templates/dialogs/templates.js
index
d3d78c6
..
d0bd148
100644
(file)
--- a/
_source/plugins/templates/dialogs/templates.js
+++ b/
_source/plugins/templates/dialogs/templates.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2011, 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
@@
-15,7
+15,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
// clear loading wait text.
\r
container.setHtml( '' );
\r
\r
// clear loading wait text.
\r
container.setHtml( '' );
\r
\r
- for ( var i = 0 ; i < templatesDefinitions.length ; i++ )
\r
+ for ( var i = 0, totalDefs = templatesDefinitions.length ; i < totalDefs ; i++ )
\r
{
\r
var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ),
\r
imagesPath = definition.imagesPath,
\r
{
\r
var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ),
\r
imagesPath = definition.imagesPath,
\r
@@
-44,7
+44,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';
\r
\r
if ( template.image && imagesPath )
\r
var html = '<table style="width:350px;" class="cke_tpl_preview" role="presentation"><tr>';
\r
\r
if ( template.image && imagesPath )
\r
- html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';
\r
+ html += '<td class="cke_tpl_preview_img"><img src="' + CKEDITOR.getUrl( imagesPath + template.image ) + '"' + ( CKEDITOR.env.ie6Compat ? ' onload="this.width=this.width"' : '' ) + ' alt="" title=""></td>';
\r
\r
html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
\r
\r
\r
html += '<td style="white-space:normal;"><span class="cke_tpl_title">' + template.title + '</span><br/>';
\r
\r
@@
-80,12
+80,12
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
// Place the cursor at the first editable place.
\r
var range = new CKEDITOR.dom.range( editor.document );
\r
range.moveToElementEditStart( editor.document.getBody() );
\r
// Place the cursor at the first editable place.
\r
var range = new CKEDITOR.dom.range( editor.document );
\r
range.moveToElementEditStart( editor.document.getBody() );
\r
- range.select( true );
\r
- setTimeout( function ()
\r
+ range.select( 1 );
\r
+ setTimeout( function()
\r
{
\r
editor.fire( 'saveSnapshot' );
\r
}, 0 );
\r
{
\r
editor.fire( 'saveSnapshot' );
\r
}, 0 );
\r
- } );
\r
+ });
\r
\r
editor.fire( 'saveSnapshot' );
\r
editor.setData( html );
\r
\r
editor.fire( 'saveSnapshot' );
\r
editor.setData( html );
\r
@@
-146,7
+146,9
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
var listContainer;
\r
\r
\r
var listContainer;
\r
\r
- var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber();
\r
+ var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(),
\r
+ lang = editor.lang.templates,
\r
+ config = editor.config;
\r
return {
\r
title :editor.lang.templates.title,
\r
\r
return {
\r
title :editor.lang.templates.title,
\r
\r
@@
-157,7
+159,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
[
\r
{
\r
id :'selectTpl',
\r
[
\r
{
\r
id :'selectTpl',
\r
- label : editor.lang.templates.title,
\r
+ label : lang.title,
\r
elements :
\r
[
\r
{
\r
elements :
\r
[
\r
{
\r
@@
-169,24
+171,24
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
type : 'html',
\r
html :
\r
'<span>' +
\r
type : 'html',
\r
html :
\r
'<span>' +
\r
- editor.lang.templates.selectPromptMsg +
\r
+ lang.selectPromptMsg +
\r
'</span>'
\r
},
\r
{
\r
'</span>'
\r
},
\r
{
\r
- id : "templatesList",
\r
+ id : 'templatesList',
\r
type : 'html',
\r
focus: true,
\r
html :
\r
'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId+ '">' +
\r
'<div class="cke_tpl_loading"><span></span></div>' +
\r
'</div>' +
\r
type : 'html',
\r
focus: true,
\r
html :
\r
'<div class="cke_tpl_list" tabIndex="-1" role="listbox" aria-labelledby="' + templateListLabelId+ '">' +
\r
'<div class="cke_tpl_loading"><span></span></div>' +
\r
'</div>' +
\r
- '<span class="cke_voice_label" id="' + templateListLabelId + '">' + editor.lang.templates.options+ '</span>'
\r
+ '<span class="cke_voice_label" id="' + templateListLabelId + '">' + lang.options+ '</span>'
\r
},
\r
{
\r
id : 'chkInsertOpt',
\r
type : 'checkbox',
\r
},
\r
{
\r
id : 'chkInsertOpt',
\r
type : 'checkbox',
\r
- label : editor.lang.templates.insertOption,
\r
- 'default' : editor.config.templates_replaceContent
\r
+ label : lang.insertOption,
\r
+ 'default' : config.templates_replaceContent
\r
}
\r
]
\r
}
\r
}
\r
]
\r
}
\r
@@
-201,9
+203,9
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
var templatesListField = this.getContentElement( 'selectTpl' , 'templatesList' );
\r
listContainer = templatesListField.getElement();
\r
\r
var templatesListField = this.getContentElement( 'selectTpl' , 'templatesList' );
\r
listContainer = templatesListField.getElement();
\r
\r
- CKEDITOR.loadTemplates( editor.config.templates_files, function()
\r
+ CKEDITOR.loadTemplates( config.templates_files, function()
\r
{
\r
{
\r
- var templates = editor.config.templates.split( ',' );
\r
+ var templates = ( config.templates || 'default' ).split( ',' );
\r
\r
if ( templates.length )
\r
{
\r
\r
if ( templates.length )
\r
{
\r
@@
-214,7
+216,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
{
\r
listContainer.setHtml(
\r
'<div class="cke_tpl_empty">' +
\r
{
\r
listContainer.setHtml(
\r
'<div class="cke_tpl_empty">' +
\r
- '<span>' + editor.lang.templates.emptyListMsg + '</span>' +
\r
+ '<span>' + lang.emptyListMsg + '</span>' +
\r
'</div>' );
\r
}
\r
});
\r
'</div>' );
\r
}
\r
});
\r
@@
-222,7
+224,7
@@
For licensing, see LICENSE.html or http://ckeditor.com/license
this._.element.on( 'keydown', keyNavigation );
\r
},
\r
\r
this._.element.on( 'keydown', keyNavigation );
\r
},
\r
\r
- onHide : function ()
\r
+ onHide : function()
\r
{
\r
this._.element.removeListener( 'keydown', keyNavigation );
\r
}
\r
{
\r
this._.element.removeListener( 'keydown', keyNavigation );
\r
}
\r