Auxilary class for DL Suite: Comments.
| [JavaScript] DLComments | Auxilary class for DL Suite: Comments. |
| Author | Duc Tri Le <cmsmadesimple---at---email.tiger-inc.com> |
| License | This class is released under the GNU General Public License. |
| Functions | |
| copyData | Copy the inner HTML of the original element to a textarea (creating it if it doesn’t already exist. |
| restoreData | Copy the value of the field back to the original element while keeping the field in the document. |
| serverResponse | Process the server response. |
| showHide | Toggle the display of the given data and update the given link to reflect the new action. |
| submitForm | Submit a form to the server. |
copyData: function( field, original, type, name, id )
Copy the inner HTML of the original element to a textarea (creating it if it doesn’t already exist. This will hide the original element and restore it when the textarea loses focus.
| field | (string) The type of field to create. |
| original | (object) The DOM element in which the inner HTML will be retrieved from. |
| type | (string) The type of settings: approval|modify. |
| name | (string) The name of the input field. |
| id | (string) The ID. |
restoreData: function( original, field_span, field )
Copy the value of the field back to the original element while keeping the field in the document.
| original | (object) The original DOM element. |
| field_span | (object) The span that contains the field. |
| field | (object) The field from which the value is to be retrieved. |
serverResponse: function( form, message_area, html_area, transport )
Process the server response.
| form | (object) The form that began the request. |
| message_area | (object) The DOM element that will hold the message returned by the request. |
| html_area | (object) The DOM element that will hold the HTML returned by the request. |
| transport | (object) The AJAX transport. |
showHide: function( link, data )
Toggle the display of the given data and update the given link to reflect the new action.
| link | (object) The link that will toggle the display of the data. |
| data | (object) An object containing various information about what to toggle. It includes the id of the element to hide or show, and the text of the link when that element is hidden and when it is visible. |
Copy the inner HTML of the original element to a textarea (creating it if it doesn’t already exist.
copyData: function( field, original, type, name, id )
Copy the value of the field back to the original element while keeping the field in the document.
restoreData: function( original, field_span, field )
Process the server response.
serverResponse: function( form, message_area, html_area, transport )
Toggle the display of the given data and update the given link to reflect the new action.
showHide: function( link, data )
Submit a form to the server.
submitForm: function( form, type )