Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
b3b2d9b3
Commit
b3b2d9b3
authored
Dec 02, 2019
by
Benjamin Baer
Browse files
Merge branch 'B7974-TinyMCEReadOnly' into 'master'
B7974 tiny mce read only See merge request
!215
parents
d3d89e03
55f1aa37
Pipeline
#2835
passed with stages
in 2 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/Helper/tinyMCE.js
View file @
b3b2d9b3
...
@@ -28,6 +28,7 @@ QfqNS.Helper = QfqNS.Helper || {};
...
@@ -28,6 +28,7 @@ QfqNS.Helper = QfqNS.Helper || {};
* @function
* @function
*/
*/
var
tinyMce
=
function
()
{
var
tinyMce
=
function
()
{
if
(
typeof
tinymce
===
'
undefined
'
)
{
if
(
typeof
tinymce
===
'
undefined
'
)
{
//QfqNS.log.error("tinymce not loaded, cannot initialize Qfq tinymce.");
//QfqNS.log.error("tinymce not loaded, cannot initialize Qfq tinymce.");
return
;
return
;
...
@@ -36,6 +37,7 @@ QfqNS.Helper = QfqNS.Helper || {};
...
@@ -36,6 +37,7 @@ QfqNS.Helper = QfqNS.Helper || {};
$
(
"
.qfq-tinymce
"
).
each
(
$
(
"
.qfq-tinymce
"
).
each
(
function
()
{
function
()
{
var
config
=
{};
var
config
=
{};
var
myEditor
=
{};
var
$this
=
$
(
this
);
var
$this
=
$
(
this
);
var
tinyMCEId
=
$this
.
attr
(
'
id
'
);
var
tinyMCEId
=
$this
.
attr
(
'
id
'
);
if
(
!
tinyMCEId
)
{
if
(
!
tinyMCEId
)
{
...
@@ -55,6 +57,7 @@ QfqNS.Helper = QfqNS.Helper || {};
...
@@ -55,6 +57,7 @@ QfqNS.Helper = QfqNS.Helper || {};
config
.
selector
=
"
#
"
+
QfqNS
.
escapeJqueryIdSelector
(
tinyMCEId
);
config
.
selector
=
"
#
"
+
QfqNS
.
escapeJqueryIdSelector
(
tinyMCEId
);
config
.
setup
=
function
(
editor
)
{
config
.
setup
=
function
(
editor
)
{
myEditor
=
editor
;
editor
.
on
(
'
Change
'
,
function
(
e
)
{
editor
.
on
(
'
Change
'
,
function
(
e
)
{
// Ensure the associated form is notified of changes in editor.
// Ensure the associated form is notified of changes in editor.
QfqNS
.
Log
.
debug
(
'
Editor was changed
'
);
QfqNS
.
Log
.
debug
(
'
Editor was changed
'
);
...
@@ -63,9 +66,25 @@ QfqNS.Helper = QfqNS.Helper || {};
...
@@ -63,9 +66,25 @@ QfqNS.Helper = QfqNS.Helper || {};
$parentForm
.
trigger
(
"
change
"
);
$parentForm
.
trigger
(
"
change
"
);
});
});
/* Remove ReadOnly Again - we have to implement tinymce differently
to make it easier to change such attributes */
var
me
=
editor
;
var
$parent
=
$
(
config
.
selector
);
$parent
.
parent
(
'
div
'
).
mouseenter
(
function
(
e
)
{
if
(
$parent
.
is
(
'
[readonly="readonly"]
'
))
{
me
.
setMode
(
"
readonly
"
);
}
else
{
me
.
setMode
(
"
design
"
);
}
});
};
};
tinymce
.
init
(
config
);
tinymce
.
init
(
config
);
if
(
$
(
this
).
is
(
'
[readonly]
'
))
{
myEditor
.
setMode
(
"
readonly
"
);
}
}
}
);
);
};
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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