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

Read only mode #1035

Merged
merged 107 commits into from
Sep 29, 2020
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
e78b22d
init readonly module
hboylan Feb 12, 2020
e40c591
expose toggleReadOnly method in public api
hboylan Feb 12, 2020
2a32659
alias readonly api on editor
hboylan Feb 13, 2020
b710e5e
include readonly toggle button in dev example
hboylan Feb 13, 2020
d259339
unbind ui events in readonly mode
hboylan Feb 13, 2020
0586a81
switch to setReadOnly method in ui and paste modules
hboylan Feb 13, 2020
cb2622e
reset paste module in readonly mode
hboylan Feb 13, 2020
fac51fd
update internal prepare methods with setReadOnly
hboylan Feb 14, 2020
7b1cffe
destroy mutation observer when read-only enabled
hboylan Feb 14, 2020
f2b4018
rename readonly toggle methods
hboylan Feb 16, 2020
1a4fff1
unbind events
khaydarov Apr 11, 2020
f5e9a66
[Improvements] ESLint action (#1099)
neSpecc Apr 11, 2020
7c726d4
generate id on event listeners
khaydarov Apr 11, 2020
552d090
Merge remote-tracking branch 'origin/release/2.18' into pr/1035
khaydarov Apr 11, 2020
4c0d806
[Refactor] ESLint fixed (#1100)
gohabereg Apr 18, 2020
d42042d
save
khaydarov Apr 20, 2020
1a6f9a1
Merge remote-tracking branch 'origin/release/2.18' into pr/1035
khaydarov Apr 20, 2020
ffa78fd
resolve conflicts
khaydarov Apr 20, 2020
e671a6e
fix event handlers
khaydarov Apr 20, 2020
0680c4d
add read only flag everywhere
khaydarov Apr 20, 2020
21cac86
[Feature] i18n (#1106)
neSpecc Apr 20, 2020
b32b2cb
Merge remote-tracking branch 'origin/release/2.18' into pr/1035
khaydarov Apr 20, 2020
968280a
resolve conflicts
khaydarov Apr 20, 2020
775ccbc
Remove unused submodule
tasuku-s Apr 23, 2020
f4c4051
Fixed: icon centering in Firefox
neSpecc Apr 25, 2020
2997ed0
Do not load styles twice (#1112)
gohabereg Apr 25, 2020
c66105b
ready for testing
khaydarov Apr 25, 2020
4a81699
Show warning if Block to delete is not found (#1111)
gohabereg Apr 25, 2020
7eb642d
Save Tools' order in the Toolbox (#1113)
gohabereg Apr 25, 2020
72213f2
fix $.isEmpty performance (#1096)
tasuku-s Apr 25, 2020
7f876e8
Add issue templates (#1114)
gohabereg Apr 25, 2020
8456da7
requested changes
khaydarov Apr 25, 2020
66e70fa
Update issue templates (#1121)
neSpecc Apr 25, 2020
5941ef0
ready for testing. hurr-ah
khaydarov Apr 25, 2020
9b92e6c
Merge remote-tracking branch 'origin/release/2.18' into pr/1035
khaydarov Apr 25, 2020
77534fe
update changelog
khaydarov Apr 25, 2020
4f6164c
fix copy and cut
khaydarov Apr 25, 2020
5218a6a
Allowing deleting block by block id (#1108)
athul7744 Apr 25, 2020
ae8591c
Allow navigate next from last non-initial block (#1110)
gohabereg Apr 25, 2020
c3ba372
update
khaydarov Apr 26, 2020
f291aa0
Merge branch 'release/2.18' into pr/1035
khaydarov Apr 26, 2020
ec63dcd
update
khaydarov Apr 26, 2020
6edb7bc
fix eslint problems
khaydarov Apr 26, 2020
05766a6
update
khaydarov Apr 26, 2020
65f51c2
fix paste
khaydarov Apr 26, 2020
b90b8c5
update
khaydarov Apr 28, 2020
6e79df6
upgrade
khaydarov Apr 30, 2020
b90532e
update
khaydarov Apr 30, 2020
f6b7b2e
Create CODE_OF_CONDUCT.md (#1171)
talyguryn May 27, 2020
e3410be
Update dependencies (#1122)
gohabereg May 27, 2020
b0ddb10
Feature/disable tab event config (#1164)
flaming-cl May 27, 2020
1eb6d81
Highlight first block on autofocus (#1127)
gohabereg May 27, 2020
5fe8b08
Fix shortcut for external tools (#1141)
sonnn May 27, 2020
7c3bf76
Hotfix/issue1133 selection shortcut removed on editor destroy (#1140)
sis-dk May 27, 2020
ffe5bbc
[Feature] BlockAPI Interface (#1075)
gohabereg May 27, 2020
ff6bd2d
Fix BlockManager.insert method (#1172)
gohabereg Jun 2, 2020
e1500f7
Update tools master branches (#1180)
talyguryn Jun 2, 2020
26b19a3
Fix behaviour of inputs editing in block settings (#1123)
gohabereg Jun 2, 2020
8341c33
Merge branch 'master' into release/2.18
neSpecc Jun 2, 2020
239aaf6
lint code
neSpecc Jun 3, 2020
4cea66f
Update CHANGELOG.md
neSpecc Jun 3, 2020
0e374ab
test commit
khaydarov Jun 4, 2020
7992995
Revert "test commit"
khaydarov Jun 4, 2020
cefe8da
Merge branch 'release/2.18' into pr/1035
khaydarov Jun 4, 2020
9bbf37d
last updates
khaydarov Jun 5, 2020
884baf2
comment
khaydarov Jun 9, 2020
f983a5a
requested changes
khaydarov Jun 9, 2020
d7d8be8
eslint fixes
khaydarov Jun 9, 2020
f07886d
last changes
khaydarov Jul 26, 2020
c82d359
Merge branch 'next' into pr/1035
khaydarov Jul 26, 2020
ea75bf2
small fix
khaydarov Jul 26, 2020
5772c04
fix defect with native selection
khaydarov Jul 26, 2020
96a1780
type magic
khaydarov Jul 26, 2020
22dd508
update
khaydarov Jul 26, 2020
a296077
updates
khaydarov Jul 26, 2020
8f74b37
eslint fixes
khaydarov Jul 26, 2020
4aaddfe
Check tools compatibility on read-only toggle
gohabereg Aug 22, 2020
1a61d3f
Merge branch 'next' of github.com:codex-team/editor.js into pr/1035
gohabereg Aug 22, 2020
a00090a
Update submodules
gohabereg Aug 22, 2020
99d074a
Use Math.floor instead of ~~
gohabereg Aug 23, 2020
014ea48
Merge branch 'next' into pr/1035
neSpecc Aug 26, 2020
f02e49c
upd demo page toggler
neSpecc Aug 26, 2020
93829a0
rm unused styles from example
neSpecc Aug 26, 2020
5921260
add description to generic type
neSpecc Aug 26, 2020
6ec8d06
Saver API: return promise.reject instead of undifined
neSpecc Aug 26, 2020
1af17f0
update
khaydarov Aug 26, 2020
e8efd87
update nodes
khaydarov Aug 26, 2020
edece25
lint fixes
khaydarov Aug 26, 2020
f0b5dc0
save changes
khaydarov Aug 27, 2020
189e7b6
Merge branch 'next' into pr/1035
khaydarov Aug 28, 2020
34a425f
Create editor.js.map
khaydarov Aug 28, 2020
7a3162f
updates
khaydarov Aug 28, 2020
748aa7d
save changes
khaydarov Aug 28, 2020
6977b33
Merge branch 'next' into pr/1035
khaydarov Sep 1, 2020
ef17dbf
Update editor.js.map
khaydarov Sep 1, 2020
a318dff
update
khaydarov Sep 1, 2020
b2865ad
new bundle
khaydarov Sep 1, 2020
15b2794
Update methods call prevention in read-only mode
gohabereg Sep 13, 2020
d04f1ae
Remove API restrictions for read only mode
gohabereg Sep 19, 2020
7f1ffcd
Update CBS event handlerr
gohabereg Sep 21, 2020
efef57f
Merge branch 'next' of github.com:codex-team/editor.js into pr/1035
gohabereg Sep 22, 2020
cd6d263
rm duplicated code
neSpecc Sep 29, 2020
899dd3f
Optimiza isAnyBlockSelected method
gohabereg Sep 29, 2020
59b2688
Update bundle
gohabereg Sep 29, 2020
24ab8f9
Update src/components/modules/blockSelection.ts
neSpecc Sep 29, 2020
d671342
Merge branch 'next' into pr/1035
neSpecc Sep 29, 2020
29945ae
pull next
neSpecc Sep 29, 2020
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
Prev Previous commit
Next Next commit
save
khaydarov committed Apr 20, 2020
commit d42042da4b784d1893a4ea20bc1cd8b38cb9c71c
11 changes: 8 additions & 3 deletions dist/editor.js
Original file line number Diff line number Diff line change
@@ -21501,10 +21501,15 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
this.readOnlyEnabled = state;

for (var name in this.Editor) {
// Verify module has method
if (!this.Editor[name].toggleReadOnly) {
/**
* Verify module has method `toggleReadOnly` method
*/
if (!this.Editor.hasOwnProperty(name) || !this.Editor[name].toggleReadOnly) {
continue;
} // set or toggle read-only state
}
/**
* set or toggle read-only state
*/


this.Editor[name].toggleReadOnly(state);
2 changes: 1 addition & 1 deletion dist/editor.js.map

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions src/components/modules/readonly.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ import Module from '../__module';
* @property {Boolean} readOnlyEnabled - read-only state
*/
export default class ReadOnly extends Module {

/**
* Value to track read-only state
*
@@ -36,12 +35,16 @@ export default class ReadOnly extends Module {
this.readOnlyEnabled = state;

for (const name in this.Editor) {
// Verify module has method
if (!this.Editor[name].toggleReadOnly) {
/**
* Verify module has method `toggleReadOnly` method
*/
if (!this.Editor.hasOwnProperty(name) || !this.Editor[name].toggleReadOnly) {
continue;
}

// set or toggle read-only state
/**
* set or toggle read-only state
*/
this.Editor[name].toggleReadOnly(state);
}

3 changes: 2 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import {
Events,
InlineToolbar,
Listeners,
Notifier,
Notifier, ReadOnly,
khaydarov marked this conversation as resolved.
Show resolved Hide resolved
Sanitizer,
Saver,
Selection,
@@ -87,6 +87,7 @@ declare class EditorJS {
public styles: Styles;
public toolbar: Toolbar;
public inlineToolbar: InlineToolbar;
public readonly: ReadOnly;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readOnly

constructor(configuration?: EditorConfig|string);

/**