├── VERSION
├── test
├── lib
├── README
├── index.html
├── incompatible_test.js
├── undo_manager_test.js
├── browser_test.js
├── support
│ └── html_equal.js
└── bootstrap_wysihtml5
│ └── parserRules_test.js
├── .gitignore
├── Gemfile
├── .settings
└── .gitignore
├── lib
├── img
│ ├── glyphicons-halflings.png
│ └── glyphicons-halflings-white.png
├── css
│ ├── prettify.css
│ ├── wysiwyg-color.css
│ ├── bootstrap-responsive.min.css
│ └── bootstrap-responsive.css
└── js
│ ├── bootstrap-button.js
│ ├── prettify.js
│ └── bootstrap.min.js
├── component.json
├── Gemfile.lock
├── LICENCE
├── Rakefile
├── src
├── locales
│ ├── bootstrap-wysihtml5.zh-CN.js
│ ├── bootstrap-wysihtml5.zh-TW.js
│ ├── bootstrap-wysihtml5.ja-JP.js
│ ├── bootstrap-wysihtml5.ko-KR.js
│ ├── bootstrap-wysihtml5.da-DK.js
│ ├── bootstrap-wysihtml5.mo-MD.js
│ ├── bootstrap-wysihtml5.tr-TR.js
│ ├── bootstrap-wysihtml5.it-IT.js
│ ├── bootstrap-wysihtml5.sv-SE.js
│ ├── bootstrap-wysihtml5.ca-CT.js
│ ├── bootstrap-wysihtml5.el-GR.js
│ ├── bootstrap-wysihtml5.ar-AR.js
│ ├── bootstrap-wysihtml5.nb-NB.js
│ ├── bootstrap-wysihtml5.es-AR.js
│ ├── bootstrap-wysihtml5.es-ES.js
│ ├── bootstrap-wysihtml5.nl-NL.js
│ ├── bootstrap-wysihtml5.bg-BG.js
│ ├── bootstrap-wysihtml5.cs-CZ.js
│ ├── bootstrap-wysihtml5.sk-SK.js
│ ├── bootstrap-wysihtml5.hr-HR.js
│ ├── bootstrap-wysihtml5.ru-RU.js
│ ├── bootstrap-wysihtml5.fr-FR.js
│ ├── bootstrap-wysihtml5.ua-UA.js
│ ├── bootstrap-wysihtml5.lt-LT.js
│ ├── bootstrap-wysihtml5.pl-PL.js
│ ├── bootstrap-wysihtml5.de-DE.js
│ └── bootstrap-wysihtml5.pt-BR.js
├── bootstrap-wysihtml5.css
└── bootstrap-wysihtml5.js
├── dist
├── bootstrap-wysihtml5-0.0.2.css
├── bootstrap-wysihtml5-0.0.2.min.js
└── bootstrap-wysihtml5-0.0.2.js
├── index.html
└── readme.textile
/VERSION:
--------------------------------------------------------------------------------
1 | 0.0.2
--------------------------------------------------------------------------------
/test/lib:
--------------------------------------------------------------------------------
1 | ../lib/
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .c9revisions
3 | /*.project
4 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | gem 'rake'
4 | gem 'therubyracer'
5 | gem 'uglifier'
--------------------------------------------------------------------------------
/.settings/.gitignore:
--------------------------------------------------------------------------------
1 | /*.jsdtscope
2 | /*.eclipse.wst.jsdt.ui.superType.container
3 | /*.eclipse.wst.jsdt.ui.superType.name
4 |
--------------------------------------------------------------------------------
/lib/img/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhollingworth/bootstrap-wysihtml5/HEAD/lib/img/glyphicons-halflings.png
--------------------------------------------------------------------------------
/lib/img/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jhollingworth/bootstrap-wysihtml5/HEAD/lib/img/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bootstrap-wysihtml5",
3 | "version": "0.1.0",
4 | "main": ["src/bootstrap-wysihtml5.css", "src/bootstrap-wysihtml5.js"],
5 | "dependencies": {
6 | "wysihtml5": "~0.3.0"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | execjs (1.3.0)
5 | multi_json (~> 1.0)
6 | libv8 (3.3.10.4)
7 | multi_json (1.1.0)
8 | rake (0.9.2.2)
9 | therubyracer (0.9.10)
10 | libv8 (~> 3.3.10)
11 | uglifier (1.2.3)
12 | execjs (>= 0.3.0)
13 | multi_json (>= 1.0.2)
14 |
15 | PLATFORMS
16 | ruby
17 |
18 | DEPENDENCIES
19 | rake
20 | therubyracer
21 | uglifier
22 |
--------------------------------------------------------------------------------
/test/README:
--------------------------------------------------------------------------------
1 | To run the tests, just open index.html in your wysihtml5-compatible
2 | browser.
3 |
4 | The following files are ported from the wyshtml5 project's unit tests:
5 |
6 | browser_test.js
7 | incompatible_test.js
8 | editor_test.js
9 | undo_manager.js
10 |
11 | These files should be left more or less alone, for purposes of
12 | maintainability. Put new tests in the bootstrap_wysihtml5/ directory,
13 | and modify index.html to reference any new files you create.
14 |
15 | If you're testing the underlying wysihtml5 library rather the
16 | bootstrap_wysihtml5 jquery plugin wrapper around that library, then
17 | you're probably contributing to the wrong project :). See
18 | https://github.com/xing/wysihtml5 for that.
19 |
--------------------------------------------------------------------------------
/lib/css/prettify.css:
--------------------------------------------------------------------------------
1 | .com { color: #93a1a1; }
2 | .lit { color: #195f91; }
3 | .pun, .opn, .clo { color: #93a1a1; }
4 | .fun { color: #dc322f; }
5 | .str, .atv { color: #D14; }
6 | .kwd, .linenums .tag { color: #1e347b; }
7 | .typ, .atn, .dec, .var { color: teal; }
8 | .pln { color: #48484c; }
9 |
10 | .prettyprint {
11 | padding: 8px;
12 | background-color: #f7f7f9;
13 | border: 1px solid #e1e1e8;
14 | }
15 | .prettyprint.linenums {
16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
19 | }
20 |
21 | /* Specify class=linenums on a pre to get line numbering */
22 | ol.linenums {
23 | margin: 0 0 0 33px; /* IE indents via margin-left */
24 | }
25 | ol.linenums li {
26 | padding-left: 12px;
27 | color: #bebec5;
28 | line-height: 18px;
29 | text-shadow: 0 1px 0 #fff;
30 | }
--------------------------------------------------------------------------------
/lib/css/wysiwyg-color.css:
--------------------------------------------------------------------------------
1 | .wysiwyg-color-black {
2 | color: black;
3 | }
4 |
5 | .wysiwyg-color-silver {
6 | color: silver;
7 | }
8 |
9 | .wysiwyg-color-gray {
10 | color: gray;
11 | }
12 |
13 | .wysiwyg-color-white {
14 | color: white;
15 | }
16 |
17 | .wysiwyg-color-maroon {
18 | color: maroon;
19 | }
20 |
21 | .wysiwyg-color-red {
22 | color: red;
23 | }
24 |
25 | .wysiwyg-color-purple {
26 | color: purple;
27 | }
28 |
29 | .wysiwyg-color-fuchsia {
30 | color: fuchsia;
31 | }
32 |
33 | .wysiwyg-color-green {
34 | color: green;
35 | }
36 |
37 | .wysiwyg-color-lime {
38 | color: lime;
39 | }
40 |
41 | .wysiwyg-color-olive {
42 | color: olive;
43 | }
44 |
45 | .wysiwyg-color-yellow {
46 | color: yellow;
47 | }
48 |
49 | .wysiwyg-color-navy {
50 | color: navy;
51 | }
52 |
53 | .wysiwyg-color-blue {
54 | color: blue;
55 | }
56 |
57 | .wysiwyg-color-teal {
58 | color: teal;
59 | }
60 |
61 | .wysiwyg-color-aqua {
62 | color: aqua;
63 | }
64 |
65 | .wysiwyg-color-orange {
66 | color: orange;
67 | }
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012 JFHollingworth LTD
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler'
3 | require 'fileutils'
4 | begin
5 | Bundler.setup(:default, :development)
6 | rescue Bundler::BundlerError => e
7 | $stderr.puts e.message
8 | $stderr.puts "Run `bundle install` to install missing gems"
9 | exit e.status_code
10 | end
11 |
12 | ROOT = File.dirname(__FILE__)
13 |
14 | require 'rake'
15 | require 'uglifier'
16 |
17 | task :default do
18 | version = File.open(File.join(ROOT, 'VERSION')).read
19 | output_path = File.join(ROOT, "dist")
20 |
21 | js_input_path = File.join('src', 'bootstrap-wysihtml5.js')
22 | css_input_path = File.join('src', 'bootstrap-wysihtml5.css')
23 |
24 | js_output_path = File.join(output_path, "bootstrap-wysihtml5-#{version}.js")
25 | minified_js_output_path = File.join(output_path, "bootstrap-wysihtml5-#{version}.min.js")
26 | css_output_path = File.join(output_path, "bootstrap-wysihtml5-#{version}.css")
27 |
28 | minified_js = Uglifier.compile(File.read(js_input_path))
29 |
30 | File.open(minified_js_output_path, 'w') { |f| f.write(minified_js) }
31 | File.open(js_output_path, 'w') { |f| f.write(File.read(js_input_path)) }
32 | File.open(css_output_path, 'w') { |f| f.write(File.read(css_input_path)) }
33 | end
34 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.zh-CN.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Chinese translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["zh-CN"] = {
6 | font_styles: {
7 | normal: "正文",
8 | h1: "标题 1",
9 | h2: "标题 2",
10 | h3: "标题 3"
11 | },
12 | emphasis: {
13 | bold: "粗体",
14 | italic: "斜体",
15 | underline: "下划线"
16 | },
17 | lists: {
18 | unordered: "项目符号",
19 | ordered: "编号",
20 | outdent: "减少缩进",
21 | indent: "增加缩进"
22 | },
23 | link: {
24 | insert: "插入链接",
25 | cancel: "取消"
26 | },
27 | image: {
28 | insert: "插入图片",
29 | cancel: "取消"
30 | },
31 | html: {
32 | edit: "HTML代码"
33 | },
34 | colours: {
35 | black: "黑色",
36 | silver: "银色",
37 | gray: "灰色",
38 | maroon: "赤红色",
39 | red: "红色",
40 | purple: "紫色",
41 | green: "绿色",
42 | olive: "橄榄色",
43 | navy: "深蓝色",
44 | blue: "蓝色",
45 | orange: "橙色"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.zh-TW.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Chinese Traditional translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["zh-TW"] = {
6 | font_styles: {
7 | normal: "內文",
8 | h1: "標題 1",
9 | h2: "標題 2",
10 | h3: "標題 3"
11 | },
12 | emphasis: {
13 | bold: "粗體",
14 | italic: "斜體",
15 | underline: "底線"
16 | },
17 | lists: {
18 | unordered: "項目符號",
19 | ordered: "編號列表",
20 | outdent: "減少縮排",
21 | indent: "增加縮排"
22 | },
23 | link: {
24 | insert: "插入超連結",
25 | cancel: "取消"
26 | },
27 | image: {
28 | insert: "插入圖片連結",
29 | cancel: "取消"
30 | },
31 | html: {
32 | edit: "HTML原始碼"
33 | },
34 | colours: {
35 | black: "黑色",
36 | silver: "銀色",
37 | gray: "灰色",
38 | maroon: "栗色",
39 | red: "红色",
40 | purple: "紫色",
41 | green: "綠色",
42 | olive: "橄欖色",
43 | navy: "深藍色",
44 | blue: "藍色",
45 | orange: "橙色"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ja-JP.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Japanese translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["ja-JP"] = {
6 | font_styles: {
7 | normal: "通常の文字",
8 | h1: "見出し1",
9 | h2: "見出し2",
10 | h3: "見出し3"
11 | },
12 | emphasis: {
13 | bold: "太字",
14 | italic: "斜体",
15 | underline: "下線"
16 | },
17 | lists: {
18 | unordered: "点字リスト",
19 | ordered: "数字リスト",
20 | outdent: "左寄せ",
21 | indent: "右寄せ"
22 | },
23 | link: {
24 | insert: "リンクの挿入",
25 | cancel: "キャンセル"
26 | },
27 | image: {
28 | insert: "画像の挿入",
29 | cancel: "キャンセル"
30 | },
31 | html: {
32 | edit: "HTMLを編集"
33 | },
34 | colours: {
35 | black: "黒色",
36 | silver: "シルバー",
37 | gray: "グレー",
38 | maroon: "栗色",
39 | red: "赤色",
40 | purple: "紫色",
41 | green: "緑色",
42 | olive: "オリーブ",
43 | navy: "ネイビー",
44 | blue: "青色",
45 | orange: "オレンジ"
46 | }
47 |
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ko-KR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Korean translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["ko-KR"] = {
6 | font_styles: {
7 | normal: "일반",
8 | h1: "헤드라인 1",
9 | h2: "헤드라인 2",
10 | h3: "헤드라인 3"
11 | },
12 | emphasis: {
13 | bold: "굵게",
14 | italic: "기울게",
15 | underline: "밑줄"
16 | },
17 | lists: {
18 | unordered: "기호목록",
19 | ordered: "숫자목록",
20 | outdent: "내어쓰기",
21 | indent: "들여쓰기"
22 | },
23 | link: {
24 | insert: "링크 삽입",
25 | cancel: "취소"
26 | },
27 | image: {
28 | insert: "이미지 삽입",
29 | cancel: "취소"
30 | },
31 | html: {
32 | edit: "HTML 편집"
33 | },
34 | colours: {
35 | black: "검은색",
36 | silver: "은색",
37 | gray: "회색",
38 | maroon: "고동색",
39 | red: "빨간색",
40 | purple: "보라색",
41 | green: "초록색",
42 | olive: "올리브",
43 | navy: "네이비",
44 | blue: "파란색",
45 | orange: "주황색"
46 | }
47 |
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/test/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
wysihtml5 - Test Suite
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.da-DK.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Danish translations
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["da-DK"] = {
6 | font_styles: {
7 | normal: "Normal tekst",
8 | h1: "Overskrift 1",
9 | h2: "Overskrift 2",
10 | h3: "Overskrift 3"
11 | },
12 | emphasis: {
13 | bold: "Fed",
14 | italic: "Kursiv",
15 | underline: "Understreget"
16 | },
17 | lists: {
18 | unordered: "Uordnet liste",
19 | ordered: "Ordnet liste",
20 | outdent: "Udryk",
21 | indent: "Indryk"
22 | },
23 | link: {
24 | insert: "Indsæt Link",
25 | cancel: "Annuler"
26 | },
27 | image: {
28 | insert: "Indsæt billede",
29 | cancel: "Annuler"
30 | },
31 | html: {
32 | edit: "Rediger HTML"
33 | },
34 | colours: {
35 | black: "Sort",
36 | silver: "Sølv",
37 | gray: "Grå",
38 | maroon: "Mørkerød",
39 | red: "Rød",
40 | purple: "Lilla",
41 | green: "Grøn",
42 | olive: "Lysegrøn",
43 | navy: "Mørkeblå",
44 | blue: "Blå",
45 | orange: "Orange"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.mo-MD.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Moldavian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["mo-MD"] = {
6 | font_styles: {
7 | normal: "Normal",
8 | h1: "Titlu 1",
9 | h2: "Titlu 2"
10 | },
11 | emphasis: {
12 | bold: "Bold",
13 | italic: "Cursiv",
14 | underline: "Accentuat"
15 | },
16 | lists: {
17 | unordered: "Neordonata",
18 | ordered: "Ordonata",
19 | outdent: "Margine",
20 | indent: "zimțuire"
21 | },
22 | link: {
23 | insert: "Indroduce link-ul",
24 | cancel: "Anula"
25 | },
26 | image: {
27 | insert: "Insera imagina",
28 | cancel: "Anula"
29 | },
30 | html: {
31 | edit: "Editare HTML"
32 | },
33 |
34 | colours: {
35 | black: "Negru",
36 | silver: "Argint",
37 | gray: "Gri",
38 | maroon: "Castaniu",
39 | red: "Roșu",
40 | purple: "Violet",
41 | green: "Verde",
42 | olive: "Oliv",
43 | navy: "Marin",
44 | blue: "Albastru",
45 | orange: "Portocaliu"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.tr-TR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Turkish translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["tr-TR"] = {
6 | font_styles: {
7 | normal: "Normal",
8 | h1: "Başlık 1",
9 | h2: "Başlık 2",
10 | h3: "Başlık 3"
11 | },
12 | emphasis: {
13 | bold: "Kalın",
14 | italic: "İtalik",
15 | underline: "Altı Çizili"
16 | },
17 | lists: {
18 | unordered: "Sırasız Liste",
19 | ordered: "Sıralı Liste",
20 | outdent: "Girintiyi Azalt",
21 | indent: "Girintiyi Arttır"
22 | },
23 | link: {
24 | insert: "Ekle",
25 | cancel: "Vazgeç"
26 | },
27 | image: {
28 | insert: "Ekle",
29 | cancel: "Vazgeç"
30 | },
31 | html: {
32 | edit: "HTML Göster"
33 | },
34 | colours: {
35 | black: "Siyah",
36 | silver: "Gümüş",
37 | gray: "Gri",
38 | maroon: "Vişne Çürüğü",
39 | red: "Kırmızı",
40 | purple: "Pembe",
41 | green: "Yeşil",
42 | olive: "Zeytin Yeşili",
43 | navy: "Lacivert",
44 | blue: "Mavi",
45 | orange: "Turuncu"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.it-IT.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Italian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["it-IT"] = {
6 | font_styles: {
7 | normal: "Testo normale",
8 | h1: "Titolo 1",
9 | h2: "Titolo 2"
10 | },
11 | emphasis: {
12 | bold: "Grassetto",
13 | italic: "Corsivo",
14 | underline: "Sottolineato"
15 | },
16 | lists: {
17 | unordered: "Lista non ordinata",
18 | ordered: "Lista ordinata",
19 | outdent: "Elimina rientro",
20 | indent: "Aggiungi rientro"
21 | },
22 | link: {
23 | insert: "Inserisci link",
24 | cancel: "Annulla"
25 | },
26 | image: {
27 | insert: "Inserisci immagine",
28 | cancel: "Annulla"
29 | },
30 | html: {
31 | edit: "Modifica HTML"
32 | },
33 | colours: {
34 | black: "Nero",
35 | silver: "Argento",
36 | gray: "Grigio",
37 | maroon: "Marrone",
38 | red: "Rosso",
39 | purple: "Viola",
40 | green: "Verde",
41 | olive: "Oliva",
42 | navy: "Blu Marino",
43 | blue: "Blu",
44 | orange: "Arancio"
45 | }
46 | };
47 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.sv-SE.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Swedish translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["sv-SE"] = {
6 | font_styles: {
7 | normal: "Normal Text",
8 | h1: "Rubrik 1",
9 | h2: "Rubrik 2",
10 | h3: "Rubrik 3"
11 | },
12 | emphasis: {
13 | bold: "Fet",
14 | italic: "Kursiv",
15 | underline: "Understruken"
16 | },
17 | lists: {
18 | unordered: "Osorterad lista",
19 | ordered: "Sorterad lista",
20 | outdent: "Minska indrag",
21 | indent: "Öka indrag"
22 | },
23 | link: {
24 | insert: "Lägg till länk",
25 | cancel: "Avbryt"
26 | },
27 | image: {
28 | insert: "Lägg till Bild",
29 | cancel: "Avbryt"
30 | },
31 | html: {
32 | edit: "Redigera HTML"
33 | },
34 | colours: {
35 | black: "Svart",
36 | silver: "Silver",
37 | gray: "Grå",
38 | maroon: "Kastaniebrun",
39 | red: "Röd",
40 | purple: "Lila",
41 | green: "Grön",
42 | olive: "Olivgrön",
43 | navy: "Marinblå",
44 | blue: "Blå",
45 | orange: "Orange"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ca-CT.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Catalan translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["ca-CT"] = {
6 | font_styles: {
7 | normal: "Text normal",
8 | h1: "Títol 1",
9 | h2: "Títol 2"
10 | },
11 | emphasis: {
12 | bold: "Negreta",
13 | italic: "Cursiva",
14 | underline: "Subratllat"
15 | },
16 | lists: {
17 | unordered: "Llista desordenada",
18 | ordered: "Llista ordenada",
19 | outdent: "Esborrar tabulació",
20 | indent: "Afegir tabulació"
21 | },
22 | link: {
23 | insert: "Afegir enllaç",
24 | cancel: "Cancelar"
25 | },
26 | image: {
27 | insert: "Afegir imatge",
28 | cancel: "Cancelar"
29 | },
30 | html: {
31 | edit: "Editar HTML"
32 | },
33 | colours: {
34 | black: "Negre",
35 | silver: "Plata",
36 | gray: "Gris",
37 | maroon: "Marró",
38 | red: "Vermell",
39 | purple: "Porpre",
40 | green: "Verd",
41 | olive: "Oliva",
42 | navy: "Blau marí",
43 | blue: "Blau",
44 | orange: "Taronja"
45 | }
46 | };
47 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.el-GR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Greek translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["el-GR"] = {
6 | font_styles: {
7 | normal: "Απλό κείμενο",
8 | h1: "Κεφαλίδα 1",
9 | h2: "Κεφαλίδα 2",
10 | h3: "Κεφαλίδα 3"
11 | },
12 | emphasis: {
13 | bold: "B",
14 | italic: "I",
15 | underline: "U"
16 | },
17 | lists: {
18 | unordered: "Λίστα με κουκκίδες",
19 | ordered: "Αριθμημένη λίστα",
20 | outdent: "Μείωση εσοχής",
21 | indent: "Αύξηση εσοχής"
22 | },
23 | link: {
24 | insert: "Εισαγωγή Συνδέσμου",
25 | cancel: "Άκυρο"
26 | },
27 | image: {
28 | insert: "Εισαγωγή Εικόνας",
29 | cancel: "Άκυρο"
30 | },
31 | html: {
32 | edit: "Επεξεργασία HTML"
33 | },
34 | colours: {
35 | black: "Μαύρο",
36 | silver: "Ασημί",
37 | gray: "Γκρι",
38 | maroon: "Καφέ",
39 | red: "Κόκκινο",
40 | purple: "Μωβ",
41 | green: "Πράσινο",
42 | olive: "Λαδί",
43 | navy: "Βαθύ Μπλε",
44 | blue: "Μπλε",
45 | orange: "Πορτοκαλί"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ar-AR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Arabic translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["mo-MD"] = {
6 | font_styles: {
7 | normal: "نص عادي",
8 | h1: "عنوان رئيسي 1",
9 | h2: "عنوان رئيسي 2",
10 | h3: "عنوان رئيسي 3",
11 | },
12 | emphasis: {
13 | bold: "عريض",
14 | italic: "مائل",
15 | underline: "تحته خط"
16 | },
17 | lists: {
18 | unordered: "قائمة منقطة",
19 | ordered: "قائمة مرقمة",
20 | outdent: "محاذاه للخارج",
21 | indent: "محاذاه للداخل"
22 | },
23 | link: {
24 | insert: "إضافة رابط",
25 | cancel: "إلغاء"
26 | },
27 | image: {
28 | insert: "إضافة صورة",
29 | cancel: "إلغاء"
30 | },
31 | html: {
32 | edit: "تعديل HTML"
33 | },
34 |
35 | colours: {
36 | black: "أسود",
37 | silver: "فضي",
38 | gray: "رمادي",
39 | maroon: "بني",
40 | red: "أحمر",
41 | purple: "بنفسجي",
42 | green: "أخضر",
43 | olive: "زيتوني",
44 | navy: "أزرق قاتم",
45 | blue: "أزرق نيلي",
46 | orange: "برتقالي"
47 | }
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.nb-NB.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Norwegian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["nb-NB"] = {
6 | font_styles: {
7 | normal: "Normal tekst",
8 | h1: "Tittel 1",
9 | h2: "Tittel 2",
10 | h3: "Tittel 3"
11 | },
12 | emphasis: {
13 | bold: "Fet",
14 | italic: "Kursiv",
15 | underline: "Understrekning"
16 | },
17 | lists: {
18 | unordered: "Usortert",
19 | ordered: "Sortert",
20 | outdent: "Detabuler",
21 | indent: "Tabuler",
22 | indered: "Tabuler"
23 | },
24 | link: {
25 | insert: "Sett inn lenke",
26 | cancel: "Avbryt"
27 | },
28 | image: {
29 | insert: "Sett inn bilde",
30 | cancel: "Avbryt"
31 | },
32 | html: {
33 | edit: "Rediger HTML"
34 | },
35 | colours: {
36 | black: "Svart",
37 | silver: "Sølv",
38 | gray: "Grå",
39 | maroon: "Brun",
40 | red: "Rød",
41 | purple: "Lilla",
42 | green: "Grønn",
43 | olive: "Oliven",
44 | navy: "Marineblå",
45 | blue: "Blå",
46 | orange: "Oransj"
47 | }
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.es-AR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Spanish Argenina translation for bootstrap-wysihtml5
3 | */
4 |
5 | (function($){
6 | $.fn.wysihtml5.locale["es-AR"] = {
7 | font_styles: {
8 | normal: "Texto normal",
9 | h1: "Título 1",
10 | h2: "Título 2",
11 | h3: "Título 3"
12 | },
13 | emphasis: {
14 | bold: "Negrita",
15 | italic: "Itálica",
16 | underline: "Subrayado"
17 | },
18 | lists: {
19 | ordered: "Lista ordenada",
20 | unordered: "Lista desordenada",
21 | indent: "Agregar sangría",
22 | outdent: "Eliminar sangría"
23 | },
24 | link: {
25 | insert: "Insertar enlace",
26 | cancel: "Cancelar"
27 | },
28 | image: {
29 | insert: "Insertar imágen",
30 | cancel: "Cancelar"
31 | },
32 | html: {
33 | edit: "Editar HTML"
34 | },
35 | colours: {
36 | black: "Negro",
37 | silver: "Plata",
38 | gray: "Gris",
39 | maroon: "Marrón",
40 | red: "Rojo",
41 | purple: "Púrpura",
42 | green: "Verde",
43 | olive: "Oliva",
44 | navy: "Azul Marino",
45 | blue: "Azul",
46 | orange: "Naranja"
47 | }
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.es-ES.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Uruguayan spanish translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["es-ES"] = {
6 | font_styles: {
7 | normal: "Texto normal",
8 | h1: "Título 1",
9 | h2: "Título 2",
10 | h3: "Título 3"
11 | },
12 | emphasis: {
13 | bold: "Negrita",
14 | italic: "Itálica",
15 | underline: "Subrayado"
16 | },
17 | lists: {
18 | unordered: "Lista desordenada",
19 | ordered: "Lista ordenada",
20 | outdent: "Eliminar sangría",
21 | indent: "Agregar sangría"
22 | },
23 | link: {
24 | insert: "Insertar enlace",
25 | cancel: "Cancelar"
26 | },
27 | image: {
28 | insert: "Insertar imágen",
29 | cancel: "Cancelar"
30 | },
31 | html: {
32 | edit: "Editar HTML"
33 | },
34 | colours: {
35 | black: "Negro",
36 | silver: "Plata",
37 | gray: "Gris",
38 | maroon: "Marrón",
39 | red: "Rojo",
40 | purple: "Púrpura",
41 | green: "Verde",
42 | olive: "Oliva",
43 | navy: "Azul Marino",
44 | blue: "Azul",
45 | orange: "Naranja"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.nl-NL.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Dutch translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["nl-NL"] = {
6 | font_styles: {
7 | normal: "Normale Tekst",
8 | h1: "Kop 1",
9 | h2: "Kop 2",
10 | h3: "Kop 3"
11 | },
12 | emphasis: {
13 | bold: "Vet",
14 | italic: "Cursief",
15 | underline: "Onderstrepen"
16 | },
17 | lists: {
18 | unordered: "Ongeordende lijst",
19 | ordered: "Geordende lijst",
20 | outdent: "Inspringen verkleinen",
21 | indent: "Inspringen vergroten"
22 | },
23 | link: {
24 | insert: "Link invoegen",
25 | cancel: "Annuleren"
26 | },
27 | image: {
28 | insert: "Afbeelding invoegen",
29 | cancel: "Annuleren"
30 | },
31 | html: {
32 | edit: "HTML bewerken"
33 | },
34 | colours: {
35 | black: "Zwart",
36 | silver: "Zilver",
37 | gray: "Grijs",
38 | maroon: "Kastanjebruin",
39 | red: "Rood",
40 | purple: "Paars",
41 | green: "Groen",
42 | olive: "Olijfgroen",
43 | navy: "Donkerblauw",
44 | blue: "Blauw",
45 | orange: "Oranje"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.bg-BG.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Bulgarian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["bg-BG"] = {
6 | font_styles: {
7 | normal: "Нормален текст",
8 | h1: "Заглавие 1",
9 | h2: "Заглавие 2",
10 | h3: "Заглавие 3"
11 | },
12 | emphasis: {
13 | bold: "Удебелен",
14 | italic: "Курсив",
15 | underline: "Подчертан"
16 | },
17 | lists: {
18 | unordered: "Неподреден списък",
19 | ordered: "Подреден списък",
20 | outdent: "Намали отстояние",
21 | indent: "Увеличи отстояние"
22 | },
23 | link: {
24 | insert: "Вмъкни връзка",
25 | cancel: "Отмени"
26 | },
27 | image: {
28 | insert: "Вмъкни картинка",
29 | cancel: "Отмени"
30 | },
31 | html: {
32 | edit: "Редакртирай HTML"
33 | },
34 | colours: {
35 | black: "Черен",
36 | silver: "Сребърен",
37 | gray: "Сив",
38 | maroon: "Коричневый",
39 | red: "Червен",
40 | purple: "Виолетов",
41 | green: "Зелен",
42 | olive: "Маслинен",
43 | navy: "Морско син",
44 | blue: "Син",
45 | orange: "Оранжев"
46 | }
47 | };
48 | }(jQuery));
49 |
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.cs-CZ.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Czech translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["cs-CZ"] = {
6 | font_styles: {
7 | normal: "Normální text",
8 | h1: "Nadpis úrovně 1",
9 | h2: "Nadpis úrovně 2",
10 | h3: "Nadpis úrovně 3"
11 | },
12 | emphasis: {
13 | bold: "Tučné",
14 | italic: "Kurzíva",
15 | underline: "Podtržení"
16 | },
17 | lists: {
18 | unordered: "Seznam s odrážkami",
19 | ordered: "Číslovaný seznam",
20 | outdent: "Zvětšit odsazení",
21 | indent: "Zmenšit odsazení"
22 | },
23 | link: {
24 | insert: "Vložit odkaz",
25 | cancel: "Zrušit"
26 | },
27 | image: {
28 | insert: "Vložit obrázek",
29 | cancel: "Zrušit"
30 | },
31 | html: {
32 | edit: "Upravit HTML"
33 | },
34 | colours: {
35 | black: "Černá",
36 | silver: "Stříbrná",
37 | gray: "Šedá",
38 | maroon: "Vínová",
39 | red: "Červená",
40 | purple: "Fialová",
41 | green: "Zelená",
42 | olive: "Olivová",
43 | navy: "Tmavomodrá",
44 | blue: "Modrá",
45 | orange: "Oranžová"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.sk-SK.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Slovak translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["sk-SK"] = {
6 | font_styles: {
7 | normal: "Normálny text",
8 | h1: "Nadpis úrovne 1",
9 | h2: "Nadpis úrovne 2",
10 | h3: "Nadpis úrovne 3"
11 | },
12 | emphasis: {
13 | bold: "Tučné",
14 | italic: "Kurzíva",
15 | underline: "Podčiarknuté"
16 | },
17 | lists: {
18 | unordered: "Neusporiadaný zoznam",
19 | ordered: "Číslovaný zoznam",
20 | outdent: "Zväčšiť odsadenie",
21 | indent: "Zmenšiť odsadenie"
22 | },
23 | link: {
24 | insert: "Vložiť odkaz",
25 | cancel: "Zrušiť"
26 | },
27 | image: {
28 | insert: "Vložiť obrázok",
29 | cancel: "Zrušiť"
30 | },
31 | html: {
32 | edit: "Editovať HTML"
33 | },
34 | colours: {
35 | black: "Čierna",
36 | silver: "Strieborná",
37 | gray: "Šedá",
38 | maroon: "Bordová",
39 | red: "Červená",
40 | purple: "Fialová",
41 | green: "Zelená",
42 | olive: "Olivová",
43 | navy: "Tmavomodrá",
44 | blue: "Modrá",
45 | orange: "Oranžová"
46 | }
47 | };
48 | }(jQuery));
49 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.hr-HR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Croatian localisation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["hr-HR"] = {
6 | font_styles: {
7 | normal: "Normalan tekst",
8 | h1: "Naslov 1",
9 | h2: "Naslov 2",
10 | h3: "Naslov 3"
11 | },
12 | emphasis: {
13 | bold: "Podebljano",
14 | italic: "Nakrivljeno",
15 | underline: "Podcrtano"
16 | },
17 | lists: {
18 | unordered: "Nesortirana lista",
19 | ordered: "Sortirana lista",
20 | outdent: "Izdubi",
21 | indent: "Udubi"
22 | },
23 | link: {
24 | insert: "Umetni poveznicu",
25 | cancel: "Otkaži"
26 | },
27 | image: {
28 | insert: "Umetni sliku",
29 | cancel: "Otkaži"
30 | },
31 | html: {
32 | edit: "Izmjeni HTML"
33 | },
34 | colours: {
35 | black: "Crna",
36 | silver: "Srebrna",
37 | gray: "Siva",
38 | maroon: "Kestenjasta",
39 | red: "Crvena",
40 | purple: "Ljubičasta",
41 | green: "Zelena",
42 | olive: "Maslinasta",
43 | navy: "Mornarska",
44 | blue: "Plava",
45 | orange: "Narandžasta"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ru-RU.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Russian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["ru-RU"] = {
6 | font_styles: {
7 | normal: "Обычный текст",
8 | h1: "Заголовок 1",
9 | h2: "Заголовок 2",
10 | h3: "Заголовок 3"
11 | },
12 | emphasis: {
13 | bold: "Полужирный",
14 | italic: "Курсив",
15 | underline: "Подчёркнутый"
16 | },
17 | lists: {
18 | unordered: "Маркированный список",
19 | ordered: "Нумерованный список",
20 | outdent: "Уменьшить отступ",
21 | indent: "Увеличить отступ"
22 | },
23 | link: {
24 | insert: "Вставить ссылку",
25 | cancel: "Отмена"
26 | },
27 | image: {
28 | insert: "Вставить изображение",
29 | cancel: "Отмена"
30 | },
31 | html: {
32 | edit: "HTML код"
33 | },
34 | colours: {
35 | black: "Чёрный",
36 | silver: "Серебряный",
37 | gray: "Серый",
38 | maroon: "Коричневый",
39 | red: "Красный",
40 | purple: "Фиолетовый",
41 | green: "Зелёный",
42 | olive: "Оливковый",
43 | navy: "Тёмно-синий",
44 | blue: "Синий",
45 | orange: "Оранжевый"
46 | }
47 | };
48 | }(jQuery));
49 |
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.fr-FR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * French translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["fr-FR"] = {
6 | font_styles: {
7 | normal: "Texte normal",
8 | h1: "Titre 1",
9 | h2: "Titre 2",
10 | h3: "Titre 3"
11 | },
12 | emphasis: {
13 | bold: "Gras",
14 | italic: "Italique",
15 | underline: "Souligné"
16 | },
17 | lists: {
18 | unordered: "Liste à puces",
19 | ordered: "Liste numérotée",
20 | outdent: "Diminuer le retrait",
21 | indent: "Augmenter le retrait",
22 | indered: "Augmenter le retrait"
23 | },
24 | link: {
25 | insert: "Insérer un lien",
26 | cancel: "Annuler"
27 | },
28 | image: {
29 | insert: "Insérer une image",
30 | cancel: "Annuler"
31 | },
32 | html: {
33 | edit: "Editer en HTML"
34 | },
35 | colours: {
36 | black: "Noir",
37 | silver: "Gris clair",
38 | gray: "Gris",
39 | maroon: "Marron",
40 | red: "Rouge",
41 | purple: "Pourpre",
42 | green: "Vert",
43 | olive: "Olive",
44 | navy: "Bleu marine",
45 | blue: "Bleu",
46 | orange: "Orange"
47 | }
48 | };
49 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.ua-UA.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ukrainian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["ua-UA"] = {
6 | font_styles: {
7 | normal: "Звичайний текст",
8 | h1: "Заголовок 1",
9 | h2: "Заголовок 2",
10 | h3: "Заголовок 3"
11 | },
12 | emphasis: {
13 | bold: "Напівжирний",
14 | italic: "Курсив",
15 | underline: "Підкреслений"
16 | },
17 | lists: {
18 | unordered: "Маркований список",
19 | ordered: "Нумерований список",
20 | outdent: "Зменшити відступ",
21 | indent: "Збільшити відступ"
22 | },
23 | link: {
24 | insert: "Вставити посилання",
25 | cancel: "Відміна"
26 | },
27 | image: {
28 | insert: "Вставити зображення",
29 | cancel: "Відміна"
30 | },
31 | html: {
32 | edit: "HTML код"
33 | },
34 | colours: {
35 | black: "Чорний",
36 | silver: "Срібний",
37 | gray: "Сірий",
38 | maroon: "Коричневий",
39 | red: "Червоний",
40 | purple: "Фіолетовий",
41 | green: "Зелений",
42 | olive: "Оливковий",
43 | navy: "Темно-синій",
44 | blue: "Синій",
45 | orange: "Помаранчевий"
46 | }
47 | };
48 | }(jQuery));
49 |
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.lt-LT.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Lithuanian translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["lt-LT"] = {
6 | font_styles: {
7 | normal: "Normalus",
8 | h1: "Antraštė 1",
9 | h2: "Antraštė 2",
10 | h3: "Antraštė 3"
11 | },
12 | emphasis: {
13 | bold: "Pastorintas",
14 | italic: "Kursyvas",
15 | underline: "Pabrauktas"
16 | },
17 | lists: {
18 | unordered: "Suženklintas sąrašas",
19 | ordered: "Numeruotas sąrašas",
20 | outdent: "Padidinti įtrauką",
21 | indent: "Sumažinti įtrauką"
22 | },
23 | link: {
24 | insert: "Įterpti nuorodą",
25 | cancel: "Atšaukti"
26 | },
27 | image: {
28 | insert: "Įterpti atvaizdą",
29 | cancel: "Atšaukti"
30 | },
31 | html: {
32 | edit: "Redaguoti HTML"
33 | },
34 | colours: {
35 | black: "Juoda",
36 | silver: "Sidabrinė",
37 | gray: "Pilka",
38 | maroon: "Kaštoninė",
39 | red: "Raudona",
40 | purple: "Violetinė",
41 | green: "Žalia",
42 | olive: "Gelsvai žalia",
43 | navy: "Tamsiai mėlyna",
44 | blue: "Mėlyna",
45 | orange: "Oranžinė"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.pl-PL.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Polish translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["pl-PL"] = {
6 | font_styles: {
7 | normal: "Tekst podstawowy",
8 | h1: "Nagłówek 1",
9 | h2: "Nagłówek 2",
10 | h3: "Nagłówek 3"
11 | },
12 | emphasis: {
13 | bold: "Pogrubienie",
14 | italic: "Kursywa",
15 | underline: "Podkreślenie"
16 | },
17 | lists: {
18 | unordered: "Lista wypunktowana",
19 | ordered: "Lista numerowana",
20 | outdent: "Zwiększ wcięcie",
21 | indent: "Zmniejsz wcięcie"
22 | },
23 | link: {
24 | insert: "Wstaw odnośnik",
25 | cancel: "Anuluj"
26 | },
27 | image: {
28 | insert: "Wstaw obrazek",
29 | cancel: "Anuluj"
30 | },
31 | html: {
32 | edit: "Edycja HTML"
33 | },
34 | colours: {
35 | black: "Czarny",
36 | silver: "Srebrny",
37 | gray: "Szary",
38 | maroon: "Kasztanowy",
39 | red: "Czerwony",
40 | purple: "Fioletowy",
41 | green: "Zielony",
42 | olive: "Oliwkowy",
43 | navy: "Granatowy",
44 | blue: "Niebieski",
45 | orange: "Pomarańczowy"
46 | }
47 | };
48 | }(jQuery));
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.de-DE.js:
--------------------------------------------------------------------------------
1 | /**
2 | * German translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["de-DE"] = {
6 | font_styles: {
7 | normal: "Normaler Text",
8 | h1: "Überschrift 1",
9 | h2: "Überschrift 2",
10 | h3: "Überschrift 3"
11 | },
12 | emphasis: {
13 | bold: "Fett",
14 | italic: "Kursiv",
15 | underline: "Unterstrichen"
16 | },
17 | lists: {
18 | unordered: "Ungeordnete Liste",
19 | ordered: "Geordnete Liste",
20 | outdent: "Einzug verkleinern",
21 | indent: "Einzug vergrößern"
22 | },
23 | link: {
24 | insert: "Link einfügen",
25 | cancel: "Abbrechen",
26 | target: "Link in neuen Fenster öffnen"
27 | },
28 | image: {
29 | insert: "Bild einfügen",
30 | cancel: "Abbrechen"
31 | },
32 | html: {
33 | edit: "HTML bearbeiten"
34 | },
35 | colours: {
36 | black: "Schwarz",
37 | silver: "Silber",
38 | gray: "Grau",
39 | maroon: "Kastanienbraun",
40 | red: "Rot",
41 | purple: "Violett",
42 | green: "Grün",
43 | olive: "Olivgrün",
44 | navy: "Marineblau",
45 | blue: "Blau",
46 | orange: "Orange"
47 | }
48 | };
49 | }(jQuery));
50 |
--------------------------------------------------------------------------------
/src/locales/bootstrap-wysihtml5.pt-BR.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Brazilian portuguese translation for bootstrap-wysihtml5
3 | */
4 | (function($){
5 | $.fn.wysihtml5.locale["pt-BR"] = {
6 | font_styles: {
7 | normal: "Texto normal",
8 | h1: "Título 1",
9 | h2: "Título 2",
10 | h3: "Título 3",
11 | h4: "Título 4",
12 | h5: "Título 5",
13 | h6: "Título 6"
14 | },
15 | emphasis: {
16 | bold: "Negrito",
17 | italic: "Itálico",
18 | underline: "Sublinhado"
19 | },
20 | lists: {
21 | unordered: "Lista",
22 | ordered: "Lista numerada",
23 | outdent: "Remover indentação",
24 | indent: "Indentar"
25 | },
26 | link: {
27 | insert: "Inserir link",
28 | cancel: "Cancelar",
29 | target: "Abrir em uma nova aba"
30 | },
31 | image: {
32 | insert: "Inserir imagem",
33 | cancel: "Cancelar"
34 | },
35 | html: {
36 | edit: "Editar HTML"
37 | },
38 | colours: {
39 | black: "Preto",
40 | silver: "Prata",
41 | gray: "Cinza",
42 | maroon: "Marrom",
43 | red: "Vermelho",
44 | purple: "Roxo",
45 | green: "Verde",
46 | olive: "Oliva",
47 | navy: "Marinho",
48 | blue: "Azul",
49 | orange: "Laranja"
50 | }
51 | };
52 | }(jQuery));
--------------------------------------------------------------------------------
/test/incompatible_test.js:
--------------------------------------------------------------------------------
1 | module("wysihtml5 - Incompatible", {
2 | setup: function() {
3 | this.originalSupportCheck = wysihtml5.browser.supported;
4 | wysihtml5.browser.supported = function() { return false; };
5 |
6 | this.textareaElement = document.createElement("textarea");
7 | document.body.appendChild(this.textareaElement);
8 | },
9 |
10 | teardown: function() {
11 | wysihtml5.browser.supported = this.originalSupportCheck;
12 | this.textareaElement.parentNode.removeChild(this.textareaElement);
13 | }
14 | });
15 |
16 |
17 | asyncTest("Basic test", function() {
18 | expect(12);
19 |
20 | var that = this;
21 |
22 | var oldIframesLength = document.getElementsByTagName("iframe").length;
23 |
24 | var oldInputsLength = document.getElementsByTagName("input").length;
25 |
26 | // var editor = new wysihtml5.Editor(this.textareaElement);
27 | $(this.textareaElement).wysihtml5({ link: false, image: false });
28 | var editor = $(this.textareaElement).data('wysihtml5').editor;
29 |
30 | editor.observe("load", function() {
31 | ok(true, "'load' event correctly triggered");
32 | ok(!wysihtml5.dom.hasClass(document.body, "wysihtml5-supported"), " didn't receive the 'wysihtml5-supported' class");
33 | ok(!editor.isCompatible(), "isCompatible returns false when rich text editing is not correctly supported in the current browser");
34 | equal(that.textareaElement.style.display, "", "Textarea is visible");
35 | ok(!editor.composer, "Composer not initialized");
36 |
37 | equal(document.getElementsByTagName("iframe").length, oldIframesLength, "No hidden field has been inserted into the dom");
38 | equal(document.getElementsByTagName("input").length, oldInputsLength, "Composer not initialized");
39 |
40 | var html = "foobar ";
41 | editor.setValue(html);
42 | equal(that.textareaElement.value, html);
43 | equal(editor.getValue(), html);
44 | editor.clear();
45 | equal(that.textareaElement.value, "");
46 |
47 | editor.observe("focus", function() {
48 | ok(true, "Generic 'focus' event fired");
49 | });
50 |
51 | editor.observe("focus:textarea", function() {
52 | ok(true, "Specific 'focus:textarea' event fired");
53 | });
54 |
55 | editor.observe("focus:composer", function() {
56 | ok(false, "Specific 'focus:composer' event fired, and that's wrong, there shouldn't be a composer element/view");
57 | });
58 |
59 | QUnit.triggerEvent(that.textareaElement, wysihtml5.browser.supportsEvent("focusin") ? "focusin" : "focus");
60 |
61 | start();
62 | });
63 | });
--------------------------------------------------------------------------------
/src/bootstrap-wysihtml5.css:
--------------------------------------------------------------------------------
1 | ul.wysihtml5-toolbar {
2 | margin: 0;
3 | padding: 0;
4 | display: block;
5 | }
6 |
7 | ul.wysihtml5-toolbar::after {
8 | clear: both;
9 | display: table;
10 | content: "";
11 | }
12 |
13 | ul.wysihtml5-toolbar > li {
14 | float: left;
15 | display: list-item;
16 | list-style: none;
17 | margin: 0 5px 10px 0;
18 | }
19 |
20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
21 | font-weight: bold;
22 | }
23 |
24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
25 | font-style: italic;
26 | }
27 |
28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
29 | text-decoration: underline;
30 | }
31 |
32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
33 | background-image: none;
34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
37 | background-color: #E6E6E6;
38 | background-color: #D9D9D9;
39 | outline: 0;
40 | }
41 |
42 | ul.wysihtml5-commands-disabled .dropdown-menu {
43 | display: none !important;
44 | }
45 |
46 | ul.wysihtml5-toolbar div.wysihtml5-colors {
47 | display:block;
48 | width: 50px;
49 | height: 20px;
50 | margin-top: 2px;
51 | margin-left: 5px;
52 | position: absolute;
53 | pointer-events: none;
54 | }
55 |
56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title {
57 | padding-left: 70px;
58 | }
59 |
60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
61 | background: black !important;
62 | }
63 |
64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
65 | background: silver !important;
66 | }
67 |
68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
69 | background: gray !important;
70 | }
71 |
72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
73 | background: maroon !important;
74 | }
75 |
76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
77 | background: red !important;
78 | }
79 |
80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
81 | background: purple !important;
82 | }
83 |
84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
85 | background: green !important;
86 | }
87 |
88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
89 | background: olive !important;
90 | }
91 |
92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
93 | background: navy !important;
94 | }
95 |
96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
97 | background: blue !important;
98 | }
99 |
100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
101 | background: orange !important;
102 | }
103 |
--------------------------------------------------------------------------------
/dist/bootstrap-wysihtml5-0.0.2.css:
--------------------------------------------------------------------------------
1 | ul.wysihtml5-toolbar {
2 | margin: 0;
3 | padding: 0;
4 | display: block;
5 | }
6 |
7 | ul.wysihtml5-toolbar::after {
8 | clear: both;
9 | display: table;
10 | content: "";
11 | }
12 |
13 | ul.wysihtml5-toolbar > li {
14 | float: left;
15 | display: list-item;
16 | list-style: none;
17 | margin: 0 5px 10px 0;
18 | }
19 |
20 | ul.wysihtml5-toolbar a[data-wysihtml5-command=bold] {
21 | font-weight: bold;
22 | }
23 |
24 | ul.wysihtml5-toolbar a[data-wysihtml5-command=italic] {
25 | font-style: italic;
26 | }
27 |
28 | ul.wysihtml5-toolbar a[data-wysihtml5-command=underline] {
29 | text-decoration: underline;
30 | }
31 |
32 | ul.wysihtml5-toolbar a.btn.wysihtml5-command-active {
33 | background-image: none;
34 | -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
35 | -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
36 | box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);
37 | background-color: #E6E6E6;
38 | background-color: #D9D9D9;
39 | outline: 0;
40 | }
41 |
42 | ul.wysihtml5-commands-disabled .dropdown-menu {
43 | display: none !important;
44 | }
45 |
46 | ul.wysihtml5-toolbar div.wysihtml5-colors {
47 | display:block;
48 | width: 50px;
49 | height: 20px;
50 | margin-top: 2px;
51 | margin-left: 5px;
52 | position: absolute;
53 | pointer-events: none;
54 | }
55 |
56 | ul.wysihtml5-toolbar a.wysihtml5-colors-title {
57 | padding-left: 70px;
58 | }
59 |
60 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="black"] {
61 | background: black !important;
62 | }
63 |
64 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="silver"] {
65 | background: silver !important;
66 | }
67 |
68 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="gray"] {
69 | background: gray !important;
70 | }
71 |
72 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="maroon"] {
73 | background: maroon !important;
74 | }
75 |
76 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="red"] {
77 | background: red !important;
78 | }
79 |
80 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="purple"] {
81 | background: purple !important;
82 | }
83 |
84 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="green"] {
85 | background: green !important;
86 | }
87 |
88 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="olive"] {
89 | background: olive !important;
90 | }
91 |
92 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="navy"] {
93 | background: navy !important;
94 | }
95 |
96 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="blue"] {
97 | background: blue !important;
98 | }
99 |
100 | ul.wysihtml5-toolbar div[data-wysihtml5-command-value="orange"] {
101 | background: orange !important;
102 | }
103 |
--------------------------------------------------------------------------------
/lib/js/bootstrap-button.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-button.js v2.0.2
3 | * http://twitter.github.com/bootstrap/javascript.html#buttons
4 | * ============================================================
5 | * Copyright 2012 Twitter, Inc.
6 | *
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | * ============================================================ */
19 |
20 | !function( $ ){
21 |
22 | "use strict"
23 |
24 | /* BUTTON PUBLIC CLASS DEFINITION
25 | * ============================== */
26 |
27 | var Button = function ( element, options ) {
28 | this.$element = $(element)
29 | this.options = $.extend({}, $.fn.button.defaults, options)
30 | }
31 |
32 | Button.prototype = {
33 |
34 | constructor: Button
35 |
36 | , setState: function ( state ) {
37 | var d = 'disabled'
38 | , $el = this.$element
39 | , data = $el.data()
40 | , val = $el.is('input') ? 'val' : 'html'
41 |
42 | state = state + 'Text'
43 | data.resetText || $el.data('resetText', $el[val]())
44 |
45 | $el[val](data[state] || this.options[state])
46 |
47 | // push to event loop to allow forms to submit
48 | setTimeout(function () {
49 | state == 'loadingText' ?
50 | $el.addClass(d).attr(d, d) :
51 | $el.removeClass(d).removeAttr(d)
52 | }, 0)
53 | }
54 |
55 | , toggle: function () {
56 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
57 |
58 | $parent && $parent
59 | .find('.active')
60 | .removeClass('active')
61 |
62 | this.$element.toggleClass('active')
63 | }
64 |
65 | }
66 |
67 |
68 | /* BUTTON PLUGIN DEFINITION
69 | * ======================== */
70 |
71 | $.fn.button = function ( option ) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | , data = $this.data('button')
75 | , options = typeof option == 'object' && option
76 | if (!data) $this.data('button', (data = new Button(this, options)))
77 | if (option == 'toggle') data.toggle()
78 | else if (option) data.setState(option)
79 | })
80 | }
81 |
82 | $.fn.button.defaults = {
83 | loadingText: 'loading...'
84 | }
85 |
86 | $.fn.button.Constructor = Button
87 |
88 |
89 | /* BUTTON DATA-API
90 | * =============== */
91 |
92 | $(function () {
93 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
94 | var $btn = $(e.target)
95 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
96 | $btn.button('toggle')
97 | })
98 | })
99 |
100 | }( window.jQuery );
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | bootstrap-wysihtml5
8 |
9 |
10 |
11 |
12 |
13 |
14 |
25 |
26 |
39 |
40 |
41 |
42 |
43 |
bootstrap-wysihtml5 Simple, beautiful wysiwyg editors
44 |
45 |
46 |
47 |
48 |
49 |
59 |
60 |
Usage
61 |
62 |
63 |
64 |
$('.textarea').wysihtml5();
65 |
66 |
67 |
Dependencies
68 |
69 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
90 |
91 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/test/undo_manager_test.js:
--------------------------------------------------------------------------------
1 | if (wysihtml5.browser.supportsCommand(document, "insertHTML")) {
2 |
3 | module("wysihtml5.UndoManager", {
4 | setup: function() {
5 | this.textareaElement = document.createElement("textarea");
6 | this.textareaElement.value = "1";
7 |
8 | this.form = document.createElement("form");
9 | this.form.onsubmit = function() { return false; };
10 | this.form.appendChild(this.textareaElement);
11 |
12 | document.body.appendChild(this.form);
13 | },
14 |
15 | teardown: function() {
16 | var leftover;
17 | while (leftover = document.querySelector("iframe.wysihtml5-sandbox, input[name='_wysihtml5_mode']")) {
18 | leftover.parentNode.removeChild(leftover);
19 | }
20 | this.form.parentNode.removeChild(this.form);
21 | },
22 |
23 | triggerUndo: function(editor) {
24 | this.triggerKey(editor, 90);
25 | },
26 |
27 | triggerRedo: function(editor) {
28 | this.triggerKey(editor, 89);
29 | },
30 |
31 | triggerKey: function(editor, keyCode) {
32 | var event;
33 | try {
34 | event = editor.composer.sandbox.getDocument().createEvent("KeyEvents");
35 | event.initKeyEvent("keydown", true, true, editor.composer.sandbox.getWindow(), true, false, false, false, keyCode, keyCode);
36 | } catch(e) {
37 | event = editor.composer.sandbox.getDocument().createEvent("Events");
38 | event.initEvent("keydown", true, true);
39 | event.ctrlKey = true;
40 | event.keyCode = keyCode;
41 | }
42 | editor.composer.element.dispatchEvent(event);
43 | }
44 | });
45 |
46 |
47 | asyncTest("Basic test", function() {
48 | expect(5);
49 |
50 | var that = this;
51 | // editor = new wysihtml5.Editor(this.textareaElement);
52 | $(this.textareaElement).wysihtml5();
53 | var editor = $(this.textareaElement).data('wysihtml5').editor;
54 |
55 | editor.on("load", function() {
56 | editor.setValue("1 2").fire("newword:composer");
57 | editor.setValue("1 2 3").fire("newword:composer");
58 | editor.setValue("1 2 3 4").fire("newword:composer");
59 | editor.setValue("1 2 3 4 5");
60 |
61 | that.triggerUndo(editor);
62 | equal(editor.getValue(), "1 2 3 4");
63 | that.triggerRedo(editor);
64 | that.triggerRedo(editor);
65 | equal(editor.getValue(), "1 2 3 4 5");
66 | that.triggerUndo(editor);
67 | that.triggerUndo(editor);
68 | equal(editor.getValue(), "1 2 3");
69 | that.triggerUndo(editor);
70 | that.triggerUndo(editor);
71 | equal(editor.getValue(), "1");
72 | that.triggerUndo(editor);
73 | that.triggerUndo(editor);
74 | equal(editor.getValue(), "1");
75 |
76 | start();
77 | });
78 | });
79 |
80 |
81 | asyncTest("Test commands", function() {
82 | expect(3);
83 |
84 | var that = this;
85 | // editor = new wysihtml5.Editor(this.textareaElement);
86 | $(this.textareaElement).wysihtml5();
87 | var editor = $(this.textareaElement).data('wysihtml5').editor;
88 |
89 | editor.on("load", function() {
90 | editor.setValue("1 ").fire("beforecommand:composer");
91 | editor.setValue("1 ").fire("beforecommand:composer");
92 |
93 | that.triggerUndo(editor);
94 | equal(editor.getValue(), "1 ");
95 | that.triggerRedo(editor);
96 | equal(editor.getValue(), "1 ");
97 | that.triggerUndo(editor);
98 | that.triggerUndo(editor);
99 | equal(editor.getValue(), "1");
100 |
101 | start();
102 | });
103 | });
104 | }
105 |
--------------------------------------------------------------------------------
/test/browser_test.js:
--------------------------------------------------------------------------------
1 | module("wysihtml5.browser", {
2 | userAgents: {
3 | iPad_iOS3: "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",
4 | iPhone_iOS3: "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3",
5 | iPad_iOS5: "Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
6 | Android: "Mozilla/5.0 (Linux; U; Android 2.1; en-us; Nexus One Build/ERD62) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17",
7 | Chrome: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7",
8 | OperaMobile: "Opera/9.80 (S60; SymbOS; Opera Mobi/498; U; en-GB) Presto/2.4.18 Version/10.00",
9 | IE6: "Mozilla/4.0 (Compatible; Windows NT 5.1; MSIE 6.0) (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
10 | IE7: "Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; c .NET CLR 3.0.04506; .NET CLR 3.5.30707; InfoPath.1; el-GR)",
11 | IE8: "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)",
12 | IE9: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)"
13 | },
14 |
15 | setup: function() {
16 | this.originalUserAgent = wysihtml5.browser.USER_AGENT;
17 | this.originalExecCommand = document.execCommand;
18 | this.originalQuerySelector = document.querySelector;
19 | this.originalQuerySelectorAll = document.querySelectorAll;
20 | },
21 |
22 | teardown: function() {
23 | wysihtml5.browser.USER_AGENT = this.originalUserAgent;
24 | document.execCommand = this.originalExecCommand;
25 | document.querySelector = this.originalQuerySelector;
26 | document.querySelectorAll = this.originalQuerySelectorAll;
27 | }
28 | });
29 |
30 |
31 | test("Check mobile contentEditable support", function() {
32 | document.querySelector = document.querySelectorAll = function() {};
33 |
34 | wysihtml5.browser.USER_AGENT = this.userAgents.iPad_iOS3;
35 | ok(!wysihtml5.browser.supported(), "iPad is correctly unsupported");
36 |
37 | wysihtml5.browser.USER_AGENT = this.userAgents.iPhone_iOS3;
38 | ok(!wysihtml5.browser.supported(), "iPhone is correctly unsupported");
39 |
40 | wysihtml5.browser.USER_AGENT = this.userAgents.iPad_iOS5;
41 | ok(wysihtml5.browser.supported(), "iOS 5 is correctly supported");
42 |
43 | wysihtml5.browser.USER_AGENT = this.userAgents.Android;
44 | ok(!wysihtml5.browser.supported(), "Android is correctly unsupported");
45 |
46 | wysihtml5.browser.USER_AGENT = this.userAgents.OperaMobile;
47 | ok(!wysihtml5.browser.supported(), "Opera Mobile is correctly unsupported");
48 | });
49 |
50 |
51 | test("Check with missing document.execCommand", function() {
52 | document.execCommand = null;
53 | // I've no idea why this test fails in Opera... (if you run the test alone, everything works)
54 | ok(!wysihtml5.browser.supported(), "Missing document.execCommand causes editor to be unsupported");
55 | });
56 |
57 |
58 | test("Check IE support", function() {
59 | wysihtml5.browser.USER_AGENT = this.userAgents.IE6;
60 | document.querySelector = document.querySelectorAll = null;
61 | ok(!wysihtml5.browser.supported(), "IE6 is correctly unsupported");
62 |
63 | wysihtml5.browser.USER_AGENT = this.userAgents.IE7;
64 | document.querySelector = document.querySelectorAll = null;
65 | ok(!wysihtml5.browser.supported(), "IE7 is correctly unsupported");
66 |
67 | wysihtml5.browser.USER_AGENT = this.userAgents.IE8;
68 | document.querySelector = document.querySelectorAll = function() {};
69 | ok(wysihtml5.browser.supported(), "IE8 is correctly supported");
70 |
71 | wysihtml5.browser.USER_AGENT = this.userAgents.IE9;
72 | document.querySelector = document.querySelectorAll = function() {};
73 | ok(wysihtml5.browser.supported(), "IE9 is correctly supported");
74 | });
75 |
76 |
77 | test("Check placeholder support", function() {
78 | var pseudoElement = document.createElement("div");
79 | pseudoElement.placeholder = "";
80 | ok(wysihtml5.browser.supportsPlaceholderAttributeOn(pseudoElement));
81 | });
--------------------------------------------------------------------------------
/test/support/html_equal.js:
--------------------------------------------------------------------------------
1 | var wysihtml5 = wysihtml5 || {};
2 | wysihtml5.assert = wysihtml5.assert || {};
3 |
4 | /**
5 | * Compare html strings without stumbling upon browser misbehaviors
6 | * Uses and takes the same parameters as QUnit's equal method
7 | *
8 | * @example
9 | * wysihtml5.assert.htmlEqual(
10 | * removeAttributes('foo
'),
11 | * 'foo
',
12 | * 'Removed align attribute on '
13 | * );
14 | */
15 | wysihtml5.assert.htmlEqual = (function() {
16 | var htmlHost = document.createElement("div");
17 |
18 | /**
19 | * IE uppercases tags and attribute names
20 | * and also removes quotes around attribute values whenever possible
21 | */
22 | var NEEDS_TO_BE_PREPARSED = (function() {
23 | var html = ' ';
24 | htmlHost.innerHTML = html;
25 | return htmlHost.innerHTML != html;
26 | })();
27 |
28 | var DOESNT_PRESERVE_WHITE_SPACE = (function() {
29 | var div = document.createElement("div"),
30 | a = document.createElement("a"),
31 | p = document.createElement("p");
32 | a.appendChild(p);
33 | div.appendChild(a);
34 | return div.innerHTML.toLowerCase() != "
";
35 | })();
36 |
37 | /**
38 | * When setting attributes via DOM API (setAttribute, etc.)
39 | * Firefox reorders them randomly when read via innerHTML, which makes comparing such strings
40 | * with expected strings a pain in the arse
41 | * Issue: https://bugzilla.mozilla.org/show_bug.cgi?id=238686
42 | */
43 | var REORDERS_ATTRIBUTES = (function() {
44 | var img = document.createElement("img"),
45 | parsedActualHtml,
46 | parsedExpectedHtml;
47 | img.setAttribute("alt", "foo");
48 | img.setAttribute("border", "1");
49 | img.setAttribute("src", "foo.gif");
50 | htmlHost.innerHTML = "";
51 | htmlHost.appendChild(img);
52 | parsedActualHtml = htmlHost.innerHTML;
53 | htmlHost.innerHTML = ' ';
54 | parsedExpectedHtml = htmlHost.innerHTML;
55 | return parsedExpectedHtml != parsedActualHtml;
56 | })();
57 |
58 | /**
59 | * Browsers don't preserve original attribute order
60 | * In order to be able to compare html we simply split both, the expected and actual html at spaces and element-ends,
61 | * sort them alphabetically and put them back together
62 | * TODO: This solution is a bit crappy. Maybe there's a smarter way. However it works for now.
63 | */
64 | var tokenizeHTML = (function() {
65 | var REG_EXP = /\s+|\>|;
66 | return function(html) {
67 | return html.split(REG_EXP).sort().join(" ");
68 | };
69 | })();
70 |
71 | var normalizeWhiteSpace = (function() {
72 | var PRE_REG_EXP = /(
]*>)([\S\s]*?)(<\/pre>)/mgi,
73 | WHITE_SPACE_REG_EXP = /\s+/gm,
74 | PLACEHOLDER = "___PRE_CONTENT___",
75 | PLACEHOLDER_REG_EXP = new RegExp(PLACEHOLDER, "g");
76 | return function(html) {
77 | var preContents = [];
78 | // Extract content of elements that preserve white space first
79 | html = html.replace(PRE_REG_EXP, function(match, $1, $2, $3) {
80 | preContents.push($2);
81 | return $1 + PLACEHOLDER + $3;
82 | });
83 |
84 | // Normalize space
85 | html = html.replace(WHITE_SPACE_REG_EXP, " ");
86 |
87 | // Reinsert original pre content
88 | html = html.replace(PLACEHOLDER_REG_EXP, function() {
89 | return preContents.shift();
90 | });
91 |
92 | return html;
93 | };
94 | })();
95 |
96 | var removeWhiteSpace = (function() {
97 | var REG_EXP = /(>)(\s*?)(<)/gm;
98 | return function(html) {
99 | return wysihtml5.lang.string(html.replace(REG_EXP, "$1$3")).trim();
100 | };
101 | })();
102 |
103 | return function(actual, expected, message, config) {
104 | config = config || {};
105 | if (NEEDS_TO_BE_PREPARSED) {
106 | actual = wysihtml5.dom.getAsDom(actual).innerHTML;
107 | expected = wysihtml5.dom.getAsDom(expected).innerHTML;
108 | }
109 |
110 | if (config.normalizeWhiteSpace || DOESNT_PRESERVE_WHITE_SPACE) {
111 | actual = normalizeWhiteSpace(actual);
112 | expected = normalizeWhiteSpace(expected);
113 | }
114 |
115 | if (config.removeWhiteSpace) {
116 | actual = removeWhiteSpace(actual);
117 | expected = removeWhiteSpace(expected);
118 | }
119 |
120 | actual = tokenizeHTML(actual);
121 | expected = tokenizeHTML(expected);
122 | ok(actual == expected, message);
123 | };
124 | })();
--------------------------------------------------------------------------------
/test/bootstrap_wysihtml5/parserRules_test.js:
--------------------------------------------------------------------------------
1 | if (wysihtml5.browser.supported()) {
2 |
3 | var colors = { silver: 1, gray: 1, white: 1, maroon: 1, red: 1, purple: 1,
4 | fuchsia: 1, green: 1, lime: 1, olive: 1, yellow: 1, navy: 1,
5 | blue: 1, teal: 1, aqua: 1, orange: 1 };
6 |
7 | var colorText = '';
8 | for(c in colors) {
9 | colorText = colorText + '' + c + ' ';
10 | }
11 |
12 |
13 | module("wysihtml5.bootstrap.parserRules", {
14 | setup: function() {
15 | wysihtml5.dom.insertCSS([
16 | "#wysihtml5-test-textarea { width: 200px; height: 100px; margin-top: 5px; font-style: italic; border: 2px solid red; border-radius: 2px; }",
17 | "#wysihtml5-test-textarea:focus { margin-top: 10px; }"
18 | ]).into(document);
19 |
20 | this.textareaElement = document.createElement("textarea");
21 | this.textareaElement.id = "wysihtml5-test-textarea";
22 | this.textareaElement.title = "Please enter your foo";
23 | this.textareaElement.value = "hey tiff, what's up?";
24 |
25 | this.form = document.createElement("form");
26 | this.form.onsubmit = function() { return false; };
27 | this.form.appendChild(this.textareaElement);
28 |
29 | this.originalBodyClassName = document.body.className;
30 |
31 | document.body.appendChild(this.form);
32 |
33 | this.colors = { silver: 1, gray: 1, white: 1, maroon: 1, red: 1, purple: 1,
34 | fuchsia: 1, green: 1, lime: 1, olive: 1, yellow: 1, navy: 1,
35 | blue: 1, teal: 1, aqua: 1, orange: 1 };
36 | this.colorText = '';
37 | for(c in this.colors) {
38 | this.colorText = this.colorText + '' + c + ' ';
39 | };
40 |
41 | },
42 |
43 | teardown: function() {
44 | var leftover;
45 | while (leftover = document.querySelector("iframe.wysihtml5-sandbox, input[name='_wysihtml5_mode']")) {
46 | leftover.parentNode.removeChild(leftover);
47 | }
48 | this.form.parentNode.removeChild(this.form);
49 | document.body.className = this.originalBodyClassName;
50 | },
51 |
52 | getComposerElement: function() {
53 | return this.getIframeElement().contentWindow.document.body;
54 | },
55 |
56 | getIframeElement: function() {
57 | var iframes = document.querySelectorAll("iframe.wysihtml5-sandbox");
58 | return iframes[iframes.length - 1];
59 | }
60 | });
61 |
62 |
63 | asyncTest("check that he default parser rules work as expected", function() {
64 | expect(6);
65 |
66 | var that = this;
67 |
68 | $(this.textareaElement).wysihtml5();
69 | var editor = $(this.textareaElement).data('wysihtml5').editor;
70 |
71 | editor.observe("load", function() {
72 |
73 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo !", " tags are allowed");
74 |
75 | equal(editor.parse(that.colorText).toLowerCase(), that.colorText, 'classes used for font colors are allowed');
76 |
77 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo!", " tags are stripped out");
78 |
79 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo!", "unrecognized tags are stripped out");
80 |
81 | equal(editor.parse('hello spam !').toLowerCase(),
82 | 'hello spam !',
83 | ' tags have target="_blank" and rel="nofollow" attributes added');
84 |
85 | equal(editor.parse('standard internet image: ').toLowerCase(),
86 | 'standard internet image: ',
87 | ' tags have alt attribute added, strip out non-numeric characters in width/height, require fully-qualified url in src');
88 |
89 | start();
90 | });
91 | });
92 |
93 | asyncTest("check that parserRules passed in as options work properly", function() {
94 | expect(6);
95 |
96 | var that = this;
97 |
98 | $(this.textareaElement).wysihtml5('deepExtend', {
99 | parserRules: {
100 | classes: {
101 | bar: 1,
102 | spanner: 1
103 | },
104 | tags: {
105 | strong: 1,
106 | blink: 1,
107 | em: { rename_tag: "blink" },
108 | span: {}
109 | }
110 | }
111 | });
112 | var editor = $(this.textareaElement).data('wysihtml5').editor;
113 |
114 | editor.observe("load", function() {
115 |
116 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo !", " tags are still allowed");
117 |
118 | equal(editor.parse('hello foo !').toLowerCase(), 'hello foo !', " tags are allowed")
119 |
120 | equal(editor.parse(that.colorText).toLowerCase(), that.colorText, 'classes used for font color are still allowed');
121 |
122 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo !", " tags are allowed");
123 |
124 | equal(editor.parse('hello foo !').toLowerCase(), 'hello foo !', ' survives');
125 |
126 | equal(editor.parse("hello foo !").toLowerCase(), "hello foo !", " tags are converted to ");
127 |
128 | start();
129 | });
130 | });
131 | }
132 |
--------------------------------------------------------------------------------
/readme.textile:
--------------------------------------------------------------------------------
1 | **This repo is no longer maintained. "bootstrap3-wysiwyg":https://github.com/bootstrap-wysiwyg/bootstrap3-wysiwyg is much better**
2 |
3 | h1. Overview
4 |
5 | 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/.
6 |
7 | h1. Examples
8 |
9 | * "http://jhollingworth.github.com/bootstrap-wysihtml5":http://jhollingworth.github.com/bootstrap-wysihtml5/
10 |
11 | h1. Quick Start
12 |
13 | If you are using rails use the "bootstrap-wysihtml5-rails gem":http://rubygems.org/gems/bootstrap-wysihtml5-rails.
14 |
15 |
16 | gem install bootstrap-wysihtml5-rails
17 |
18 |
19 | Otherwise, download "the latest version of bootstrap-wysihtml5":https://github.com/jhollingworth/bootstrap-wysihtml5/downloads.
20 |
21 | h2. Files to reference
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | h2. Usage
33 |
34 |
35 |
36 |
39 |
40 |
41 | You can get the html generated by getting the value of the text area, e.g.
42 |
43 |
44 | $('#some-textarea').val();
45 |
46 |
47 | h1. Advanced
48 |
49 | h2. Options
50 |
51 | An options object can be passed in to .wysihtml5() to configure the editor:
52 |
53 |
54 | $('#some-textarea').wysihtml5({someOption: 23, ...})
55 |
56 |
57 | h3. Buttons
58 |
59 | To override which buttons to show, set the appropriate flags:
60 |
61 |
62 | $('#some-textarea').wysihtml5({
63 | "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true
64 | "emphasis": true, //Italics, bold, etc. Default true
65 | "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
66 | "html": false, //Button which allows you to edit the generated HTML. Default false
67 | "link": true, //Button to insert a link. Default true
68 | "image": true, //Button to insert an image. Default true,
69 | "color": false //Button to change color of font
70 | });
71 |
72 |
73 | h3. Custom Templates for Toolbar Buttons
74 |
75 | 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.
76 |
77 | For example, the default template used for the editHtml mode button looks like this (with size fetched from the optional 'options')
78 |
79 |
80 |
81 |
84 |
85 |
86 |
87 | You can change it to not use the pencil icon (for example) by defining the custom template like this:
88 |
89 |
90 | var myCustomTemplates = {
91 | html : function(locale) {
92 | return " " +
93 | "" +
96 | " ";
97 | }
98 | }
99 |
100 | // pass in your custom templates on init
101 | $('#some-textarea').wysihtml5({
102 | customTemplates: myCustomTemplates
103 | });
104 |
105 |
106 |
107 | This will override only the toolbar template for html, and all others will use the default.
108 |
109 |
110 | h3. Stylesheets
111 |
112 | It is possible to supply a number of stylesheets for inclusion in the editor `