Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CkEditor-Embed-Plugins
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bolt Extensions
CkEditor-Embed-Plugins
Commits
e4bd0139
Commit
e4bd0139
authored
Apr 10, 2019
by
Frédéric
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test
parent
10c44725
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
config.yml.dist
config/config.yml.dist
+1
-0
CkEditorEmbedPluginsExtension.php
src/CkEditorEmbedPluginsExtension.php
+3
-2
ckeditor-plugins.js
web/js/ckeditor-plugins.js
+2
-10
No files found.
config/config.yml.dist
View file @
e4bd0139
plugins:
plugins:
- dialog
- dialog
- colordialog
- colordialog
public_path: /public/bolt-public/js/ckeditor/plugins
src/CkEditorEmbedPluginsExtension.php
View file @
e4bd0139
...
@@ -48,11 +48,12 @@ class CkEditorEmbedPluginsExtension extends SimpleExtension
...
@@ -48,11 +48,12 @@ class CkEditorEmbedPluginsExtension extends SimpleExtension
*/
*/
public
function
loadConfig
()
{
public
function
loadConfig
()
{
$config
=
$this
->
getConfig
();
$config
=
$this
->
getConfig
();
if
(
empty
(
$config
[
'plugins'
]))
{
if
(
empty
(
$config
[
'plugins'
])
&&
!
empty
(
$config
[
'public_path'
])
)
{
return
''
;
return
''
;
}
}
return
'<script type="text/javascript">
return
'<script type="text/javascript">
const ckefdsditorPlugins = '
.
\json_encode
(
$config
[
'plugins'
])
.
';
const ckeditorPluginsPath = "'
.
$config
[
'public_path'
]
.
'";
const ckeditorPlugins = '
.
\json_encode
(
$config
[
'plugins'
])
.
';
</script>'
;
</script>'
;
}
}
}
}
web/js/ckeditor-plugins.js
View file @
e4bd0139
...
@@ -6,12 +6,8 @@ jQuery(document).ready(function ($) {
...
@@ -6,12 +6,8 @@ jQuery(document).ready(function ($) {
if
(
typeof
(
CKEDITOR
)
!=
'undefined'
)
{
if
(
typeof
(
CKEDITOR
)
!=
'undefined'
)
{
console
.
log
(
ckeditorPlugins
);
console
.
log
(
ckeditorPlugins
);
//CKEDITOR.plugins.addExternal('fontawesome', '/extensions/mycompany/customckeditor/plugins/fontawesome/', 'plugin.js');
//CKEDITOR.plugins.addExternal('dialog', '/extensions/vendor/mycompany/customckeditor/plugins/dialog/', 'plugin.js');
for
(
const
plugin
of
ckeditorPlugins
)
{
for
(
const
plugin
of
ckeditorPlugins
)
{
console
.
log
(
plugin
)
CKEDITOR
.
plugins
.
addExternal
(
plugin
,
`
${
ckeditorPluginsPath
}
/
${
plugin
}
/`
,
'plugin.js'
);
CKEDITOR
.
plugins
.
addExternal
(
plugin
,
`/extensions/vendor/appolo/bolt-extension-ckeditor-embed-plugins/plugins/
${
plugin
}
/`
,
'plugin.js'
);
}
}
CKEDITOR
.
on
(
'instanceReady'
,
function
(
event
,
instance
)
{
CKEDITOR
.
on
(
'instanceReady'
,
function
(
event
,
instance
)
{
...
@@ -22,9 +18,6 @@ jQuery(document).ready(function ($) {
...
@@ -22,9 +18,6 @@ jQuery(document).ready(function ($) {
var
config
=
event
.
editor
.
config
,
var
config
=
event
.
editor
.
config
,
name
;
name
;
console
.
log
()
config
.
extraPlugins
+=
(
config
.
extraPlugins
?
','
:
''
)
+
ckeditorPlugins
.
join
(
','
);
config
.
extraPlugins
+=
(
config
.
extraPlugins
?
','
:
''
)
+
ckeditorPlugins
.
join
(
','
);
for
(
name
in
CKEDITOR
.
instances
)
{
for
(
name
in
CKEDITOR
.
instances
)
{
...
@@ -37,4 +30,4 @@ jQuery(document).ready(function ($) {
...
@@ -37,4 +30,4 @@ jQuery(document).ready(function ($) {
CKEDITORPluginExtras
=
true
;
CKEDITORPluginExtras
=
true
;
});
});
}
}
});
});
\ No newline at end of file
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