I would like to embed a javascript-coded editor in dbman-generated pages. The editor is taken from http://sourceforge.net/projects/richtext/. Please take a look at the test page I've set up which lets you edit code (though the "post"-button in the editor is not yet functional): http://mailbox.univie.ac.at/...ellner/kelltest.html
The idea is: A user gets the value of one (and only one) field printed, say $rec{'maintext'}, from within dbman. There's an edit button printed next to the record, just like the one printed on the above test page. Clicking the button opens up the wsiwyg javascript editor with the value of $rec{'maintext'} appearing in the window. The user edits whatever they like, presses a submit button, and the modified record is added to the database. So essentially, the modify-routine of dbman is to be replaced by an embedded wsiwyg javascript editor.
I think the coding should involve the following steps:
1) dbman prints out a record (via sub html_record). the record is embedded in <form></form>-tags, the submit-button is actually an "edit"-button.
2) the edit-button calls a subroutine html_edit coded in html.pl, which prints out the necessary html-code, contains the javascript code for the editor, and prints the editor window embedded in a form with a submit-button that passes the modified data back to dbman to have it added to the database.
The tricky part is that I don't know anything about parameter handling in javascript. It seems to me that the form at stage 1) would have to pass on the field value of $rec{'maintext'} to the javascript editor called from html_edit, presumably via a hidden input field. But how does the editor access this value?
As it is, the javascript editor expects there to be a variable called "doc" to be submitted, whose value is then printed in the textarea window. This is how far my thinking gets me, and then my technical ignorance comes in ...
kellner
kellner
The idea is: A user gets the value of one (and only one) field printed, say $rec{'maintext'}, from within dbman. There's an edit button printed next to the record, just like the one printed on the above test page. Clicking the button opens up the wsiwyg javascript editor with the value of $rec{'maintext'} appearing in the window. The user edits whatever they like, presses a submit button, and the modified record is added to the database. So essentially, the modify-routine of dbman is to be replaced by an embedded wsiwyg javascript editor.
I think the coding should involve the following steps:
1) dbman prints out a record (via sub html_record). the record is embedded in <form></form>-tags, the submit-button is actually an "edit"-button.
2) the edit-button calls a subroutine html_edit coded in html.pl, which prints out the necessary html-code, contains the javascript code for the editor, and prints the editor window embedded in a form with a submit-button that passes the modified data back to dbman to have it added to the database.
The tricky part is that I don't know anything about parameter handling in javascript. It seems to me that the form at stage 1) would have to pass on the field value of $rec{'maintext'} to the javascript editor called from html_edit, presumably via a hidden input field. But how does the editor access this value?
As it is, the javascript editor expects there to be a variable called "doc" to be submitted, whose value is then printed in the textarea window. This is how far my thinking gets me, and then my technical ignorance comes in ...
kellner
kellner

