X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=inline;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=2c895fa3af8dc6b718d1b7818d6c269facb41636;hb=refs%2Ftags%2Fv3.6.2;hp=d3d78c670235f7dd6adc3058cda8cdd2b0012bfb;hpb=8665a7c6c60586526e32e8941fe2896739b6ebfb;p=ckeditor.git diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index d3d78c6..2c895fa 100644 --- a/_source/plugins/templates/dialogs/templates.js +++ b/_source/plugins/templates/dialogs/templates.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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 = '
' + 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 : [ { @@ -166,27 +168,28 @@ For licensing, see LICENSE.html or http://ckeditor.com/license children : [ { + id : 'selectTplText', 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 +204,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 +217,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
{
listContainer.setHtml(
'' +
' ' +
- '' + editor.lang.templates.emptyListMsg + '' +
+ '' + lang.emptyListMsg + '' +
' ' );
}
});
@@ -222,7 +225,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 );
}
|