To make it work follow these steps:
1. Download EditArea and unpack it on your local HD, you'll see a folder with 3 folders in it: docs, edit_area and exemples. Upload only the edit_area folder (with the .js files in it) into your /media/ folder.
2. Edit the /manager/includes/header.inc.php file and modify this part of the code:
<script type="text/javascript" language="JavaScript1.5" href="./media/script/ieemu.js"></script> <script type="text/javascript" href="./media/script/domtab.js"></script>
Into:
<script type="text/javascript" language="JavaScript1.5" href="./media/script/ieemu.js"></script> <script type="text/javascript" href="./media/script/domtab.js"></script> <script language="javascript" type="text/javascript" src="./media/edit_area/edit_area_full.js"></script>
3. Next edit the /manager/actions/dynamic/mutate_snippet.dynamic.action.php file and modify this part of the code:
<script type="text/javascript">
function deletedocument() {
if(confirm("<?php echo $_lang['confirm_delete_snippet']; ?>")==true) {
document.location.href="index.php?id=" + document.mutate.id.value + "&a=25";
}
}
</script>
Into:
<script type="text/javascript">
function deletedocument() {
if(confirm("<?php echo $_lang['confirm_delete_snippet']; ?>")==true) {
document.location.href="index.php?id=" + document.mutate.id.value + "&a=25";
}
}
</script>
<script language="javascript" type="text/javascript">
editAreaLoader.init({
id : "snippet_editor" // textarea id
,syntax: "php" // syntax to be uses for highgliting
,start_highlight: true // to display with highlight mode on start-up
,allow_toggle: false
});
</script>
4. And in the same file modify this part of the code:
<div class="subTitle">
<span class="floatLeft">
<img src="media/images/_tx_.gif" width="1" height="5"><br />
<a href="#" onClick="documentDirty=false; document.mutate.submit(); saveWait('mutate');" class="doSomethingButton"><?php echo $_lang['save']; ?></a>
Into:
<div class="subTitle">
<span class="floatLeft">
<img src="media/images/_tx_.gif" width="1" height="5"><br />
<a href="#" onClick="documentDirty=false; document.mutate.post.value=editAreaLoader.getValue('post'); document.mutate.submit(); saveWait('mutate');" class="doSomethingButton"><?php echo $_lang['save']; ?></a>
5. And also in the same file modify this part of the code:
<textarea name="post" style="width:100%; height: 370px;" onChange='documentDirty=true;'>
Into:
<textarea id="snippet_editor" name="post" style="width:100%; height: 370px;" onChange='documentDirty=true;'>
6. Now you can go edit a snippet and if everything worked you'll see the syntax highlighting.
I'll add the code changes for syntaxt highlighting in the templates and chunks parts too when I have the time, but you can probably figure out yourself how it's done.
Edited by BDIL, 04 October 2006 - 02:02 PM.












