* rewrite the call method of kindeditor.
* fix the bug of kindeditor.
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
<?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
|
||||
<?php
|
||||
$module = $this->moduleName;
|
||||
$method = $this->methodName;
|
||||
if(!isset($config->$module->editor->$method)) return;
|
||||
$editor = $config->$module->editor->$method;
|
||||
$editor['id'] = explode(',', $editor['id']);
|
||||
?>
|
||||
<script src='<?php echo $jsRoot;?>jquery/kindeditor/kindeditor.<?php echo $app->getClientLang();?>.js' type='text/javascript'></script>
|
||||
<script language='javascript'>
|
||||
var editor = <?php echo json_encode($editor);?>;
|
||||
|
||||
var bugTools =
|
||||
[ 'title', 'fontname', 'fontsize','textcolor', 'bgcolor', 'bold', 'italic','underline',
|
||||
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',
|
||||
@@ -11,7 +20,7 @@ var simpleTools =
|
||||
'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist', 'insertunorderedlist', '|',
|
||||
'emoticons', 'image', 'link', '|', 'removeformat','undo', 'redo', 'fullscreen', 'source', 'about'];
|
||||
|
||||
var tools =
|
||||
var fullTools =
|
||||
[ 'title', 'fontname', 'fontsize','textcolor', '|',
|
||||
'bgcolor', 'bold', 'italic','underline', '|',
|
||||
'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', '|',
|
||||
@@ -22,4 +31,20 @@ var tools =
|
||||
'indent', 'outdent', 'subscript', 'superscript', '|',
|
||||
'selectall', 'strikethrough', 'removeformat', '|',
|
||||
'flash', 'media', 'advtable', 'hr', 'print'];
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$.each(editor.id, function(key, editorID)
|
||||
{
|
||||
editorTool = simpleTools;
|
||||
if(editor.tools == 'bugTools') editorTool = bugTools;
|
||||
if(editor.tools == 'fullTools') editorTool = fullTools;
|
||||
KE.show({id:editorID, items:editorTool, filterMode:true, imageUploadJson: createLink('file', 'ajaxUpload')});
|
||||
|
||||
$('form').submit(function()
|
||||
{
|
||||
KE.util.setData(editorID);
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user