public/ckeditor/4.4dev/plugins/templates/dialogs/templates.js
function insertTemplate( html ) {
			var dialog = CKEDITOR.dialog.getCurrent(),
				isReplace = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' );

			if ( isReplace ) {
				editor.fire( 'saveSnapshot' );
				// Everything should happen after the document is loaded (#4073).
				editor.setData( html, function() {
					dialog.hide();

					// Place the cursor at the first editable place.
					var range = editor.createRange();
					range.moveToElementEditStart( editor.editable() );
					range.select();
					setTimeout( function() {
						editor.fire( 'saveSnapshot' );
					}, 0 );

				} );
			} else {
				editor.insertHtml( html );
				dialog.hide();
			}
		}
function insertTemplate( html ) {
			var dialog = CKEDITOR.dialog.getCurrent(),
				isReplace = dialog.getValueOf( 'selectTpl', 'chkInsertOpt' );

			if ( isReplace ) {
				editor.fire( 'saveSnapshot' );
				// Everything should happen after the document is loaded (#4073).
				editor.setData( html, function() {
					dialog.hide();

					// Place the cursor at the first editable place.
					var range = editor.createRange();
					range.moveToElementEditStart( editor.editable() );
					range.select();
					setTimeout( function() {
						editor.fire( 'saveSnapshot' );
					}, 0 );

				} );
			} else {
				editor.insertHtml( html );
				dialog.hide();
			}
		}
function insertTemplate ( html ) { var dialog = CKEDITOR . dialog . getCurrent ( ) , isReplace = dialog . getValueOf ( 'selectTpl' , 'chkInsertOpt' ) ; if ( isReplace ) { editor . fire ( 'saveSnapshot' ) ; // Everything should happen after the document is loaded (#4073).
 editor . setData ( html , function ( ) { dialog . hide ( ) ; // Place the cursor at the first editable place.
 var range = editor . createRange ( ) ; range . moveToElementEditStart ( editor . editable ( ) ) ; range . select ( ) ; setTimeout ( function ( ) { editor . fire ( 'saveSnapshot' ) ; } , 0 ) ; } ) ; } else { editor . insertHtml ( html ) ; dialog . hide ( ) ; } }
Insert the specified template content into editor. @param {Number} index
Insert the specified template content into editor .