Merge pull request #757 from redhog/aceEditEvent

Ace edit event as hook to modify changes as they happen
This commit is contained in:
John McLear 2012-06-04 06:17:09 -07:00
commit cc72868636
2 changed files with 19 additions and 4 deletions

View file

@ -239,10 +239,6 @@ require.setGlobalKeyPath("require");\n\
iframeHTML.push(doctype); iframeHTML.push(doctype);
iframeHTML.push("<html><head>"); iframeHTML.push("<html><head>");
hooks.callAll("aceInitInnerdocbodyHead", {
iframeHTML: iframeHTML
});
// calls to these functions ($$INCLUDE_...) are replaced when this file is processed // calls to these functions ($$INCLUDE_...) are replaced when this file is processed
// and compressed, putting the compressed code from the named file directly into the // and compressed, putting the compressed code from the named file directly into the
// source here. // source here.
@ -277,6 +273,11 @@ require.setGlobalKeyPath("require");\n\
iframeHTML.push('<\/script>'); iframeHTML.push('<\/script>');
iframeHTML.push('<style type="text/css" title="dynamicsyntax"></style>'); iframeHTML.push('<style type="text/css" title="dynamicsyntax"></style>');
hooks.callAll("aceInitInnerdocbodyHead", {
iframeHTML: iframeHTML
});
iframeHTML.push('</head><body id="innerdocbody" class="syntax" spellcheck="false">&nbsp;</body></html>'); iframeHTML.push('</head><body id="innerdocbody" class="syntax" spellcheck="false">&nbsp;</body></html>');
// Expose myself to global for my child frame. // Expose myself to global for my child frame.

View file

@ -341,6 +341,11 @@ function Ace2Inner(){
return rep; return rep;
}; };
editorInfo.ace_getAuthor = function()
{
return thisAuthor;
}
var currentCallStack = null; var currentCallStack = null;
function inCallStack(type, action) function inCallStack(type, action)
@ -439,6 +444,14 @@ function Ace2Inner(){
try try
{ {
result = action(); result = action();
hooks.callAll('aceEditEvent', {
callstack: currentCallStack,
editorInfo: editorInfo,
rep: rep,
documentAttributeManager: documentAttributeManager
});
//console.log("Just did action for: "+type); //console.log("Just did action for: "+type);
cleanExit = true; cleanExit = true;
} }
@ -523,6 +536,7 @@ function Ace2Inner(){
return rep.lines.atOffset(charOffset).key; return rep.lines.atOffset(charOffset).key;
} }
function dispose() function dispose()
{ {
disposed = true; disposed = true;