includes/clientside/tinymce/plugins/template/js/template.js
changeset 588 20484deb89cd
parent 543 dffcbfbc4e59
--- a/includes/clientside/tinymce/plugins/template/js/template.js	Thu Jun 26 18:05:42 2008 -0400
+++ b/includes/clientside/tinymce/plugins/template/js/template.js	Thu Jun 26 20:55:13 2008 -0400
@@ -24,6 +24,7 @@
 			sel.options[sel.options.length] = new Option(tsrc[x].title, tinyMCEPopup.editor.documentBaseURI.toAbsolute(tsrc[x].src));
 
 		this.resize();
+		this.tsrc = tsrc;
 	},
 
 	resize : function() {
@@ -53,13 +54,18 @@
 		});
 	},
 
-	selectTemplate : function(u) {
-		var d = window.frames['templatesrc'].document;
+	selectTemplate : function(u, ti) {
+		var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc;
 
 		if (!u)
 			return;
 
 		d.body.innerHTML = this.templateHTML = this.getFileContents(u);
+
+		for (x=0; x<tsrc.length; x++) {
+			if (tsrc[x].title == ti)
+				document.getElementById('tmpldesc').innerHTML = tsrc[x].description || '';
+		}
 	},
 
  	insert : function() {