| 1045 | | if (typeof f.__msh_prevOnSubmit == "undefined") f.__msh_prevOnSubmit = []; |
| 1046 | | if (typeof f.onsubmit == "function") |
| 1047 | | { |
| 1048 | | var funcref = f.onsubmit; |
| 1049 | | f.__msh_prevOnSubmit.push(funcref); |
| 1050 | | } |
| 1051 | | f.onsubmit = function() |
| 1052 | | { |
| 1053 | | editor._textArea.value = editor.outwardHtml(editor.getHTML()); |
| 1054 | | var a = this.__msh_prevOnSubmit; |
| 1055 | | // call previous submit methods if they were there. |
| 1056 | | var allOK = true; |
| 1057 | | for (var i = a.length; --i >= 0;) |
| 1058 | | { |
| 1059 | | if(a[i]() == false) |
| | 1045 | if (typeof f.__msh_prevOnSubmit == "undefined") |
| | 1046 | { |
| | 1047 | f.__msh_prevOnSubmit = []; |
| | 1048 | if (typeof f.onsubmit == "function") |
| | 1049 | { |
| | 1050 | var funcref = f.onsubmit; |
| | 1051 | f.__msh_prevOnSubmit.push(funcref); |
| | 1052 | f.onsubmit = null; |
| | 1053 | } |
| | 1054 | |
| | 1055 | f.onsubmit = function() |
| | 1056 | { |
| | 1057 | var a = this.__msh_prevOnSubmit; |
| | 1058 | // call previous submit methods if they were there. |
| | 1059 | var allOK = true; |
| | 1060 | for (var i = a.length; --i >= 0;) |
| 1061 | | allOK = false; |
| 1062 | | break; |
| 1063 | | } |
| 1064 | | } |
| 1065 | | return allOK; |
| 1066 | | }; |
| 1067 | | if (typeof f.onreset == "function") { |
| 1068 | | var funcref = f.onreset; |
| 1069 | | if (typeof f.__msh_prevOnReset == "undefined") { |
| 1070 | | f.__msh_prevOnReset = []; |
| 1071 | | } |
| 1072 | | f.__msh_prevOnReset.push(funcref); |
| 1073 | | } |
| 1074 | | f.onreset = function() { |
| 1075 | | editor.setHTML(editor._textArea.value); |
| 1076 | | editor.updateToolbar(); |
| 1077 | | var a = this.__msh_prevOnReset; |
| 1078 | | // call previous reset methods if they were there. |
| 1079 | | if (typeof a != "undefined") |
| 1080 | | { |
| | 1062 | // We want the handler to be a member of the form, not the array, so that "this" will work correctly |
| | 1063 | this.__msh_tempEventHandler = a[i]; |
| | 1064 | if(this.__msh_tempEventHandler() == false) |
| | 1065 | { |
| | 1066 | allOK = false; |
| | 1067 | break; |
| | 1068 | } |
| | 1069 | } |
| | 1070 | return allOK; |
| | 1071 | } |
| | 1072 | } |
| | 1073 | f.__msh_prevOnSubmit.push(function() {editor._textArea.value = editor.outwardHtml(editor.getHTML());}); |
| | 1074 | |
| | 1075 | if (typeof f.__msh_prevOnReset == "undefined") |
| | 1076 | { |
| | 1077 | f.__msh_prevOnReset = []; |
| | 1078 | if (typeof f.onreset == "function") |
| | 1079 | { |
| | 1080 | var funcref = f.onreset; |
| | 1081 | f.__msh_prevOnReset.push(funcref); |
| | 1082 | f.onreset = null; |
| | 1083 | } |
| | 1084 | |
| | 1085 | f.onreset = function() |
| | 1086 | { |
| | 1087 | var a = this.__msh_prevOnReset; |
| | 1088 | // call previous submit methods if they were there. |