Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.46.1 #1392

Merged
merged 11 commits into from
Apr 23, 2024
Merged

2.46.1 #1392

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/deploy-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Checkout
uses: actions/checkout@v2

Expand All @@ -32,7 +34,7 @@ jobs:
fi

- name: Install dependencies
run: npm install && npm audit fix
run: npm ci

- name: Build
run: npm run build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/issue-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
manage-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run script to manage issues
run: node .github/scripts/manage-issues.js
env:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ bower_components/**

#dev
.git/**
package-lock.json
/.vs
4 changes: 2 additions & 2 deletions dist/suneditor.min.js

Large diffs are not rendered by default.

14,332 changes: 14,332 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suneditor",
"version": "2.46.0",
"version": "2.46.1",
"description": "Vanilla javascript based WYSIWYG web editor, with no dependencies",
"author": "JiHong.Lee",
"license": "MIT",
Expand Down Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"@babel/core": "^7.21.3",
"@octokit/rest": "^20.1.0",
"@webpack-cli/init": "^0.2.2",
"@webpack-cli/init": "^1.1.3",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^0.1.19",
"codemirror": "^5.61.0",
Expand Down
7 changes: 7 additions & 0 deletions sample/html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ <h4 style="color: #b94a48;">--Layout</h4>
<label>Language&nbsp;&nbsp;</label>
<select id="language">
<option value="ckb">ckb</option>
<option value="cs">cs</option>
<option value="da">da</option>
<option value="de">de</option>
<option value="en" selected>en</option>
Expand All @@ -137,12 +138,14 @@ <h4 style="color: #b94a48;">--Layout</h4>
<option value="ja">ja</option>
<option value="ko">ko</option>s
<option value="lv">lv</option>
<option value="nl">nl</option>
<option value="pl">pl</option>
<option value="pt_br">pt_br</option>
<option value="ro">ro</option>
<option value="ru">ru</option>
<option value="se">se</option>
<option value="ua">ua</option>
<option value="ur">ur</option>
<option value="zh_cn">zh_cn</option>
</select>
<br><br>
Expand Down Expand Up @@ -565,6 +568,7 @@ <h2 class="sub-title">Applied options</h2>
</style>
<!-- languages -->
<script src="../../src/lang/ckb.js"></script>
<script src="../../src/lang/cs.js"></script>
<script src="../../src/lang/da.js"></script>
<script src="../../src/lang/de.js"></script>
<script src="../../src/lang/en.js"></script>
Expand All @@ -575,13 +579,16 @@ <h2 class="sub-title">Applied options</h2>
<script src="../../src/lang/ja.js"></script>
<script src="../../src/lang/ko.js"></script>
<script src="../../src/lang/lv.js"></script>
<script src="../../src/lang/nl.js"></script>
<script src="../../src/lang/pl.js"></script>
<script src="../../src/lang/pt_br.js"></script>
<script src="../../src/lang/ro.js"></script>
<script src="../../src/lang/ru.js"></script>
<script src="../../src/lang/se.js"></script>
<script src="../../src/lang/ua.js"></script>
<script src="../../src/lang/ur.js"></script>
<script src="../../src/lang/zh_cn.js"></script>

<script>
var langSelect = document.getElementById('language');
var modeSelect = document.getElementById('mode');
Expand Down
5 changes: 5 additions & 0 deletions src/lang/cs.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Lang } from './Lang';

declare const cs: Lang;

export default cs;
188 changes: 188 additions & 0 deletions src/lang/cs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/*
* wysiwyg web editor
*
* suneditor.js
* Copyright 2017 JiHong Lee.
* MIT license.
*/
'use strict';

