| 1919 | | |
| 1920 | | editor.whenDocReady( |
| 1921 | | function() { |
| 1922 | | // if we have multiple editors some bug in Mozilla makes some lose editing ability |
| 1923 | | HTMLArea._addEvents |
| 1924 | | ( |
| 1925 | | doc, |
| 1926 | | ["mousedown"], |
| 1927 | | function() { editor.activateEditor(); return true; } |
| 1928 | | ); |
| 1929 | | |
| 1930 | | |
| 1931 | | // intercept some events; for updating the toolbar & keyboard handlers |
| 1932 | | HTMLArea._addEvents |
| 1933 | | (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"], |
| 1934 | | function (event) { |
| 1935 | | return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event); |
| 1936 | | }); |
| 1937 | | |
| 1938 | | // check if any plugins have registered refresh handlers |
| 1939 | | for (var i in editor.plugins) { |
| 1940 | | var plugin = editor.plugins[i].instance; |
| 1941 | | HTMLArea.refreshPlugin(plugin); |
| 1942 | | } |
| 1943 | | |
| 1944 | | // specific editor initialization |
| 1945 | | if(typeof editor._onGenerate == "function") { |
| 1946 | | editor._onGenerate(); |
| 1947 | | } |
| 1948 | | } |
| 1949 | | ); |
| 1950 | | |
| | 1919 | |
| | 1920 | this.setEditorEvents(); |
| | 2024 | HTMLArea.prototype.setEditorEvents = function() { |
| | 2025 | var editor=this; |
| | 2026 | var doc=this._doc; |
| | 2027 | editor.whenDocReady( |
| | 2028 | function() { |
| | 2029 | // if we have multiple editors some bug in Mozilla makes some lose editing ability |
| | 2030 | HTMLArea._addEvents |
| | 2031 | ( |
| | 2032 | doc, |
| | 2033 | ["mousedown"], |
| | 2034 | function() { editor.activateEditor(); return true; } |
| | 2035 | ); |
| | 2036 | |
| | 2037 | // intercept some events; for updating the toolbar & keyboard handlers |
| | 2038 | HTMLArea._addEvents |
| | 2039 | (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"], |
| | 2040 | function (event) { |
| | 2041 | return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event); |
| | 2042 | }); |
| | 2043 | |
| | 2044 | // check if any plugins have registered refresh handlers |
| | 2045 | for (var i in editor.plugins) { |
| | 2046 | var plugin = editor.plugins[i].instance; |
| | 2047 | HTMLArea.refreshPlugin(plugin); |
| | 2048 | }; |
| | 2049 | |
| | 2050 | // specific editor initialization |
| | 2051 | if(typeof editor._onGenerate == "function") { |
| | 2052 | editor._onGenerate(); |
| | 2053 | } |
| | 2054 | } |
| | 2055 | ); |
| | 2056 | }; |
| | 2057 | |