Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
cb5f5f9c
Commit
cb5f5f9c
authored
Feb 02, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: give a readonly mode to ckeditor gadget
parent
719b0fa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_ckeditor/ckeditor.gadget.js.js
...lateItem/portal_skins/erp5_ckeditor/ckeditor.gadget.js.js
+17
-3
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_ckeditor/ckeditor.gadget.js.js
View file @
cb5f5f9c
...
...
@@ -104,7 +104,7 @@
allowedContent
:
true
,
keystrokes
:
[
[
CKEDITOR
.
CTRL
+
83
,
'
saveRJS
'
]
]
,
]
},
DESKTOP_CONFIGURATION
=
{
toolbar
:
TOOLBAR_DESKTOP
,
...
...
@@ -113,7 +113,16 @@
allowedContent
:
true
,
keystrokes
:
[
[
CKEDITOR
.
CTRL
+
83
,
'
saveRJS
'
]
],
]
},
READONLY_CONFIGURATION
=
{
toolbar
:
[],
allowedContent
:
true
,
readOnly
:
true
,
removePlugins
:
'
elementspath
'
,
startupShowBorders
:
false
,
startupOutlineBlocks
:
false
,
contentsCss
:
''
},
MATCH_MEDIA
=
window
.
matchMedia
(
"
not screen and (min-width: 45em)
"
);
...
...
@@ -142,6 +151,8 @@
configuration
:
options
.
configuration
||
DESKTOP_CONFIGURATION
,
configuration_mobile
:
options
.
configuration_mobile
||
MOBILE_CONFIGURATION
,
configuration_readonly
:
options
.
configuration_readonly
||
READONLY_CONFIGURATION
,
is_responsive
:
(
options
.
configuration_mobile
!==
undefined
)
||
(
options
.
configuration
===
undefined
),
is_mobile
:
MATCH_MEDIA
.
matches
...
...
@@ -166,6 +177,7 @@
configuration
;
if
(
modification_dict
.
hasOwnProperty
(
'
configuration
'
)
||
modification_dict
.
hasOwnProperty
(
'
configuration_mobile
'
)
||
modification_dict
.
hasOwnProperty
(
'
configuration_readonly
'
)
||
modification_dict
.
hasOwnProperty
(
'
is_responsive
'
)
||
modification_dict
.
hasOwnProperty
(
'
is_mobile
'
))
{
// Expected configuration changed.
...
...
@@ -175,7 +187,9 @@
gadget
.
ckeditor
.
destroy
();
}
// Create a new editor
if
(
gadget
.
state
.
is_responsive
&&
gadget
.
state
.
is_mobile
)
{
if
(
!
modification_dict
.
editable
)
{
configuration
=
gadget
.
state
.
configuration_readonly
;
}
else
if
(
gadget
.
state
.
is_responsive
&&
gadget
.
state
.
is_mobile
)
{
configuration
=
gadget
.
state
.
configuration_mobile
;
}
else
{
configuration
=
gadget
.
state
.
configuration
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment