├── dist ├── themes │ └── flat │ │ ├── sprite.png │ │ ├── arrow-down.png │ │ ├── arrow-down.svg │ │ ├── style.css │ │ └── sprite.svg ├── cazary.min.js └── cazary-legacy.min.js ├── .gitattributes ├── .babelrc ├── .gitignore ├── doc ├── HOW_TO_TRANSLATE.md ├── HOW_TO_BUILD.md └── HOW_TO_RELEASE.md ├── src ├── themes │ ├── flat │ │ ├── arrow-down.svg │ │ ├── style.scss │ │ ├── sprite.svg │ │ └── sprite.orig.svg │ └── _mixins.scss ├── i18n │ ├── ja.yaml │ ├── pl.yaml │ ├── pt-br.yaml │ └── pt.yaml └── cazary.es6 ├── LICENSE ├── demo.html ├── patch ├── demo-legacy.html.patch └── cazary-legacy.es6.patch ├── demo-legacy.html ├── package.json ├── gulpfile.babel.js └── README.md /dist/themes/flat/sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shimataro/cazary/HEAD/dist/themes/flat/sprite.png -------------------------------------------------------------------------------- /dist/themes/flat/arrow-down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shimataro/cazary/HEAD/dist/themes/flat/arrow-down.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | .git* eol=lf 2 | *.txt eol=lf 3 | *.md eol=lf 4 | *.html eol=lf 5 | *.js eol=lf 6 | *.css eol=lf 7 | *.py eol=lf 8 | -------------------------------------------------------------------------------- /dist/themes/flat/arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | } 9 | } 10 | ] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # temporary files 2 | *~ 3 | *.tmp 4 | *.swp 5 | *.log 6 | 7 | # Node.js module files 8 | node_modules/ 9 | 10 | # auto-generated files 11 | src/cazary-legacy.es6 12 | -------------------------------------------------------------------------------- /doc/HOW_TO_TRANSLATE.md: -------------------------------------------------------------------------------- 1 | How to translate 2 | ============== 3 | 4 | Language files are in `src/i18n` directory, with the name `[language].yaml`. 5 | Format is very simple, so I believe that you can create easily with no explanation. 6 | 7 | Language data will be embedded into `dist/*.js` files automatically in [build process](HOW_TO_BUILD.md). 8 | -------------------------------------------------------------------------------- /doc/HOW_TO_BUILD.md: -------------------------------------------------------------------------------- 1 | How to build 2 | ============== 3 | 4 | # 1. Preparation 5 | 6 | ## 1-1. Install npm 7 | 8 | ### [Ubuntu 16.04](http://releases.ubuntu.com/16.04/) 9 | 10 | # apt-get install nodejs nodejs-legacy npm 11 | 12 | ### [Ubuntu 14.04](http://releases.ubuntu.com/14.04/) 13 | 14 | # apt-get install nodejs npm 15 | 16 | ### [Ubuntu 12.04](http://releases.ubuntu.com/12.04/) 17 | 18 | # apt-add-repository ppa:chris-lea/node.js 19 | # apt-get update 20 | # apt-get install nodejs npm 21 | 22 | ### [Gentoo Linux](https://www.gentoo.org/) 23 | 24 | # USE="npm" emerge net-libs/nodejs 25 | 26 | ## 1-2. Install packages 27 | 28 | $ npm install 29 | 30 | # 2. Build 31 | 32 | $ npm run build 33 | 34 | That's it! Distribution files will be generated in `dist` directory. 35 | -------------------------------------------------------------------------------- /doc/HOW_TO_RELEASE.md: -------------------------------------------------------------------------------- 1 | How to release 2 | == 3 | 4 | ## Merge dev into master, with `--no-ff` and `--no-commit` 5 | ```bash 6 | git checkout master 7 | git merge --no-ff --no-commit dev 8 | ``` 9 | 10 | ## Update dependencies 11 | ```bash 12 | npm run update-packages 13 | npm update 14 | npm run build 15 | ``` 16 | 17 | ## Update release note in `README.md` 18 | 19 | ## Update version number in `package.json` 20 | 21 | ## Stage `README.md`, `package.json` 22 | ```bash 23 | git add README.md package.json 24 | ``` 25 | 26 | ## Commit changes 27 | ```bash 28 | git commit 29 | ``` 30 | 31 | ## Create tag 32 | ```bash 33 | git tag v 34 | ``` 35 | 36 | ## Push changes 37 | ```bash 38 | git push --tags 39 | ``` 40 | 41 | ## Release on GitHub 42 | 43 | ## Release to npm 44 | ```bash 45 | npm publish 46 | ``` 47 | -------------------------------------------------------------------------------- /src/themes/flat/arrow-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 14 | 16 | 17 | 19 | image/svg+xml 20 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | -------------------------------------------------------------------------------- /src/i18n/ja.yaml: -------------------------------------------------------------------------------- 1 | # Japanese (by Shimataro) 2 | "Font": "フォント" 3 | "Size": "サイズ" 4 | 5 | "Bold": "太字" 6 | "Italic": "斜体" 7 | "Underline": "下線" 8 | "Strike-Through": "打ち消し線" 9 | "Remove Format": "書式をクリア" 10 | 11 | "Foreground Color": "文字色" 12 | "Background Color": "背景色" 13 | 14 | "Superscript": "上付き文字" 15 | "Subscript": "下付き文字" 16 | 17 | "Justify Left": "左揃え" 18 | "Justify Center": "中央揃え" 19 | "Justify Right": "右揃え" 20 | "Justify Full": "両端揃え" 21 | 22 | "Indent": "字下げ" 23 | "Outdent": "字下げ解除" 24 | 25 | "Ordered List": "番号付きリスト" 26 | "Unordered List": "箇条書き" 27 | 28 | "Horizontal Rule": "横線" 29 | "Insert Image": "画像挿入" 30 | "Insert Link": "リンク挿入" 31 | 32 | "Undo": "元に戻す" 33 | "Redo": "やり直し" 34 | 35 | "Show Source": "HTMLソース表示" 36 | 37 | # Font Sizes 38 | "Size 1": "サイズ1" 39 | "Size 2": "サイズ2" 40 | "Size 3": "サイズ3" 41 | "Size 4": "サイズ4" 42 | "Size 5": "サイズ5" 43 | "Size 6": "サイズ6" 44 | "Size 7": "サイズ7" 45 | 46 | # Insert Image/Link 47 | "Input image URL": "画像URLを入力してください" 48 | "Input link URL or E-mail address": "リンク先URLまたはメールアドレスを入力してください" 49 | "Preview": "プレビュー" 50 | "Insert": "挿入" 51 | 52 | # Unlink 53 | "Unlink": "リンク解除" 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 shimataro 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Cazary demo 6 | 7 | 14 | 15 | 16 |

Cazary demo

17 | 18 | 19 | 20 | 21 | 22 | 23 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /patch/demo-legacy.html.patch: -------------------------------------------------------------------------------- 1 | --- demo.html 2016-03-05 00:00:00.000000000 +0000 2 | +++ demo-legacy.html 2016-03-05 00:00:00.000000000 +0000 3 | @@ -2,7 +2,7 @@ 4 | 5 | 6 | 7 | - Cazary demo 8 | + Cazary demo (legacy) 9 | 10 | 14 | 15 | 16 | -

Cazary demo

17 | +

Cazary demo (legacy)

18 | 19 | 20 | 21 | 22 | - 23 | - 24 | + 25 | + 26 | 22 | 23 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/i18n/pl.yaml: -------------------------------------------------------------------------------- 1 | # Polish (by Paweł Klockiewicz) 2 | "Font": "Czcionka" 3 | "Size": "Rozmiar" 4 | 5 | "Bold": "Pogrubienie" 6 | "Italic": "Kursywa" 7 | "Underline": "Podkreślenie" 8 | "Strike-Through": "Przekreślenie" 9 | "Remove Format": "Usuń formatowanie" 10 | 11 | "Foreground Color": "Kolor czcionki" 12 | "Background Color": "Kolor tła" 13 | 14 | "Superscript": "Indeks górny" 15 | "Subscript": "Indeks dolny" 16 | 17 | "Justify Left": "Wyrównanie do lewej" 18 | "Justify Center": "Wyrównaj do środka" 19 | "Justify Right": "Wyrównaj do prawej" 20 | "Justify Full": "Wyjustowanie" 21 | 22 | "Indent": "Zwiększ wcięcie" 23 | "Outdent": "Zmniejsz wcięcie" 24 | 25 | "Ordered List": "Numerowanie" 26 | "Unordered List": "Punktory" 27 | 28 | "Horizontal Rule": "Pozioma linia" 29 | "Insert Image": "Wstaw obrazek" 30 | "Insert Link": "Wstaw link" 31 | 32 | "Undo": "Cofnij" 33 | "Redo": "Powtórz" 34 | 35 | "Show Source": "Pokaż źródło" 36 | 37 | # Font Sizes 38 | "Size 1": "Rozmiar 1" 39 | "Size 2": "Rozmiar 2" 40 | "Size 3": "Rozmiar 3" 41 | "Size 4": "Rozmiar 4" 42 | "Size 5": "Rozmiar 5" 43 | "Size 6": "Rozmiar 6" 44 | "Size 7": "Rozmiar 7" 45 | 46 | # Insert Image/Link 47 | "Input image URL": "Adres obrazka" 48 | "Input link URL or E-mail address": "Wprowadź adres URL lub E-mail" 49 | "Preview": "Podgląd" 50 | "Insert": "Wstaw" 51 | 52 | # Unlink 53 | "Unlink": "Usuń link" 54 | -------------------------------------------------------------------------------- /src/i18n/pt-br.yaml: -------------------------------------------------------------------------------- 1 | # Brazilian Portuguese (by Luiz Eduardo Simões) 2 | "Font": "Fonte" 3 | "Size": "Tamanho" 4 | 5 | "Bold": "Negrito" 6 | "Italic": "Itálico" 7 | "Underline": "Sublinhado" 8 | "Strike-Through": "Tachado" 9 | "Remove Format": "Remover formatação" 10 | 11 | "Foreground Color": "Cor da fonte" 12 | "Background Color": "Sombreamento" 13 | 14 | "Superscript": "Sobrescrito" 15 | "Subscript": "Subscrito" 16 | 17 | "Justify Left": "Alinhar à esquerda" 18 | "Justify Center": "Centralizar" 19 | "Justify Right": "Alinhar à direita" 20 | "Justify Full": "Justificar" 21 | 22 | "Indent": "Aumentar recuo" 23 | "Outdent": "Diminuir recuo" 24 | 25 | "Ordered List": "Numeração" 26 | "Unordered List": "Marcadores" 27 | 28 | "Horizontal Rule": "Linha horizontal" 29 | "Insert Image": "Inserir imagem" 30 | "Insert Link": "Inserir hiperlink" 31 | 32 | "Undo": "Desfazer" 33 | "Redo": "Refazer" 34 | 35 | "Show Source": "Mostrar fonte" 36 | 37 | # Font Sizes 38 | "Size 1": "Tamanho 1" 39 | "Size 2": "Tamanho 2" 40 | "Size 3": "Tamanho 3" 41 | "Size 4": "Tamanho 4" 42 | "Size 5": "Tamanho 5" 43 | "Size 6": "Tamanho 6" 44 | "Size 7": "Tamanho 7" 45 | 46 | # Insert Image/Link 47 | "Input image URL": "Insira a URL da imagem" 48 | "Input link URL or E-mail address": "Insira uma URL ou endereço de e-mail" 49 | "Preview": "Pré-visualização" 50 | "Insert": "Inserir" 51 | 52 | # Unlink 53 | "Unlink": "Remover hiperlink" 54 | -------------------------------------------------------------------------------- /src/i18n/pt.yaml: -------------------------------------------------------------------------------- 1 | # Portuguese (by Luiz Eduardo Simões) 2 | "Font": "Tipo de letra" 3 | "Size": "Tamanho" 4 | 5 | "Bold": "Negrito" 6 | "Italic": "Itálico" 7 | "Underline": "Sublinhado" 8 | "Strike-Through": "Rasurado" 9 | "Remove Format": "Remover formatação" 10 | 11 | "Foreground Color": "Cor do tipo de letra" 12 | "Background Color": "Realçar" 13 | 14 | "Superscript": "Sobrescrito" 15 | "Subscript": "Subscrito" 16 | 17 | "Justify Left": "Alinhar à esquerda" 18 | "Justify Center": "Centrar horizontalmente" 19 | "Justify Right": "Alinhar à direita" 20 | "Justify Full": "Justificado" 21 | 22 | "Indent": "Aumentar avanço" 23 | "Outdent": "Diminuir avanço" 24 | 25 | "Ordered List": "Numeração" 26 | "Unordered List": "Marcas" 27 | 28 | "Horizontal Rule": "Linha horizontal" 29 | "Insert Image": "Inserir imagem" 30 | "Insert Link": "Inserir hiperligação" 31 | 32 | "Undo": "Anular" 33 | "Redo": "Refazer" 34 | 35 | "Show Source": "Mostrar código-fonte" 36 | 37 | # Font Sizes 38 | "Size 1": "Tamanho 1" 39 | "Size 2": "Tamanho 2" 40 | "Size 3": "Tamanho 3" 41 | "Size 4": "Tamanho 4" 42 | "Size 5": "Tamanho 5" 43 | "Size 6": "Tamanho 6" 44 | "Size 7": "Tamanho 7" 45 | 46 | # Insert Image/Link 47 | "Input image URL": "Insira a URL da imagem" 48 | "Input link URL or E-mail address": "Insira uma URL ou endereço de correio eletrónico" 49 | "Preview": "Pré-visualização" 50 | "Insert": "Inserir" 51 | 52 | # Unlink 53 | "Unlink": "Remover hiperligação" 54 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cazary", 3 | "version": "1.2.3", 4 | "description": "jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language.", 5 | "main": "./dist/cazary.min.js", 6 | "scripts": { 7 | "build": "gulp build", 8 | "demo": "gulp demo", 9 | "js": "gulp js", 10 | "css": "gulp css", 11 | "image": "gulp image", 12 | "update-packages": "ncu" 13 | }, 14 | "style": "./dist/themes/flat/style.css", 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/shimataro/cazary.git" 18 | }, 19 | "keywords": [ 20 | "editor", 21 | "javascript", 22 | "jquery-plugin", 23 | "html", 24 | "richtext", 25 | "wysiwyg" 26 | ], 27 | "author": "shimataro", 28 | "license": "MIT", 29 | "bugs": { 30 | "url": "https://github.com/shimataro/cazary/issues" 31 | }, 32 | "homepage": "https://github.com/shimataro/cazary", 33 | "dependencies": { 34 | "jquery": ">=1.2.4" 35 | }, 36 | "devDependencies": { 37 | "apply-patch": "0.1.2", 38 | "babel-preset-env": "1.5.2", 39 | "gulp": "3.9.1", 40 | "gulp-babel": "6.1.2", 41 | "gulp-imagemin": "3.3.0", 42 | "gulp-rename": "1.2.2", 43 | "gulp-replace": "0.6.1", 44 | "gulp-sass": "3.1.0", 45 | "gulp-svg2png": "1.0.0", 46 | "gulp-uglify": "3.0.0", 47 | "gulp-yaml": "1.0.1", 48 | "imagemin-pngquant": "5.0.1", 49 | "npm-check-updates": "2.12.1" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/themes/_mixins.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | // mixins collection 3 | 4 | 5 | //////////////////////////////////////////////////////////////////////////////// 6 | // properties with vendor prefix 7 | @mixin vendor-prefix($property, $value, $vendors: "o" "ms" "moz" "webkit") 8 | { 9 | @each $vendor in $vendors 10 | { 11 | -#{$vendor}-#{$property}: $value; 12 | } 13 | #{$property}: $value; 14 | } 15 | @mixin user-select($value: none) 16 | { 17 | @include vendor-prefix("user-select", $value, "ms" "moz" "webkit"); 18 | } 19 | @mixin border-radius($value) 20 | { 21 | @include vendor-prefix("border-radius", $value, "moz" "webkit"); 22 | } 23 | @mixin box-shadow($value) 24 | { 25 | @include vendor-prefix("box-shadow", $value, "moz" "webkit"); 26 | } 27 | 28 | 29 | //////////////////////////////////////////////////////////////////////////////// 30 | // hacks 31 | 32 | @mixin inline-block 33 | { 34 | display: inline-block; 35 | 36 | // IE7 Hack 37 | *display: inline; 38 | *zoom: 1; 39 | } 40 | 41 | 42 | //////////////////////////////////////////////////////////////////////////////// 43 | // SVG background-image with fallback 44 | @mixin background-image($image, $image-svg: null) 45 | { 46 | background-image: url($image); 47 | @if $image-svg != null 48 | { 49 | background-image: -webkit-linear-gradient(transparent, transparent), url($image-svg); 50 | background-image: linear-gradient(transparent, transparent), url($image-svg); 51 | } 52 | } 53 | 54 | 55 | //////////////////////////////////////////////////////////////////////////////// 56 | // CSS sprite 57 | @mixin css-sprite($image, $x, $y, $width, $height, $image-svg: null) 58 | { 59 | text-indent: 100%; 60 | white-space: nowrap; 61 | overflow: hidden; 62 | 63 | padding: 0px !important; 64 | width: $width; 65 | height: $height; 66 | background-position: (-$x) (-$y); 67 | @include background-image($image, $image-svg); 68 | } 69 | @mixin css-sprite-offset($x: 0px, $y: 0px, $offset-x: 0px, $offset-y: 0px) 70 | { 71 | background-position: (-$x - $offset-x) (-$y - $offset-y); 72 | } 73 | -------------------------------------------------------------------------------- /gulpfile.babel.js: -------------------------------------------------------------------------------- 1 | import gulp from "gulp"; 2 | import babel from "gulp-babel"; 3 | import imagemin from "gulp-imagemin"; 4 | import rename from "gulp-rename"; 5 | import replace from "gulp-replace"; 6 | import uglify from "gulp-uglify"; 7 | import sass from "gulp-sass"; 8 | import svg2png from "gulp-svg2png"; 9 | import yaml from "gulp-yaml"; 10 | 11 | import patch from "apply-patch"; 12 | import path from "path"; 13 | import pngquant from "imagemin-pngquant"; 14 | 15 | const distdir = path.resolve("dist"); 16 | const themedir = path.join(distdir, "themes"); 17 | 18 | 19 | // default task 20 | gulp.task("default", () => 21 | { 22 | gulp.start("build"); 23 | }); 24 | 25 | 26 | // build all 27 | gulp.task("build", () => 28 | { 29 | gulp.start(["demo", "js", "css", "image"]); 30 | }); 31 | 32 | 33 | // build demo file 34 | gulp.task("demo", () => 35 | { 36 | // generate "demo-legacy.html" 37 | patch.applyPatch("./patch/demo-legacy.html.patch"); 38 | }); 39 | 40 | 41 | // embed translation data and minify 42 | gulp.task("js", () => 43 | { 44 | // generate "src/cazary-legacy.es6" 45 | patch.applyPatch("./patch/cazary-legacy.es6.patch"); 46 | 47 | // generate translation data 48 | const translation_data = {}; 49 | gulp.src("./src/i18n/*.yaml") 50 | .pipe(yaml()) 51 | .on("data", (file) => 52 | { 53 | // generate translation data 54 | const path = file.path; 55 | const found = path.match(/([-0-9a-zA-Z]+)\.json$/); 56 | if(found === null) 57 | { 58 | console.warn(path + " has been ignored"); 59 | return; 60 | } 61 | 62 | const lang = found[1]; 63 | translation_data[lang] = JSON.parse(file.contents.toString()); 64 | }) 65 | .on("end", () => 66 | { 67 | gulp.src("./src/*.es6") 68 | .pipe(replace("{/*@TRANSLATION_DATA@*/}", JSON.stringify(translation_data))) 69 | .pipe(babel({ 70 | presets: [ 71 | [ 72 | "env", 73 | { 74 | targets: { 75 | browsers: [ 76 | "ie >= 8", 77 | "opera >= 12", 78 | "last 2 firefox versions", 79 | "last 2 chrome versions", 80 | "last 2 safari versions", 81 | ], 82 | }, 83 | }, 84 | ], 85 | ], 86 | babelrc: false, 87 | })) 88 | .pipe(uglify({ 89 | output: { 90 | comments: /^!/, 91 | }, 92 | })) 93 | .pipe(rename({ 94 | suffix: ".min", 95 | extname: ".js", 96 | })) 97 | .pipe(gulp.dest(distdir)); 98 | }); 99 | }); 100 | 101 | 102 | // compile Sass 103 | gulp.task("css", () => 104 | { 105 | gulp.src("./src/themes/**/*.scss") 106 | .pipe(sass({outputStyle: "compressed"})) 107 | .pipe(gulp.dest(themedir)); 108 | }); 109 | 110 | 111 | // minify SVG and generate PNG 112 | gulp.task("image", () => 113 | { 114 | gulp.src(["./src/themes/**/*.svg", "!./**/*.orig.svg"]) 115 | .pipe(imagemin({})) 116 | .pipe(gulp.dest(themedir)) 117 | .pipe(svg2png()) 118 | .pipe(imagemin({use: [pngquant({quality: "65-80", speed: 1})]})) 119 | .pipe(gulp.dest(themedir)); 120 | }); 121 | -------------------------------------------------------------------------------- /patch/cazary-legacy.es6.patch: -------------------------------------------------------------------------------- 1 | --- src/cazary.es6 2016-12-09 04:13:00.000000000 +0900 2 | +++ src/cazary-legacy.es6 2016-12-09 04:13:00.000000000 +0900 3 | @@ -1,4 +1,4 @@ 4 | -/*! Cazary (jQuery 1.7+) - JavaScript WYSIWYG editor (https://github.com/shimataro/cazary) */ 5 | +/*! Cazary (jQuery 1.2.4+) - JavaScript WYSIWYG editor (https://github.com/shimataro/cazary) */ 6 | (function(factory) 7 | { 8 | if(typeof module === "object" && typeof module.exports === "object") 9 | @@ -689,11 +689,11 @@ 10 | { 11 | // window events 12 | $(document) 13 | - .on("click", function() 14 | + .bind("click", function() 15 | { 16 | destroyAllPanels(); 17 | }) 18 | - .on("keydown", function(event) 19 | + .bind("keydown", function(event) 20 | { 21 | if(event.keyCode === KEYCODE.ESCAPE) 22 | { 23 | @@ -796,23 +796,23 @@ 24 | 25 | // editor events 26 | $(editor.contentDocument) 27 | - .on("select", function() 28 | + .bind("select", function() 29 | { 30 | _updateCommandStatus(); 31 | }) 32 | - .on("mouseup", function() 33 | + .bind("mouseup", function() 34 | { 35 | destroyAllPanels(); 36 | _updateCommandStatus(); 37 | }) 38 | - .on("keydown", function(event) 39 | + .bind("keydown", function(event) 40 | { 41 | if(event.keyCode === KEYCODE.ESCAPE) 42 | { 43 | destroyAllPanels(); 44 | } 45 | }) 46 | - .on("keyup paste", function() 47 | + .bind("keyup paste", function() 48 | { 49 | window.setTimeout(function() 50 | { 51 | @@ -822,12 +822,12 @@ 52 | }); 53 | 54 | $(editor.contentWindow) 55 | - .on("focus", function() 56 | + .bind("focus", function() 57 | { 58 | destroyAllPanels(); 59 | _updateCommandStatus(); 60 | }) 61 | - .on("blur", function() 62 | + .bind("blur", function() 63 | { 64 | // update original element when focus is out 65 | $origin.val(editor.value()); 66 | @@ -835,7 +835,7 @@ 67 | 68 | // cancel other handler when command is disabled 69 | $cazary 70 | - .on("click", "ul.cazary-commands-list li", function(event) 71 | + .find("ul.cazary-commands-list li").bind("click", function(event) 72 | { 73 | const $target = $(this); 74 | if($target.hasClass("cazary-disabled")) 75 | @@ -847,7 +847,7 @@ 76 | 77 | // toggle RTE <-> HTML mode 78 | $cazary_command_source 79 | - .on("click", function() 80 | + .bind("click", function() 81 | { 82 | _toggleMode(); 83 | _setFocus(); 84 | @@ -858,7 +858,7 @@ 85 | { 86 | const commandName = this.toLowerCase(); 87 | $cazary 88 | - .on("click", `.cazary-command-${commandName}`, function() 89 | + .find(`.cazary-command-${commandName}`).bind("click", function() 90 | { 91 | // execute command 92 | _execCommand(commandName); 93 | @@ -868,7 +868,7 @@ 94 | { 95 | const commandName = this.toLowerCase(); 96 | $cazary 97 | - .on("click", `.cazary-command-${commandName}`, function() 98 | + .find(`.cazary-command-${commandName}`).bind("click", function() 99 | { 100 | // open panel 101 | const $target = $(this); 102 | @@ -986,7 +986,7 @@ 103 | { 104 | // set click event to "li" 105 | $panel 106 | - .on("click", "li", function() 107 | + .find("li").bind("click", function() 108 | { 109 | // execute command 110 | const $target = $(this); 111 | @@ -1007,7 +1007,7 @@ 112 | left: `${offset.left}px`, 113 | top : `${offset.top}px`, 114 | }) 115 | - .on("click", function() 116 | + .bind("click", function() 117 | { 118 | // stop bubbling 119 | return false; 120 | @@ -1186,10 +1186,11 @@ 121 | ) 122 | ); 123 | 124 | - return $panel 125 | - .on("submit", "form", onsubmit) 126 | - .on("click", ".cazary-widget-submit", onsubmit) 127 | - .on("keydown paste", ".cazary-widget-insertimage-url", onupdate); 128 | + $panel.find("form").bind("submit", onsubmit); 129 | + $panel.find(".cazary-widget-submit").bind("click", onsubmit); 130 | + $panel.find(".cazary-widget-insertimage-url").bind("keydown paste", onupdate); 131 | + 132 | + return $panel; 133 | 134 | function onsubmit() 135 | { 136 | @@ -1293,10 +1294,10 @@ 137 | ) 138 | ); 139 | 140 | - return $panel 141 | - .on("submit", "form", onsubmit) 142 | - .on("click", ".cazary-widget-submit", onsubmit) 143 | - .on("keydown paste", ".cazary-widget-createlink-url", onupdate); 144 | + $panel.find("form").bind("submit", onsubmit); 145 | + $panel.find(".cazary-widget-submit").bind("click", onsubmit); 146 | + $panel.find(".cazary-widget-createlink-url").bind("keydown paste", onupdate); 147 | + return $panel; 148 | 149 | function onsubmit() 150 | { 151 | -------------------------------------------------------------------------------- /src/themes/flat/style.scss: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | // sass --watch --no-cache --sourcemap=none --style compressed style.scss:style.css 3 | 4 | @import "../_mixins.scss"; 5 | 6 | 7 | //////////////////////////////////////////////////////////////////////////////// 8 | // configurations 9 | 10 | // color configurations 11 | $color-border: adjust-color(black, $lightness: 30%); 12 | $color-source: adjust-color(black, $lightness: 80%); 13 | $color-source-background: adjust-color(black, $lightness: 13%); 14 | $color-commands-wrapper-background: adjust-color(black, $lightness: 94%); 15 | $color-commands-list-background: adjust-color(black, $lightness: 88%); 16 | $color-command-background-hover: adjust-color(black, $lightness: 82%); 17 | $color-command-background-active: adjust-color(black, $lightness: 75%); 18 | $color-command-disabled: adjust-color(black, $lightness: 53%); 19 | $color-command-separator: adjust-color(black, $lightness: 80%); 20 | $color-panel-background: adjust-color(black, $lightness: 84%); 21 | $color-panel-border: adjust-color(black, $lightness: 70%); 22 | $color-widget-colortable-border: adjust-color(black, $lightness: 0%); 23 | $color-widget-selected-text: adjust-color(black, $lightness: 100%); 24 | $color-widget-selected-background: hsl($hue: 215deg, $saturation: 60%, $lightness: 50%); 25 | $color-widget-selected-border: adjust-color($color-widget-selected-background, $saturation: 10%, $lightness: -10%); 26 | $color-shadow: adjust-color(black, $lightness: 50%); 27 | 28 | // size configurations 29 | $size-arrow-width : 13px; 30 | $size-button-width : 28px; 31 | $size-button-height: 28px; 32 | $size-input-text-width: 400px; 33 | $size-color-pallet-width : 12px; 34 | $size-color-pallet-height: 12px; 35 | $size-preview-createlink-width : 640px; 36 | $size-preview-createlink-height: 480px; 37 | 38 | // command names and button widths 39 | // TODO: use associative array in Sass 3.3 40 | $command-names : bold italic underline strikethrough removeformat forecolor backcolor superscript subscript justifyleft justifycenter justifyright justifyfull indent outdent insertorderedlist insertunorderedlist inserthorizontalrule insertimage createlink unlink undo redo source; 41 | $command-widths: $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width + $size-arrow-width $size-button-width + $size-arrow-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width $size-button-width + $size-arrow-width $size-button-width + $size-arrow-width $size-button-width $size-button-width $size-button-width $size-button-width; 42 | 43 | 44 | //////////////////////////////////////////////////////////////////////////////// 45 | // styles 46 | 47 | [unselectable="on"] 48 | { 49 | @include user-select(none); 50 | } 51 | 52 | div.cazary 53 | { 54 | @include inline-block; 55 | 56 | border: 1px solid $color-border; 57 | overflow: hidden; 58 | 59 | iframe.cazary-edit 60 | { 61 | display: block; 62 | width: 100%; 63 | border-style: none; 64 | } 65 | textarea.cazary-source 66 | { 67 | display: block; 68 | border: none; 69 | margin: 0px; 70 | padding: 0px; 71 | color: $color-source; 72 | background-color: $color-source-background; 73 | resize: none; 74 | } 75 | 76 | // command 77 | div.cazary-commands-wrapper 78 | { 79 | padding: 3px; 80 | background-color: $color-commands-wrapper-background; 81 | overflow: hidden; 82 | 83 | ul.cazary-commands-list 84 | { 85 | margin: 1px 2px; 86 | padding: 0px; 87 | float: left; 88 | list-style-type: none; 89 | 90 | background-color: $color-commands-list-background; 91 | overflow: hidden; 92 | 93 | li 94 | { 95 | margin: 0px; 96 | float: left; 97 | cursor: default; 98 | 99 | font-family: sans-serif; 100 | 101 | @include css-sprite("sprite.png", 0, 0, $size-button-width, $size-button-height, "sprite.svg"); 102 | line-height: $size-button-height; 103 | 104 | &:hover 105 | { 106 | background-color: $color-command-background-hover; 107 | } 108 | &.cazary-active 109 | { 110 | background-color: $color-command-background-active !important; 111 | } 112 | &.cazary-disabled 113 | { 114 | color: $color-command-disabled !important; 115 | border-color: transparent !important; 116 | background-color: transparent !important; 117 | } 118 | &.cazary-command-separator 119 | { 120 | width: 0px !important; 121 | margin: 0px 2px !important; 122 | border: none !important; 123 | border-left: 1px solid $color-command-separator !important; 124 | background-color: transparent !important; 125 | } 126 | &.cazary-command-fontname, 127 | &.cazary-command-fontsize 128 | { 129 | width: auto !important; 130 | padding: 0px $size-arrow-width 0px 4px !important; 131 | text-indent: 0px !important; 132 | 133 | background: 134 | { 135 | repeat: no-repeat; 136 | position: center right; 137 | } 138 | @include background-image("arrow-down.png", "arrow-down.svg"); 139 | } 140 | 141 | // command buttons 142 | $offset-x: 0; 143 | @each $command-name in $command-names 144 | { 145 | $index: index($command-names, $command-name); 146 | $width: nth($command-widths, $index); 147 | 148 | &.cazary-command-#{$command-name} 149 | { 150 | width: $width; 151 | @include css-sprite-offset($offset-x: $offset-x); 152 | 153 | &.cazary-disabled 154 | { 155 | @include css-sprite-offset($offset-x: $offset-x, $offset-y: $size-button-height); 156 | } 157 | } 158 | 159 | $offset-x: $offset-x + $width; 160 | } 161 | } 162 | } 163 | } 164 | } 165 | 166 | // panel 167 | div.cazary-panel 168 | { 169 | position: absolute; 170 | padding: 2px; 171 | border: 1px solid $color-panel-border; 172 | background-color: $color-panel-background; 173 | 174 | font-family: sans-serif; 175 | 176 | @include box-shadow(2px 2px 4px $color-shadow); 177 | filter: progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=3, color=#808080); 178 | 179 | &.cazary-panel-forecolor, 180 | &.cazary-panel-backcolor, 181 | &.cazary-panel-insertimage, 182 | &.cazary-panel-createlink 183 | { 184 | padding: 4px !important; 185 | } 186 | 187 | // widget 188 | ul.cazary-widget-select 189 | { 190 | margin: 0px; 191 | padding: 0px; 192 | list-style-type: none; 193 | 194 | li 195 | { 196 | padding: 2px; 197 | cursor: pointer; 198 | border: 1px solid transparent; 199 | 200 | &:hover 201 | { 202 | color: $color-widget-selected-text; 203 | background-color: $color-widget-selected-background; 204 | border: 1px solid $color-widget-selected-border; 205 | } 206 | } 207 | } 208 | ul.cazary-widget-select-color 209 | { 210 | margin: 0px; 211 | padding: 0px; 212 | list-style-type: none; 213 | overflow: hidden; 214 | 215 | li 216 | { 217 | margin: 1px; 218 | padding: 0px; 219 | float: left; 220 | border: 1px solid $color-panel-background; 221 | cursor: pointer; 222 | 223 | width : $size-color-pallet-width; 224 | height: $size-color-pallet-height; 225 | 226 | text-indent: 100%; 227 | white-space: nowrap; 228 | overflow: hidden; 229 | 230 | @include border-radius(3px); 231 | 232 | &:hover 233 | { 234 | border-color: $color-widget-colortable-border; 235 | } 236 | } 237 | } 238 | input.cazary-widget-insertimage-url, 239 | input.cazary-widget-createlink-url 240 | { 241 | width: $size-input-text-width; 242 | } 243 | img.cazary-widget-insertimage-img 244 | { 245 | } 246 | fieldset.cazary-widget-preview 247 | { 248 | display: none; 249 | } 250 | iframe.cazary-widget-preview-createlink 251 | { 252 | width : $size-preview-createlink-width; 253 | height: $size-preview-createlink-height; 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Cazary 2 | ====== 3 | 4 | [![Join the chat at https://gitter.im/shimataro/cazary](https://badges.gitter.im/shimataro/cazary.svg)](https://gitter.im/shimataro/cazary?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | [![NPM Downloads](https://img.shields.io/npm/dm/cazary.svg)](https://www.npmjs.com/package/cazary) 6 | 7 | jQuery plugin of WYSIWYG editor that aims for fast, lightweight, stylish, customizable, cross-browser, and multi-language. 8 | 9 | [![NPM](https://nodei.co/npm/cazary.svg?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/cazary/) 10 | 11 | ## jQuery version 12 | 13 | * [1.7+](http://code.jquery.com/jquery-1.7.js) (cazary.js) 14 | * [1.2.4+](http://code.jquery.com/jquery-1.2.4.js) (cazary-legacy.js) 15 | 16 | ## Supported browsers 17 | 18 | * [Internet Explorer](http://windows.microsoft.com/en-us/internet-explorer/download-ie): 8 or later 19 | * [Mozilla Firefox](http://www.mozilla.com/firefox/): Latest version 20 | * [Google Chrome](http://www.google.com/chrome/): Latest version 21 | * [Opera](http://www.opera.com/): version 12(Presto based), 15([Blink](http://www.chromium.org/blink) based) 22 | * [Safari for Windows](http://support.apple.com/kb/DL1531): version 5 23 | * [Safari for Mac](https://www.apple.com/jp/safari/): Latest version 24 | 25 | ## Supported Languages 26 | 27 | * English 28 | * [Japanese](src/i18n/ja.yaml) 29 | * [Polish](src/i18n/pl.yaml) 30 | * [Portuguese](src/i18n/pt.yaml) 31 | * [Brazilian Portuguese](src/i18n/pt-br.yaml) 32 | 33 | ## How to use 34 | 35 | ### Traditional method 36 | 37 | * Copy `dist` to public directory 38 | * Load the theme CSS 39 | 40 | ```html 41 | 42 | ``` 43 | 44 | * Load jQuery and `cazary.min.js` 45 | 46 | ```html 47 | 48 | 49 | ``` 50 | 51 | * Write JavaScript like this: 52 | ```js 53 | $(function($) 54 | { 55 | // that's it! 56 | $("textarea").cazary(); 57 | 58 | // initial mode: HTML 59 | $("textarea").cazary({ 60 | mode: "html" 61 | }); 62 | 63 | // full commands 64 | $("textarea").cazary({ 65 | commands: "FULL" 66 | }); 67 | }); 68 | ``` 69 | 70 | see [demo page](demo.html) 71 | 72 | ### CommonJS method 73 | 74 | * Install Cazary by simply typing `npm install cazary` 75 | * Copy `dist/themes` to public directory (`*.js` is not necessary) 76 | * Load the theme CSS 77 | * Write JavaScript like this: 78 | ```js 79 | // this returns a jQuery object! 80 | var $ = require("cazary"); 81 | $(function($) 82 | { 83 | $("textarea").cazary(); 84 | }); 85 | ``` 86 | 87 | ## Options 88 | 89 | | name | type | description | default | 90 | |------|------|-------------|---------| 91 | | `mode` | String | initial mode ("rte" or "html") | "rte" | 92 | | `style` | String | style of RTE area | "body{margin:0px;padding:8px;}p{margin:0px;padding:0px;}" | 93 | | `fontnames` | Array | array of fontname | ["Arial", "Arial Black", "Comic Sans MS", "Courier New", "Narrow", "Garamond", "Georgia", "Impact", "Sans Serif", "Serif", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana" ] | 94 | | `colors` | Array (two-dimensional) | color table | [
["#ffffff", "#ffcccc", "#ffcc99", "#ffff99", "#ffffcc", "#99ff99", "#99ffff", "#ccffff", "#ccccff", "#ffccff"],
["#cccccc", "#ff6666", "#ff9966", "#ffff66", "#ffff33", "#66ff99", "#33ffff", "#66ffff", "#9999ff", "#ff99ff"],
["#bbbbbb", "#ff0000", "#ff9900", "#ffcc66", "#ffff00", "#33ff33", "#66cccc", "#33ccff", "#6666cc", "#cc66cc"],
["#999999", "#cc0000", "#ff6600", "#ffcc33", "#ffcc00", "#33cc00", "#00cccc", "#3366ff", "#6633ff", "#cc33cc"],
["#666666", "#990000", "#cc6600", "#cc9933", "#999900", "#009900", "#339999", "#3333ff", "#6600cc", "#993399"],
["#333333", "#660000", "#993300", "#996633", "#666600", "#006600", "#336666", "#000099", "#333399", "#663366"],
["#000000", "#330000", "#663300", "#663333", "#333300", "#003300", "#003333", "#000066", "#330099", "#330033"]
] | 95 | | `commands` | String or Array | pre-defined macro or (array of) space-separated commands (see below) | "STANDARD" | 96 | 97 | ## Commands 98 | 99 | * `commands` option must be specified one of followings: 100 | * one of "pre-defined macros" 101 | * any combination of space-separated commands or `|`(separator) 102 | * set of commands can be array 103 | * see below about pre-defined macros and commands 104 | 105 | ### pre-defined macros 106 | 107 | | name | is expanded to... | 108 | |------|----------------| 109 | | `MINIMAL` | ["bold italic underline strikethrough removeformat"] | 110 | | `STANDARD` | [
"fontname fontsize",
"bold italic underline strikethrough removeformat | forecolor backcolor | superscript subscript",
"source"
] | 111 | | `FULL` | [
"fontname fontsize",
"bold italic underline strikethrough removeformat | forecolor backcolor | superscript subscript",
"justifyleft justifycenter justifyright justifyfull | indent outdent | insertorderedlist insertunorderedlist",
"inserthorizontalrule insertimage createlink unlink",
"undo redo",
"source"
] | 112 | 113 | ### commands (inline styles) 114 | 115 | | name | description | 116 | |------|-------------| 117 | | `fontname` | set font name | 118 | | `fontsize` | set font size | 119 | | `bold` | set style to bold | 120 | | `italic` | set style to italic | 121 | | `underline` | set style to underline | 122 | | `strikethrough` | set style to strikethrough | 123 | | `removeformat` | remove all format | 124 | | `forecolor` | set foreground color | 125 | | `backcolor` | set background color | 126 | | `superscript` | set style to superscript | 127 | | `subscript` | set style to subscript | 128 | 129 | ### commands (block styles) 130 | 131 | | name | description | 132 | |------|-------------| 133 | | `justifyleft` | align current block to left | 134 | | `justifycenter` | align current block to center | 135 | | `justifyright` | align current block to right | 136 | | `justifyfull` | justify current block | 137 | | `indent` | indent current block | 138 | | `outdent` | un-indent current block | 139 | | `insertorderedlist` | set current block to ordered list | 140 | | `insertunorderedlist` | set current block to un-ordered list | 141 | 142 | ### commands (insertion / creation) 143 | 144 | | name | description | 145 | |------|-------------| 146 | | `inserthorizontalrule` | insert horizontal rule to current position | 147 | | `insertimage` | insert image to current position current position | 148 | | `createlink` | create link to selected text | 149 | | `unlink` | remove link of selected text | 150 | 151 | ### commands (editing) 152 | 153 | | name | description | 154 | |------|-------------| 155 | | `undo` | undo command | 156 | | `redo` | undo the undone command | 157 | | `source` | toggle HTML/RTE mode | 158 | 159 | ## Project page 160 | 161 | http://github.com/shimataro/cazary 162 | 163 | ## Documents for developers 164 | 165 | * [How to build](doc/HOW_TO_BUILD.md) 166 | * [How to translate](doc/HOW_TO_TRANSLATE.md) 167 | 168 | ## Release note 169 | 170 | * 2016-12-10 *version 1.2.3* 171 | * Using ECMAScript6 syntax 172 | * Add `npm run update-packages` command 173 | 174 | * 2016-10-29 *version 1.2.2* 175 | * `change` event refreshes WYSIWYG area 176 | 177 | * 2016-03-06 *version 1.2.1* 178 | * Generate `demo-legacy.html` and `src/cazary-legacy.js` automatically 179 | * Modularize Sass mixins 180 | * Equip documents 181 | 182 | * 2016-02-19 *version 1.2.0* 183 | * SVG toolbar icons (for HD screen) 184 | * Changed directory structure 185 | 186 | * 2015-11-22 *version 1.1.2* 187 | * Supports Portuguese/Brazilian Portuguese (by [Luiz Eduardo Simões](https://github.com/LinkForce)) 188 | * build method: `npm run build` 189 | 190 | * 2015-11-07 *version 1.1.1* 191 | * `require("cazary")` returns a jQuery object 192 | 193 | * 2015-11-06 *version 1.1.0* 194 | * Supports [CommonJS](http://www.commonjs.org/). 195 | * Translation data format to [YAML](http://yaml.org/). 196 | * Build by [gulp.js](http://gulpjs.com/). 197 | 198 | * 2015-10-08 *version 1.0.1* 199 | * Fixed Polish translation. 200 | 201 | * 2015-10-06 *version 1.0* 202 | * First release. 203 | 204 | ## Recruitment 205 | 206 | I'm looking for human resources. 207 | [Please contact me in my GitHub page!](https://github.com/shimataro) 208 | 209 | * **translators** - except English and Japanese (translate from English or Japanese) 210 | * **designers** - please create cool themes! 211 | 212 | ## Credits 213 | 214 | * **[yuqianyumo](https://github.com/jqueryscript)** - Introducing Cazary in [website](http://www.jqueryscript.net/text/Simple-Html-WYSIWYG-Editor-Plugin-with-jQuery-Cazary.html) 215 | * **Paweł Klockiewicz** - Polish Translation 216 | * **[Luiz Eduardo Simões](https://github.com/LinkForce)** - Portuguese/Brazilian Portuguese Translation 217 | * **[GNU FreeFont](https://www.gnu.org/software/freefont/)** - "flat" theme uses FreeSans 218 | * **Brad Owen** - Testing on Safari for Mac 219 | -------------------------------------------------------------------------------- /dist/themes/flat/style.css: -------------------------------------------------------------------------------- 1 | [unselectable="on"]{-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none}div.cazary{display:inline-block;*display:inline;*zoom:1;border:1px solid #4d4d4d;overflow:hidden}div.cazary iframe.cazary-edit{display:block;width:100%;border-style:none}div.cazary textarea.cazary-source{display:block;border:none;margin:0px;padding:0px;color:#ccc;background-color:#212121;resize:none}div.cazary div.cazary-commands-wrapper{padding:3px;background-color:#f0f0f0;overflow:hidden}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list{margin:1px 2px;padding:0px;float:left;list-style-type:none;background-color:#e0e0e0;overflow:hidden}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li{margin:0px;float:left;cursor:default;font-family:sans-serif;text-indent:100%;white-space:nowrap;overflow:hidden;padding:0px !important;width:28px;height:28px;background-position:0 0;background-image:url("sprite.png");background-image:-webkit-linear-gradient(transparent, transparent),url("sprite.svg");background-image:linear-gradient(transparent, transparent),url("sprite.svg");line-height:28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li:hover{background-color:#d1d1d1}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-active{background-color:#bfbfbf !important}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-disabled{color:#878787 !important;border-color:transparent !important;background-color:transparent !important}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-separator{width:0px !important;margin:0px 2px !important;border:none !important;border-left:1px solid #ccc !important;background-color:transparent !important}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-fontname,div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-fontsize{width:auto !important;padding:0px 13px 0px 4px !important;text-indent:0px !important;background-repeat:no-repeat;background-position:center right;background-image:url("arrow-down.png");background-image:-webkit-linear-gradient(transparent, transparent),url("arrow-down.svg");background-image:linear-gradient(transparent, transparent),url("arrow-down.svg")}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-bold{width:28px;background-position:0px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-bold.cazary-disabled{background-position:0px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-italic{width:28px;background-position:-28px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-italic.cazary-disabled{background-position:-28px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-underline{width:28px;background-position:-56px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-underline.cazary-disabled{background-position:-56px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-strikethrough{width:28px;background-position:-84px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-strikethrough.cazary-disabled{background-position:-84px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-removeformat{width:28px;background-position:-112px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-removeformat.cazary-disabled{background-position:-112px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-forecolor{width:41px;background-position:-140px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-forecolor.cazary-disabled{background-position:-140px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-backcolor{width:41px;background-position:-181px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-backcolor.cazary-disabled{background-position:-181px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-superscript{width:28px;background-position:-222px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-superscript.cazary-disabled{background-position:-222px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-subscript{width:28px;background-position:-250px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-subscript.cazary-disabled{background-position:-250px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyleft{width:28px;background-position:-278px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyleft.cazary-disabled{background-position:-278px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifycenter{width:28px;background-position:-306px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifycenter.cazary-disabled{background-position:-306px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyright{width:28px;background-position:-334px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyright.cazary-disabled{background-position:-334px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyfull{width:28px;background-position:-362px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-justifyfull.cazary-disabled{background-position:-362px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-indent{width:28px;background-position:-390px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-indent.cazary-disabled{background-position:-390px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-outdent{width:28px;background-position:-418px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-outdent.cazary-disabled{background-position:-418px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertorderedlist{width:28px;background-position:-446px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertorderedlist.cazary-disabled{background-position:-446px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertunorderedlist{width:28px;background-position:-474px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertunorderedlist.cazary-disabled{background-position:-474px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-inserthorizontalrule{width:28px;background-position:-502px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-inserthorizontalrule.cazary-disabled{background-position:-502px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertimage{width:41px;background-position:-530px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-insertimage.cazary-disabled{background-position:-530px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-createlink{width:41px;background-position:-571px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-createlink.cazary-disabled{background-position:-571px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-unlink{width:28px;background-position:-612px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-unlink.cazary-disabled{background-position:-612px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-undo{width:28px;background-position:-640px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-undo.cazary-disabled{background-position:-640px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-redo{width:28px;background-position:-668px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-redo.cazary-disabled{background-position:-668px -28px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-source{width:28px;background-position:-696px 0px}div.cazary div.cazary-commands-wrapper ul.cazary-commands-list li.cazary-command-source.cazary-disabled{background-position:-696px -28px}div.cazary-panel{position:absolute;padding:2px;border:1px solid #b3b3b3;background-color:#d6d6d6;font-family:sans-serif;-moz-box-shadow:2px 2px 4px gray;-webkit-box-shadow:2px 2px 4px gray;box-shadow:2px 2px 4px gray;filter:progid:DXImageTransform.Microsoft.Shadow(direction=135, strength=3, color=#808080)}div.cazary-panel.cazary-panel-forecolor,div.cazary-panel.cazary-panel-backcolor,div.cazary-panel.cazary-panel-insertimage,div.cazary-panel.cazary-panel-createlink{padding:4px !important}div.cazary-panel ul.cazary-widget-select{margin:0px;padding:0px;list-style-type:none}div.cazary-panel ul.cazary-widget-select li{padding:2px;cursor:pointer;border:1px solid transparent}div.cazary-panel ul.cazary-widget-select li:hover{color:#fff;background-color:#3373cc;border:1px solid #1f5aad}div.cazary-panel ul.cazary-widget-select-color{margin:0px;padding:0px;list-style-type:none;overflow:hidden}div.cazary-panel ul.cazary-widget-select-color li{margin:1px;padding:0px;float:left;border:1px solid #d6d6d6;cursor:pointer;width:12px;height:12px;text-indent:100%;white-space:nowrap;overflow:hidden;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}div.cazary-panel ul.cazary-widget-select-color li:hover{border-color:#000}div.cazary-panel input.cazary-widget-insertimage-url,div.cazary-panel input.cazary-widget-createlink-url{width:400px}div.cazary-panel fieldset.cazary-widget-preview{display:none}div.cazary-panel iframe.cazary-widget-preview-createlink{width:640px;height:480px} 2 | -------------------------------------------------------------------------------- /dist/themes/flat/sprite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/cazary.min.js: -------------------------------------------------------------------------------- 1 | "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*! Cazary (jQuery 1.7+) - JavaScript WYSIWYG editor (https://github.com/shimataro/cazary) */ 2 | !function(e){"object"===("undefined"==typeof module?"undefined":_typeof(module))&&"object"===_typeof(module.exports)?module.exports=e(require("jquery"),window):e(jQuery,window)}(function(e,t,r){var a=t.document,n=function(){function e(){try{var e=t.navigator;return e.browserLanguage||e.language||e.userLanguage}catch(e){return r}}var a={ja:{Font:"フォント",Size:"サイズ",Bold:"太字",Italic:"斜体",Underline:"下線","Strike-Through":"打ち消し線","Remove Format":"書式をクリア","Foreground Color":"文字色","Background Color":"背景色",Superscript:"上付き文字",Subscript:"下付き文字","Justify Left":"左揃え","Justify Center":"中央揃え","Justify Right":"右揃え","Justify Full":"両端揃え",Indent:"字下げ",Outdent:"字下げ解除","Ordered List":"番号付きリスト","Unordered List":"箇条書き","Horizontal Rule":"横線","Insert Image":"画像挿入","Insert Link":"リンク挿入",Undo:"元に戻す",Redo:"やり直し","Show Source":"HTMLソース表示","Size 1":"サイズ1","Size 2":"サイズ2","Size 3":"サイズ3","Size 4":"サイズ4","Size 5":"サイズ5","Size 6":"サイズ6","Size 7":"サイズ7","Input image URL":"画像URLを入力してください","Input link URL or E-mail address":"リンク先URLまたはメールアドレスを入力してください",Preview:"プレビュー",Insert:"挿入",Unlink:"リンク解除"},pl:{Font:"Czcionka",Size:"Rozmiar",Bold:"Pogrubienie",Italic:"Kursywa",Underline:"Podkreślenie","Strike-Through":"Przekreślenie","Remove Format":"Usuń formatowanie","Foreground Color":"Kolor czcionki","Background Color":"Kolor tła",Superscript:"Indeks górny",Subscript:"Indeks dolny","Justify Left":"Wyrównanie do lewej","Justify Center":"Wyrównaj do środka","Justify Right":"Wyrównaj do prawej","Justify Full":"Wyjustowanie",Indent:"Zwiększ wcięcie",Outdent:"Zmniejsz wcięcie","Ordered List":"Numerowanie","Unordered List":"Punktory","Horizontal Rule":"Pozioma linia","Insert Image":"Wstaw obrazek","Insert Link":"Wstaw link",Undo:"Cofnij",Redo:"Powtórz","Show Source":"Pokaż źródło","Size 1":"Rozmiar 1","Size 2":"Rozmiar 2","Size 3":"Rozmiar 3","Size 4":"Rozmiar 4","Size 5":"Rozmiar 5","Size 6":"Rozmiar 6","Size 7":"Rozmiar 7","Input image URL":"Adres obrazka","Input link URL or E-mail address":"Wprowadź adres URL lub E-mail",Preview:"Podgląd",Insert:"Wstaw",Unlink:"Usuń link"},"pt-br":{Font:"Fonte",Size:"Tamanho",Bold:"Negrito",Italic:"Itálico",Underline:"Sublinhado","Strike-Through":"Tachado","Remove Format":"Remover formatação","Foreground Color":"Cor da fonte","Background Color":"Sombreamento",Superscript:"Sobrescrito",Subscript:"Subscrito","Justify Left":"Alinhar à esquerda","Justify Center":"Centralizar","Justify Right":"Alinhar à direita","Justify Full":"Justificar",Indent:"Aumentar recuo",Outdent:"Diminuir recuo","Ordered List":"Numeração","Unordered List":"Marcadores","Horizontal Rule":"Linha horizontal","Insert Image":"Inserir imagem","Insert Link":"Inserir hiperlink",Undo:"Desfazer",Redo:"Refazer","Show Source":"Mostrar fonte","Size 1":"Tamanho 1","Size 2":"Tamanho 2","Size 3":"Tamanho 3","Size 4":"Tamanho 4","Size 5":"Tamanho 5","Size 6":"Tamanho 6","Size 7":"Tamanho 7","Input image URL":"Insira a URL da imagem","Input link URL or E-mail address":"Insira uma URL ou endereço de e-mail",Preview:"Pré-visualização",Insert:"Inserir",Unlink:"Remover hiperlink"},pt:{Font:"Tipo de letra",Size:"Tamanho",Bold:"Negrito",Italic:"Itálico",Underline:"Sublinhado","Strike-Through":"Rasurado","Remove Format":"Remover formatação","Foreground Color":"Cor do tipo de letra","Background Color":"Realçar",Superscript:"Sobrescrito",Subscript:"Subscrito","Justify Left":"Alinhar à esquerda","Justify Center":"Centrar horizontalmente","Justify Right":"Alinhar à direita","Justify Full":"Justificado",Indent:"Aumentar avanço",Outdent:"Diminuir avanço","Ordered List":"Numeração","Unordered List":"Marcas","Horizontal Rule":"Linha horizontal","Insert Image":"Inserir imagem","Insert Link":"Inserir hiperligação",Undo:"Anular",Redo:"Refazer","Show Source":"Mostrar código-fonte","Size 1":"Tamanho 1","Size 2":"Tamanho 2","Size 3":"Tamanho 3","Size 4":"Tamanho 4","Size 5":"Tamanho 5","Size 6":"Tamanho 6","Size 7":"Tamanho 7","Input image URL":"Insira a URL da imagem","Input link URL or E-mail address":"Insira uma URL ou endereço de correio eletrónico",Preview:"Pré-visualização",Insert:"Inserir",Unlink:"Remover hiperligação"}},n=function(){var t=e().toLowerCase(),n=a[t];return n!==r?n:(t=t.split("-")[0],(n=a[t])!==r?n:{})}();return function(e){return n[e]===r?e:n[e]}}(),i=function(){var e=/^[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~](\.?[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~])*@([\w\-]+\.)+(\w+)$/;return function(t){return!(t.length>256)&&(!(t.indexOf("@")>64)&&null!==t.match(e))}}(),o=function(){var e=/^https?:\/\//;return function(t){return null!==t.match(e)}}(),c=function(){var t={NORMAL:0,ACTIVE:1,DISABLED:2},a={FONTNAME:"fontname",FONTSIZE:"fontsize",BOLD:"bold",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"strikethrough",REMOVEFORMAT:"removeformat",FORECOLOR:"forecolor",BACKCOLOR:"backcolor",HILITECOLOR:"hilitecolor",SUPERSCRIPT:"superscript",SUBSCRIPT:"subscript",JUSTIFYLEFT:"justifyleft",JUSTIFYCENTER:"justifycenter",JUSTIFYRIGHT:"justifyright",JUSTIFYFULL:"justifyfull",INDENT:"indent",OUTDENT:"outdent",ORDEREDLIST:"insertorderedlist",UNORDEREDLIST:"insertunorderedlist",INSERTHORIZONTALRULE:"inserthorizontalrule",INSERTIMAGE:"insertimage",CREATELINK:"createlink",UNLINK:"unlink",UNDO:"undo",REDO:"redo"};return function(n,i,o){function c(e,t){e===a.BACKCOLOR&&s(a.HILITECOLOR)&&(e=a.HILITECOLOR),p(),R.execCommand(e,!1,t)}function s(e){try{return R.queryCommandEnabled(e)}catch(e){return!1}}function l(){var e=R.body.innerHTML;return e=e.replace(/(<\/?)p\b/gi,"$1div").replace(/(<\/?)em\b/gi,"$1i").replace(/(<\/?)strong\b/gi,"$1b").replace(/(<\/?)del\b/gi,"$1s")}function u(e){R.body.innerHTML=e}function d(e){R.open(),R.write(e),R.close()}function f(){return C.getSelection?C.getSelection().anchorNode:R.selection.createRange().parentElement()}function m(){if(C.getSelection){var e=C.getSelection();return null===e||0===e.rangeCount?"":e.getRangeAt(0).toString()}return R.selection.createRange().text}function p(){C.focus(),null!==I&&I.select()}var C=n.contentWindow,R=C.document;n.contentDocument&&(R=n.contentDocument);var I=null;this.STATUS=t,this.COMMAND=a,this.contentWindow=C,this.contentDocument=R,this.getCurrentStatus=function(){var n={fontname:null,fontsize:null,forecolor:null,backcolor:null,bold:t.NORMAL,italic:t.NORMAL,underline:t.NORMAL,strikethrough:t.NORMAL,superscript:t.NORMAL,subscript:t.NORMAL,justifyleft:t.NORMAL,justifycenter:t.NORMAL,justifyright:t.NORMAL,justifyfull:t.NORMAL,insertorderedlist:t.NORMAL,insertunorderedlist:t.NORMAL,createlink:t.NORMAL,unlink:t.NORMAL,undo:t.NORMAL,redo:t.NORMAL};""===m()&&(n[a.CREATELINK]=t.DISABLED,n[a.UNLINK]=t.DISABLED),e.each([a.CREATELINK,a.UNLINK,a.UNDO,a.REDO],function(e,r){s(r)||(n[r]=t.DISABLED)});for(var i=f();null!==i;){if(i.tagName!==r)switch(i.tagName.toLowerCase()){case"b":case"strong":n[a.BOLD]=t.ACTIVE;break;case"i":case"em":n[a.ITALIC]=t.ACTIVE;break;case"u":n[a.UNDERLINE]=t.ACTIVE;break;case"s":case"strike":case"del":n[a.STRIKETHROUGH]=t.ACTIVE;break;case"sup":n[a.SUPERSCRIPT]=t.ACTIVE;break;case"sub":n[a.SUBSCRIPT]=t.ACTIVE;break;case"ol":n[a.ORDEREDLIST]=t.ACTIVE;break;case"ul":n[a.UNORDEREDLIST]=t.ACTIVE;break;case"font":i.face.length>0&&null===n[a.FONTNAME]&&(n[a.FONTNAME]=i.face),i.size.length>0&&null===n[a.FONTSIZE]&&(n[a.FONTSIZE]=i.size),i.color.length>0&&null===n[a.FORECOLOR]&&(n[a.FORECOLOR]=i.color)}if(i.align!==r)switch(i.align.toLowerCase()){case"left":n[a.JUSTIFYLEFT]=t.ACTIVE;break;case"center":n[a.JUSTIFYCENTER]=t.ACTIVE;break;case"right":n[a.JUSTIFYRIGHT]=t.ACTIVE;break;case"justify":n[a.JUSTIFYFULL]=t.ACTIVE}if(i.style!==r){var o=i.style;if(o.fontFamily!==r){var c=o.fontFamily;c.length>0&&null===n[a.FONTNAME]&&(n[a.FONTNAME]=c)}if(o.fontWeight!==r)switch(o.fontWeight.toLowerCase()){case"bold":case"bolder":n[a.BOLD]=t.ACTIVE}if(o.fontStyle!==r)switch(o.fontStyle.toLowerCase()){case"italic":case"oblique":n[a.ITALIC]=t.ACTIVE}if(o.textDecoration!==r){var l=o.textDecoration.toLowerCase();-1!==l.indexOf("underline")&&(n[a.UNDERLINE]=t.ACTIVE),-1!==l.indexOf("line-through")&&(n[a.STRIKETHROUGH]=t.ACTIVE)}if(o.color!==r){var u=o.color;u.length>0&&null===n[a.FORECOLOR]&&(n[a.FORECOLOR]=u)}if(o.backgroundColor!==r){var d=o.backgroundColor;d.length>0&&null===n[a.BACKCOLOR]&&(n[a.BACKCOLOR]=d)}if(o.verticalAlign!==r)switch(o.verticalAlign.toLowerCase()){case"super":n[a.SUPERSCRIPT]=t.ACTIVE;break;case"sub":n[a.SUBSCRIPT]=t.ACTIVE}if(o.textAlign!==r)switch(o.textAlign.toLowerCase()){case"left":n[a.JUSTIFYLEFT]=t.ACTIVE;break;case"center":n[a.JUSTIFYCENTER]=t.ACTIVE;break;case"right":n[a.JUSTIFYRIGHT]=t.ACTIVE;break;case"justify":n[a.JUSTIFYFULL]=t.ACTIVE}}i=i.parentNode}return R.selection&&(I=R.selection.createRange()),n},this.execCommand=c,this.canExecCommand=s,this.value=function(e){if(e===r)return l();u(e)},this.getSelectedText=m,this.insertText=function(e,t){if(C.getSelection){var r=R.createTextNode(e),n=C.getSelection();n.deleteFromDocument(),n.getRangeAt(0).insertNode(r)}else R.selection.createRange().text=e;t?c(a.REMOVEFORMAT):p()},this.setFocus=p,function(e){var t='";R.designMode="on",d(t),u(e)}(i)}}();return e.fn.extend({cazary:function(e){function s(t){"string"==typeof t&&(t=m[t]!==r?m[t]:[t]);var a=e("
").addClass("cazary-commands-wrapper");return e.each(t,function(){var t=e("