(function (global, factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = global.document ?
factory(global, true) :
function (w) {
if (!w.document) {
throw new Error('SUNEDITOR_LANG a window with a document');
}
return factory(w);
};
} else {
factory(global);
}
}(typeof window !== 'undefined' ? window : this, function (window, noGlobal) {
const lang = {
code: 'cs',
toolbar: {
default: 'Výchozí',
save: 'Uložit',
font: 'Písmo',
formats: 'Formáty',
fontSize: 'Velikost',
bold: 'Tučné',
underline: 'Podtržení',
italic: 'Kurzíva',
strike: 'Přeškrtnutí',
subscript: 'Dolní index',
superscript: 'Horní index',
removeFormat: 'Odebrat formát',
fontColor: 'Barva písma',
hiliteColor: 'Barva zvýraznění',
indent: 'Odsadit',
outdent: 'Předsadit',
align: 'Zarovnat',
alignLeft: 'Zarovnat vlevo',
alignRight: 'Zarovnat vpravo',
alignCenter: 'Zarovnat na střed',
alignJustify: 'Zarovnat do bloku',
list: 'Seznam',
orderList: 'Seřazený seznam',
unorderList: 'Neřazený seznam',
horizontalRule: 'Vodorovná čára',
hr_solid: 'Nepřerušovaná',
hr_dotted: 'Tečkovaná',
hr_dashed: 'Čárkovaná',
table: 'Tabulka',
link: 'Odkaz',
math: 'Matematika',
image: 'Obrázek',
video: 'Video',
audio: 'Zvuk',
fullScreen: 'Celá obrazovka',
showBlocks: 'Zobrazit bloky',
codeView: 'Zobrazení kódu',
undo: 'Zpět',
redo: 'Opakovat',
preview: 'Náhled',
print: 'tisk',
tag_p: 'Odstavec',
tag_div: 'Normální (DIV)',
tag_h: 'Záhlaví',
tag_blockquote: 'Citovat',
tag_pre: 'Kód',
template: 'Šablona',
lineHeight: 'Výška řádku',
paragraphStyle: 'Styl odstavce',
textStyle: 'Styl textu',
imageGallery: 'Obrázková galerie',
dir_ltr: 'Zleva doprava',
dir_rtl: 'Zprava doleva',
mention: 'Zmínka'
},
dialogBox: {
linkBox: {
title: 'Vložit odkaz',
url: 'URL pro odkaz',
text: 'Text k zobrazení',
newWindowCheck: 'Otevřít v novém okně',
downloadLinkCheck: 'Odkaz ke stažení',
bookmark: 'Záložka'
},
mathBox: {
title: 'Matematika',
inputLabel: 'Matematická notace',
fontSizeLabel: 'Velikost písma',
previewLabel: 'Náhled'
},
imageBox: {
title: 'Vložit obrázek',
file: 'Vybrat ze souborů',
url: 'URL obrázku',
altText: 'Alternativní text'
},
videoBox: {
title: 'Vložit video',
file: 'Vybrat ze souborů',
url: 'URL pro vložení médií, YouTube/Vimeo'
},
audioBox: {
title: 'Vložit zvuk',
file: 'Vybrat ze souborů',
url: 'Adresa URL zvuku'
},
browser: {
tags: 'Štítky',
search: 'Hledat',
},
caption: 'Vložit popis',
close: 'Zavřít',
submitButton: 'Odeslat',
revertButton: 'Vrátit zpět',
proportion: 'Omezení proporcí',
basic: 'Základní',
left: 'Vlevo',
right: 'Vpravo',
center: 'Střed',
width: 'Šířka',
height: 'Výška',
size: 'Velikost',
ratio: 'Poměr'
},
controller: {
edit: 'Upravit',
unlink: 'Odpojit',
remove: 'Odebrat',
insertRowAbove: 'Vložit řádek výše',
insertRowBelow: 'Vložit řádek níže',
deleteRow: 'Smazat řádek',
insertColumnBefore: 'Vložit sloupec před',
insertColumnAfter: 'Vložit sloupec za',
deleteColumn: 'Smazat sloupec',
fixedColumnWidth: 'Pevná šířka sloupce',
resize100: 'Změnit velikost 100%',
resize75: 'Změnit velikost 75%',
resize50: 'Změnit velikost 50%',
resize25: 'Změnit velikost 25%',
autoSize: 'Automatická velikost',
mirrorHorizontal: 'Zrcadlo, horizontální',
mirrorVertical: 'Zrcadlo, vertikální',
rotateLeft: 'Otočit doleva',
rotateRight: 'Otočit doprava',
maxSize: 'Max. velikost',
minSize: 'Min. velikost',
tableHeader: 'Záhlaví tabulky',
mergeCells: 'Spojit buňky',
splitCells: 'Rozdělit buňky',
HorizontalSplit: 'Vodorovné rozdělení',
VerticalSplit: 'Svislé rozdělení'
},
menu: {
spaced: 'Rozložené',
bordered: 'Ohraničené',
neon: 'Neon',
translucent: 'Průsvitné',
shadow: 'Stín',
code: 'Kód'
}
};

if (typeof noGlobal === typeof undefined) {
if (!window.SUNEDITOR_LANG) {
Object.defineProperty(window, 'SUNEDITOR_LANG', {
enumerable: true,
writable: false,
configurable: false,
value: {}
});
}

Object.defineProperty(window.SUNEDITOR_LANG, 'cs', {
enumerable: true,
writable: true,
configurable: true,
value: lang
});
}

return lang;
}));
3 changes: 2 additions & 1 deletion src/lang/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ckb from './ckb';
import cs from './cs';
import da from './da';
import de from './de';
import en from './en';
Expand All @@ -19,4 +20,4 @@ import ua from './ua';
import ur from './ur';
import zh_cn from './zh_cn';

export { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
export { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
5 changes: 3 additions & 2 deletions src/lang/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

import ckb from './ckb';
import cs from './cs';
import da from './da';
import de from './de';
import en from './en';
Expand All @@ -21,5 +22,5 @@ import ua from './ua';
import ur from './ur';
import zh_cn from './zh_cn';

export { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
export default { ckb, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
export { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
export default { ckb, cs, da, de, en, es, fr, he, it, ja, ko, lv, nl, pl, pt_br, ro, ru, se, ua, ur, zh_cn };
3 changes: 1 addition & 2 deletions src/lib/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ export default {
/// focus temp
const focusTemp = doc.createElement('INPUT');
focusTemp.tabIndex = -1;
focusTemp.style.width = '0 !important';
focusTemp.style.height = '0 !important';
focusTemp.style.cssText = 'position: absolute !important; top: -10000px !important; display: block !important; width: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important;';

// toolbar container
const toolbarContainer = options.toolbarContainer;
Expand Down
7 changes: 5 additions & 2 deletions src/plugins/submenu/font.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {

if (currentFont !== fontContext.currentFont) {
for (let i = 0, len = fontList.length; i < len; i++) {
if (currentFont === fontList[i].getAttribute('data-value')) {
if (currentFont === (fontList[i].getAttribute('data-value') || '').replace(/'|"/g, '')) {
this.util.addClass(fontList[i], 'active');
} else {
this.util.removeClass(fontList[i], 'active');
Expand All @@ -105,10 +105,13 @@ export default {
e.preventDefault();
e.stopPropagation();

const value = e.target.getAttribute('data-value');
let value = e.target.getAttribute('data-value');

if (value) {
const newNode = this.util.createElement('SPAN');
if (/[\s\d\W]/.test(value) && !/^['"].*['"]$/.test(value)) {
value = '"' + value + '"';
}
newNode.style.fontFamily = value;
this.nodeChange(newNode, ['font-family'], null, null);
} else {
Expand Down
1 change: 1 addition & 0 deletions test/dev/suneditor_build_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,7 @@ let s2 = window.s2 = suneditor.create(document.getElementById('editor2'), {
html: '<p>Template 1</p>'
}
],
// font: ['\'Exo 2\'', 'Sans-serif', 'Exo 2'],
imageGalleryUrl: 'https://etyswjpn79.execute-api.ap-northeast-1.amazonaws.com/suneditor-demo',
// addTagsWhitelist: "fld|sort|sortType|lst|lstfld|header|section",
lineAttrReset: 'class',
Expand Down
Loading