X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Ftemplates%2Fdialogs%2Ftemplates.js;h=d0bd148eaba984418c77a6faa17eac8959cc7179;hb=48b1db88210b4160dce439c6e3e32e14af8c106b;hp=af04e5548b8e416cb8adce300fe6bc1943d58e6b;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git diff --git a/_source/plugins/templates/dialogs/templates.js b/_source/plugins/templates/dialogs/templates.js index af04e55..d0bd148 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 = '
'; + 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,6 +146,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var listContainer; + var templateListLabelId = 'cke_tpl_list_label_' + CKEDITOR.tools.getNextNumber(), + lang = editor.lang.templates, + config = editor.config; return { title :editor.lang.templates.title, @@ -156,7 +159,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license [ { id :'selectTpl', - label : editor.lang.templates.title, + label : lang.title, elements : [ { @@ -168,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
}
]
}
@@ -200,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 )
{
@@ -213,7 +216,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
{
listContainer.setHtml(
'' +
' ' +
- '' + editor.lang.templates.emptyListMsg + '' +
+ '' + lang.emptyListMsg + '' +
' ' );
}
});
@@ -221,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 );
}
|