@cipa : thanks for that test. I hadn’t put in the alert and was expecting to see the code inserted near the top. Instead, it shows up further along in the page source.
What ends up working (as a first pass, PoC sorta thing) is this :
// Handle event
global $modx;
$e = &$modx->Event;
switch ($e->name)
{
//Event triggers :
//OnBeforeManagerPageInit,OnChunkFormRender,OnDocFormRender,
//OnSnipFormRender,OnTVFormRender,OnTempFormRender
default :
echo '<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>';
break;
}
I used that structure to allow for some possible customization based on context. But looking into it a bit further, it’s unclear to me if the options I really want are available (e.g. table editing, "raw" text mode). Also, I’d need to figure out the correct way to pass customization parameters. And if the ones I want aren’t available to begin with, then this is a deadend.
@BobRay - yes, I did try that. But it only gets inserted if you are not in the manager. If this little editor could do what I wanted, then I think you are right, that would be the approach to try to use on the front-end.
Thanks to both of you for your help,
Matt