fix editor

This commit is contained in:
joyqi
2013-10-15 12:11:35 +08:00
parent 93f9e5c7c1
commit aad666c5ce
6 changed files with 370 additions and 145 deletions
-20
View File
@@ -1,20 +0,0 @@
<?php if(!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<script type="text/javascript">
var textEditor = new Typecho.textarea('#text', {
autoSaveTime: 30,
resizeAble: true,
autoSave: <?php echo ($options->autoSave ? 'true' : 'false'); ?>,
autoSaveMessageElement: 'auto-save-message',
autoSaveLeaveMessage: '<?php _e('您的内容尚未保存, 是否离开此页面?'); ?>',
resizeUrl: '<?php $options->index('/action/ajax'); ?>'
});
/** 这两个函数在插件中必须实现 */
var insertImageToEditor = function (title, url, link, cid) {
textEditor.setContent('<a href="' + link + '" title="' + title + '"><img src="' + url + '" alt="' + title + '" /></a>', '');
};
var insertLinkToEditor = function (title, url, link, cid) {
textEditor.setContent('<a href="' + url + '" title="' + title + '">' + title + '</a>', '');
};
</script>