rfe 9198: Turn Survey Edit Section/Question/Answer fields into RTEs

This commit is contained in:
Yung Han Khoe 2009-01-06 13:23:52 +00:00
parent 3889c937bf
commit c47a6fb466
4 changed files with 26 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -8,8 +8,15 @@ Survey.ObjectTemplate = new function(){
document.getElementById('edit').innerHTML = html;
var myTextarea;
var handleSubmit = function(){
myTextarea.saveHTML();
this.submit();
}
var butts = [
{ text:"Submit", handler:function(){this.submit();}, isDefault:true },
{ text:"Submit", handler:handleSubmit, isDefault:true },
{ text:"Copy", handler:function(){document.getElementById('copy').value = 1; this.submit();}},
{ text:"Cancel", handler:function(){this.cancel();}},
{ text:"Delete", handler:function(){document.getElementById('delete').value = 1; this.submit();}}
@ -26,6 +33,24 @@ Survey.ObjectTemplate = new function(){
form.callback = Survey.Comm.callback;
form.render();
var textareaId = type+'Text';
var textarea = YAHOO.util.Dom.get(textareaId);
var height = YAHOO.util.Dom.getStyle(textarea,'height');
if (height == ''){
height = '300px';
}
var width = YAHOO.util.Dom.getStyle(textarea,'width');
if (width == ''){
width = '500px';
}
myTextarea = new YAHOO.widget.SimpleEditor(textareaId, {
height: height,
width: width,
dompath: false //Turns on the bar at the bottom
});
myTextarea.render();
form.show();
}
}();