X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=eb86b65ed4aa03063d4c954755af04a3e7fd6004;hp=d3d78c670235f7dd6adc3058cda8cdd2b0012bfb;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index d3d78c6..eb86b65 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -15,7 +15,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // clear loading wait text. container.setHtml( '' ); - for ( var i = 0 ; i < templatesDefinitions.length ; i++ ) + for ( var i = 0, totalDefs = templatesDefinitions.length ; i < totalDefs ; i++ ) { var definition = CKEDITOR.getTemplates( templatesDefinitions[ i ] ), imagesPath = definition.imagesPath, @@ -44,7 +44,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var html = '
'; + html += ' | '; html += ' | ' + template.title + ' '; @@ -80,12 +80,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Place the cursor at the first editable place. var range = new CKEDITOR.dom.range( editor.document ); range.moveToElementEditStart( editor.document.getBody() ); - range.select( true ); - setTimeout( function () + range.select( 1 ); + setTimeout( function() { editor.fire( 'saveSnapshot' ); }, 0 ); - } ); + }); editor.fire( 'saveSnapshot' ); editor.setData( html ); @@ -146,7 +146,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var listContainer; - var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(); + var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(), + lang = editor.lang.templates, + config = editor.config; return { title :editor.lang.templates.title, @@ -157,7 +159,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license [ { id :'selectTpl', - label : editor.lang.templates.title, + label : lang.title, elements : [ { @@ -169,24 +171,24 @@ For licensing, see LICENSE.html or http://ckeditor.com/license type : 'html', html : '' + - editor.lang.templates.selectPromptMsg + + lang.selectPromptMsg + '' }, { - id : "templatesList", + id : 'templatesList', type : 'html', focus: true, html : ' ' +
' ' +
- '' + editor.lang.templates.options+ ''
+ '' + lang.options+ ''
},
{
id : 'chkInsertOpt',
type : 'checkbox',
- label : editor.lang.templates.insertOption,
- 'default' : editor.config.templates_replaceContent
+ label : lang.insertOption,
+ 'default' : config.templates_replaceContent
}
]
}
@@ -201,9 +203,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
var templatesListField = this.getContentElement( 'selectTpl' , 'templatesList' );
listContainer = templatesListField.getElement();
- CKEDITOR.loadTemplates( editor.config.templates_files, function()
+ CKEDITOR.loadTemplates( config.templates_files, function()
{
- var templates = editor.config.templates.split( ',' );
+ var templates = ( config.templates || 'default' ).split( ',' );
if ( templates.length )
{
@@ -214,7 +216,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
{
listContainer.setHtml(
'' +
' ' +
- '' + editor.lang.templates.emptyListMsg + '' +
+ '' + lang.emptyListMsg + '' +
' ' );
}
});
@@ -222,7 +224,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
this._.element.on( 'keydown', keyNavigation );
},
- onHide : function ()
+ onHide : function()
{
this._.element.removeListener( 'keydown', keyNavigation );
}
|