Trên GitHub, jhollingworth/bootstrap-wysihtml5 đã đạt 4.1k sao, ngôn ngữ JavaScript. Simple, beautiful wysiwyg editor
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
This repo is no longer maintained. "bootstrap3-wysiwyg":https://github.com/bootstrap-wysiwyg/bootstrap3-wysiwyg is much better
h1. Overview
Bootstrap-wysihtml5 is a javascript plugin that makes it easy to create simple, beautiful wysiwyg editors with the help of "wysihtml5":https://github.com/xing/wysihtml5 and "Twitter Bootstrap":http://twitter.github.com/bootstrap/.
To override which buttons to show, set the appropriate flags:
$('#some-textarea').wysihtml5({
"font-styles": true, //Font styling, e.g. h1, h2, etc. Default true
"emphasis": true, //Italics, bold, etc. Default true
"lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
"html": false, //Button which allows you to edit the generated HTML. Default false
"link": true, //Button to insert a link. Default true
"image": true, //Button to insert an image. Default true,
"color": false //Button to change color of font
});
h3. Custom Templates for Toolbar Buttons
To define custom templates for buttons, you can submit a customTemplates hash with the new definitions. Each entry should be a function which expects 'locale' and optional 'options' to manage the translations.
For example, the default template used for the editHtml mode button looks like this (with size fetched from the optional 'options')
"
You can change it to not use the pencil icon (for example) by defining the custom template like this:
var myCustomTemplates = {
html : function(locale) {
return "
" +
"
" +
"HTML" +
"
" +
"
";
}
}
// pass in your custom templates on init
$('#some-textarea').wysihtml5({
customTemplates: myCustomTemplates
});
This will override only the toolbar template for html, and all others will use the default.
h3. Stylesheets
It is possible to supply a number of stylesheets for inclusion in the editor <iframe>:
Options you pass in will be added to the defaults via a shallow copy. (see "jQuery.extend()":http://api.jquery.com/jQuery.extend/ for details). You can use a deep copy instead (which is probably what you want if you're adding tags or classes to parserRules) via 'deepExtend', as in the parserRules example below.
h3. Parser Rules
If you find the editor is stripping out tags or attributes you need, then you'll want to extend (or replace) parserRules. This example extends the defaults to allow the and tags, and the class "middle":
There's quite a bit that can be done with parserRules; see "wysihtml5's advanced parser ruleset":https://github.com/xing/wysihtml5/blob/master/parser_rules/advanced.js for details. bootstrap-wysihtml5's default parserRules can be found "in the source":https://github.com/jhollingworth/bootstrap-wysihtml5/blob/master/src/bootstrap-wysihtml5.js (just search for 'parserRules' in the file).
h3. Defaults
You can change bootstrap-wysihtml5's defaults by altering:
$.fn.wysihtml5.defaultOptions
This object has the same structure as the options object you pass in to .wysihtml5(). You can revert to the original defaults by calling:
$(this).wysihtml5('resetDefaults')
Operations on the defaults are not thread-safe; if you're going to change the defaults, you probably want to do it only once, after you load the bootstrap-wysihtml plugin and before you start instantiating your editors.
h2. The underlying wysihtml5 object
You can access the "wysihtml5 editor object":https://github.com/xing/wysihtml5 like this:
var wysihtml5Editor = $('#some-textarea').data("wysihtml5").editor;
wysihtml5Editor.composer.commands.exec("bold");
h2. I18n
You can use Bootstrap-wysihtml5 in other languages. There are some translations available in the src/locales directory. You can include your desired one after the plugin and pass its key to the editor. Example:
It is possible to use custom translations as well. Just add a new key to $.fn.wysihtml5.locale before calling the editor constructor.
Đọc thêm về jhollingworth/bootstrap-wysihtml5 ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jhollingworth/bootstrap-wysihtml5 là nguồn chính thức.
jhollingworth/bootstrap-wysihtml5 có bao nhiêu sao?
jhollingworth/bootstrap-wysihtml5 có 4.1k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/jhollingworth/bootstrap-wysihtml5. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
jhollingworth/bootstrap-wysihtml5 có phải mã nguồn mở không?
Có — jhollingworth/bootstrap-wysihtml5 phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jhollingworth/bootstrap-wysihtml5.
jhollingworth/bootstrap-wysihtml5 còn đang phát triển không?
Commit gần nhất trên jhollingworth/bootstrap-wysihtml5 là 6.6 năm trước (theo timestamp GitHub). Repo có 973 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
jhollingworth/bootstrap-wysihtml5 dùng license gì?
jhollingworth/bootstrap-wysihtml5 phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
jhollingworth/bootstrap-wysihtml5 là gì?
jhollingworth/bootstrap-wysihtml5 (jhollingworth/bootstrap-wysihtml5) là dự án JavaScript trên GitHub. Theo mô tả gốc: Simple, beautiful wysiwyg editor
jhollingworth/bootstrap-wysihtml5 viết bằng ngôn ngữ gì?
jhollingworth/bootstrap-wysihtml5 chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về bootstrap-wysihtml5?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về bootstrap-wysihtml5.