-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New version 3.4.29. Read more https://github.com/xdan/jodit/blob/mast…
- Loading branch information
Showing
10 changed files
with
53 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! | ||
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser | ||
* Author: Chupurnov <[email protected]> (https://xdsoft.net/) | ||
* Version: v3.4.28 | ||
* Version: v3.4.29 | ||
* Url: https://xdsoft.net/jodit/ | ||
* License(s): MIT | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! | ||
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser | ||
* Author: Chupurnov <[email protected]> (https://xdsoft.net/) | ||
* Version: v3.4.28 | ||
* Version: v3.4.29 | ||
* Url: https://xdsoft.net/jodit/ | ||
* License(s): MIT | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! | ||
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser | ||
* Author: Chupurnov <[email protected]> (https://xdsoft.net/) | ||
* Version: v3.4.28 | ||
* Version: v3.4.29 | ||
* Url: https://xdsoft.net/jodit/ | ||
* License(s): MIT | ||
*/ | ||
|
@@ -1904,6 +1904,7 @@ class Config { | |
this.disablePlugins = []; | ||
this.extraPlugins = []; | ||
this.extraButtons = []; | ||
this.extraIcons = {}; | ||
this.createAttributes = {}; | ||
this.sizeLG = 900; | ||
this.sizeMD = 700; | ||
|
@@ -6483,6 +6484,7 @@ class Icon { | |
this.icons[name.replace('_', '-')] = value; | ||
} | ||
static makeIcon(jodit, icon) { | ||
var _a; | ||
let iconElement; | ||
if (icon) { | ||
const clearName = icon.name.replace(/[^a-zA-Z0-9]/g, '_'); | ||
|
@@ -6494,10 +6496,12 @@ class Icon { | |
} | ||
else { | ||
const svg = jodit.e.fire('getIcon', icon.name, icon, clearName) || | ||
Icon.get(icon.name, ''); | ||
Icon.get(icon.name, '') || ((_a = jodit.o.extraIcons) === null || _a === void 0 ? void 0 : _a[icon.name]); | ||
if (svg) { | ||
iconElement = jodit.c.fromHTML(svg.trim()); | ||
iconElement.classList.add('jodit-icon_' + clearName); | ||
if (!/^<svg/i.test(icon.name)) { | ||
iconElement.classList.add('jodit-icon_' + clearName); | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -12287,7 +12291,7 @@ class view_View extends core_component["a" /* Component */] { | |
this.isJodit = isJodit; | ||
this.isView = true; | ||
this.components = new Set(); | ||
this.version = "3.4.28"; | ||
this.version = "3.4.29"; | ||
this.async = new async_Async(); | ||
this.buffer = storage_Storage.makeStorage(); | ||
this.OPTIONS = view_View.defaultOptions; | ||
|
@@ -12739,6 +12743,7 @@ class button_ToolbarButton extends ui_button["b" /* UIButton */] { | |
} | ||
} | ||
initFromControl() { | ||
var _a; | ||
const { control, state } = this; | ||
this.updateSize(); | ||
state.name = control.name; | ||
|
@@ -12755,7 +12760,7 @@ class button_ToolbarButton extends ui_button["b" /* UIButton */] { | |
} | ||
else { | ||
const name = control.icon || control.name; | ||
state.icon.name = ui["b" /* Icon */].exists(name) ? name : ''; | ||
state.icon.name = (ui["b" /* Icon */].exists(name) || ((_a = this.j.o.extraIcons) === null || _a === void 0 ? void 0 : _a[name])) ? name : ''; | ||
} | ||
if (!control.iconURL && !state.icon.name) { | ||
state.text = control.text || control.name; | ||
|
@@ -15905,13 +15910,22 @@ class snapshot_Snapshot extends core_component["c" /* ViewComponent */] { | |
} | ||
restore(snapshot) { | ||
this.isBlocked = true; | ||
const scroll = this.storeScrollState(); | ||
const value = this.j.getNativeEditorValue(); | ||
if (value !== snapshot.html) { | ||
this.j.setEditorValue(snapshot.html); | ||
} | ||
this.restoreOnlySelection(snapshot); | ||
this.restoreScrollState(scroll); | ||
this.isBlocked = false; | ||
} | ||
storeScrollState() { | ||
return [window.scrollY, this.j.editor.scrollTop]; | ||
} | ||
restoreScrollState(scrolls) { | ||
window.scrollTo(window.scrollX, scrolls[0]); | ||
this.j.editor.scrollTop = scrolls[1]; | ||
} | ||
restoreOnlySelection(snapshot) { | ||
try { | ||
if (snapshot.range) { | ||
|
@@ -18771,7 +18785,8 @@ class jodit_Jodit extends view_with_toolbar_ViewWithToolbar { | |
} | ||
const active = this.od.activeElement; | ||
if (active && | ||
(dom["a" /* Dom */].isOrContains(this.editor, active) || | ||
(active === this.iframe || | ||
dom["a" /* Dom */].isOrContains(this.editor, active) || | ||
dom["a" /* Dom */].isOrContains(this.toolbar.container, active))) { | ||
return constants["MODE_WYSIWYG"]; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/*! | ||
* jodit - Jodit is awesome and usefully wysiwyg editor with filebrowser | ||
* Author: Chupurnov <[email protected]> (https://xdsoft.net/) | ||
* Version: v3.4.28 | ||
* Version: v3.4.29 | ||
* Url: https://xdsoft.net/jodit/ | ||
* License(s): MIT | ||
*/ | ||
|
@@ -1126,6 +1126,7 @@ var Config = (function () { | |
this.disablePlugins = []; | ||
this.extraPlugins = []; | ||
this.extraButtons = []; | ||
this.extraIcons = {}; | ||
this.createAttributes = {}; | ||
this.sizeLG = 900; | ||
this.sizeMD = 700; | ||
|
@@ -4481,6 +4482,7 @@ var Icon = (function () { | |
this.icons[name.replace('_', '-')] = value; | ||
}; | ||
Icon.makeIcon = function (jodit, icon) { | ||
var _a; | ||
var iconElement; | ||
if (icon) { | ||
var clearName = icon.name.replace(/[^a-zA-Z0-9]/g, '_'); | ||
|
@@ -4492,10 +4494,12 @@ var Icon = (function () { | |
} | ||
else { | ||
var svg = jodit.e.fire('getIcon', icon.name, icon, clearName) || | ||
Icon.get(icon.name, ''); | ||
Icon.get(icon.name, '') || ((_a = jodit.o.extraIcons) === null || _a === void 0 ? void 0 : _a[icon.name]); | ||
if (svg) { | ||
iconElement = jodit.c.fromHTML(svg.trim()); | ||
iconElement.classList.add('jodit-icon_' + clearName); | ||
if (!/^<svg/i.test(icon.name)) { | ||
iconElement.classList.add('jodit-icon_' + clearName); | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -4856,7 +4860,7 @@ var View = (function (_super) { | |
_this.isJodit = isJodit; | ||
_this.isView = true; | ||
_this.components = new Set(); | ||
_this.version = "3.4.28"; | ||
_this.version = "3.4.29"; | ||
_this.async = new async_1.Async(); | ||
_this.buffer = storage_1.Storage.makeStorage(); | ||
_this.OPTIONS = View.defaultOptions; | ||
|
@@ -5394,7 +5398,8 @@ var ToolbarButton = (function (_super) { | |
} | ||
}; | ||
ToolbarButton.prototype.initFromControl = function () { | ||
var _a = this, control = _a.control, state = _a.state; | ||
var _a; | ||
var _b = this, control = _b.control, state = _b.state; | ||
this.updateSize(); | ||
state.name = control.name; | ||
var textIcons = this.j.o.textIcons; | ||
|
@@ -5410,7 +5415,7 @@ var ToolbarButton = (function (_super) { | |
} | ||
else { | ||
var name_1 = control.icon || control.name; | ||
state.icon.name = __1.Icon.exists(name_1) ? name_1 : ''; | ||
state.icon.name = (__1.Icon.exists(name_1) || ((_a = this.j.o.extraIcons) === null || _a === void 0 ? void 0 : _a[name_1])) ? name_1 : ''; | ||
} | ||
if (!control.iconURL && !state.icon.name) { | ||
state.text = control.text || control.name; | ||
|
@@ -5822,13 +5827,22 @@ var Snapshot = (function (_super) { | |
}; | ||
Snapshot.prototype.restore = function (snapshot) { | ||
this.isBlocked = true; | ||
var scroll = this.storeScrollState(); | ||
var value = this.j.getNativeEditorValue(); | ||
if (value !== snapshot.html) { | ||
this.j.setEditorValue(snapshot.html); | ||
} | ||
this.restoreOnlySelection(snapshot); | ||
this.restoreScrollState(scroll); | ||
this.isBlocked = false; | ||
}; | ||
Snapshot.prototype.storeScrollState = function () { | ||
return [window.scrollY, this.j.editor.scrollTop]; | ||
}; | ||
Snapshot.prototype.restoreScrollState = function (scrolls) { | ||
window.scrollTo(window.scrollX, scrolls[0]); | ||
this.j.editor.scrollTop = scrolls[1]; | ||
}; | ||
Snapshot.prototype.restoreOnlySelection = function (snapshot) { | ||
try { | ||
if (snapshot.range) { | ||
|
@@ -8381,7 +8395,8 @@ var Jodit = (function (_super) { | |
} | ||
var active = this.od.activeElement; | ||
if (active && | ||
(modules_1.Dom.isOrContains(this.editor, active) || | ||
(active === this.iframe || | ||
modules_1.Dom.isOrContains(this.editor, active) || | ||
modules_1.Dom.isOrContains(this.toolbar.container, active))) { | ||
return consts.MODE_WYSIWYG; | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters