`
Reverie夜
  • 浏览: 20166 次
  • 性别: Icon_minigender_1
  • 来自: 惠州
社区版块
存档分类
最新评论

jquery轻量级文本编辑器Trumbowyg

阅读更多

ლ(╹◡╹ლ)感觉介个比CKDitor好用~可能~或许~大概~

先下一个trumbowyg吧~把css和js引入~

<link rel="stylesheet" href="trumbowyg/design/css/trumbowyg.css">
<script src="trumbowyg/jquery.min.js"></script>
        <script src="trumbowyg/trumbowyg.js"></script>
        <script src="trumbowyg/langs/fr.js"></script>
        <script src="trumbowyg/plugins/upload/trumbowyg.upload.js"></script>
        <script src="trumbowyg/plugins/base64/trumbowyg.base64.js"></script>

使用方法↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

EINS(基本用法):

 <form action="">
        <div id="simple-editor">夜月</div>
  </form>
  <script>$('#simple-editor').trumbowyg();</script>

 

 

ZWEI(自定义按钮):

<div id="customized-buttonpane" class="editor">
            <h2>夜月</h2>
</div>
<script>
        $.trumbowyg.btnsGrps.test = ['bold', 'link'];
        $.extend(true, $.trumbowyg.langs, {
                fr: {
                    align: 'Alignement',
                    image: 'Image'
                }
            });
        
        $('#customized-buttonpane').trumbowyg({
                lang: 'fr',
                closable: true,
                fixedBtnPane: true,
                btnsDef: {
                    align: {
                        dropdown: ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
                        ico: 'justifyLeft'
                    },
                    image: {
                        dropdown: ['insertImage', 'upload', 'base64'],
                        ico: 'insertImage'
                    }
                },
                btns: ['viewHTML',
                    '|', 'formatting',
                    '|', 'btnGrp-test',
                    '|', 'align',
                    '|', 'btnGrp-lists',
                    '|', 'image']
            });
</script>

 

 直接用上面的代码你会发现怎么少了个G~因为少了以下的代码_(:з」∠)_

 $.trumbowyg.btnsGrps.test = ['bold', 'link'];
 $.extend(true, $.trumbowyg.langs, {
       fr: {
            align: 'Alignement',
            image: 'Image'
       }
  });

 

DREI(textarea也可以,简单的定制与当前的选项):

        <textarea id="night" cols="30" rows="10">
            <h2>夜月</h2>
        </textarea>
        <script>
       		$('#night').trumbowyg({
                lang: 'fr',
                closable: true,
                mobile: true,
                fixedBtnPane: true,
                fixedFullWidth: true,
                semantic: true,
                resetCss: true,
                autoAjustHeight: true,
                autogrow: true
            });
        </script>

 

 

 

  • 大小: 37.7 KB
  • 大小: 30.7 KB
  • 大小: 36.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics