1
0

Added possibility to customize the xinha editor through a my_custom.js

file. See http://board.s9y.org/viewtopic.php?f=4&t=15286
This commit is contained in:
Garvin Hicking
2009-07-27 08:47:47 +00:00
parent 40fc088581
commit 9ed5ea8a90
3 changed files with 66 additions and 2 deletions

View File

@ -554,6 +554,11 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
$xinha = false;
}
$xinha_custom = serendipity_getTemplateFile('my_custom.js', 'serendipityHTTPPath');
if (empty($xinha_custom)) {
$xinha_custom = 'htmlarea/my_custom.js';
}
if (!$init) {
?>
<script type="text/javascript">
@ -562,8 +567,12 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
_editor_skin = "silva";
var editorref = '';
</script>
<?php if ($xinha) { ?><script type="text/javascript" src="htmlarea/XinhaCore.js"></script>
<?php } else { ?><script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<?php if ($xinha) { ?>
<script type="text/javascript" src="htmlarea/XinhaCore.js"></script>
<!-- This file can contain user customizations -->
<script type="text/javascript" src="<?= $xinha_custom; ?>"></script>
<?php } else { ?>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<?php } ?>
<?php
}
@ -732,6 +741,11 @@ function serendipity_emit_htmlarea_code($item, $jsname, $spawnMulti = false) {
} ?>
];
if (typeof('s9y_xinha') != 'undefined') {
s9y_xinha(editor<?php echo $jsname; ?>);
}
// editor<?php echo $jsname; ?>.registerPlugin(SpellChecker); // [SPELLCHECK]
editor<?php echo $jsname; ?>.generate();
editor<?php echo $jsname; ?>._textArea.className = 'serendipity_entry';