FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CKCodeMirror/ModuleConfig.cfc at master · contentbox-modules/CKCodeMirror · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
contentbox-modules
/
CKCodeMirror
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CKCodeMirror
/
ModuleConfig.cfc
Copy path
More file actions
More file actions
Latest commit
History
History
History
189 lines (172 loc) · 6.64 KB
Breadcrumbs
CKCodeMirror
/
ModuleConfig.cfc
Copy path
File metadata and controls
189 lines (172 loc) · 6.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/**
* ContentBox - A Modular Content Platform
* Copyright since 2012 by Ortus Solutions, Corp
* www.ortussolutions.com/products/contentbox
* ---
* This module enhances ckeditor to allow them to use code mirror for its source editing
*
*/
component
{
//
Module Properties
this
.
title
=
"
CKCodeMirror
"
;
this
.
author
=
"
Ortus Solutions, Corp
"
;
this
.
webURL
=
"
http://www.ortussolutions.com
"
;
this
.
description
=
"
Adds CodeMirror support to CKEditor
"
;
this
.
version
=
"
2.0.0
"
;
//
If true, looks for views in the parent first, if not found, then in the module. Else vice-versa
this
.
viewParentLookup
=
true
;
//
If true, looks for layouts in the parent first, if not found, then in module. Else vice-versa
this
.
layoutParentLookup
=
true
;
//
Module Entry Point
this
.
entryPoint
=
"
ckcodemirror
"
;
this
.
aliases
=
[
"
ckcodemirror
"
];
function
configure
(){
//
Compressor Settings
settings
=
{
"
theme
"
=
"
xq-dark
"
,
"
mode
"
=
"
htmlmixed
"
,
"
autoCloseBrackets
"
:
true
,
"
autoCloseTags
"
:
true
,
"
autoFormatOnStart
"
:
false
,
"
autoFormatOnUncomment
"
:
true
,
"
continueComments
"
:
true
,
"
enableCodeFolding
"
:
true
,
"
enableCodeFormatting
"
:
true
,
"
enableSearchTools
"
:
true
,
"
highlightMatches
"
:
true
,
"
indentWithTabs
"
:
false
,
"
lineNumbers
"
:
true
,
"
lineWrapping
"
:
true
,
"
matchBrackets
"
:
true
,
"
matchTags
"
:
true
,
"
showAutoCompleteButton
"
:
true
,
"
showCommentButton
"
:
true
,
"
showFormatButton
"
:
true
,
"
showSearchButton
"
:
true
,
"
showTrailingSpace
"
:
true
,
"
showUncommentButton
"
:
true
,
"
styleActiveLine
"
:
true
,
"
useBeautifyOnStart
"
:
false
,
"
autoLoadCodeMirror
"
:
true
,
"
maxHighlightLineLength
"
:
1000
};
//
SES Routes
routes
=
[
//
Module Entry Point
{
pattern
=
"
/
"
,
handler
=
"
home
"
,
action
=
"
index
"
},
//
Convention Route
{
pattern
=
"
/:handler/:action?
"
}
];
//
Interceptors
interceptors
=
[
];
}
/**
* CKEditor Plugin Integrations
*/
function
cbadmin_ckeditorExtraPlugins
(
event
,
interceptData
){
arrayAppend
(
arguments
.
interceptData
.
extraPlugins
,
"
codemirror
"
);
}
/**
* CKEditor Config Integration
*/
function
cbadmin_ckeditorExtraConfig
(
event
,
interceptData
){
var
settingService
=
wirebox
.
getInstance
(
"
SettingService@cb
"
);
var
args
=
{
name
=
"
cbox-ckcodemirror
"
};
var
allSettings
=
deserializeJSON
(
settingService
.
findWhere
(
criteria
=
args
).
getValue
() );
arguments
.
interceptData
.
extraConfig
&
=
"
codemirror : {
theme : '#
allSettings
.
theme
#',
mode : '#
allSettings
.
mode
#',
autoCloseBrackets : #
allSettings
.
autoCloseBrackets
#,
autoCloseTags : #
allSettings
.
autoCloseTags
#,
lineNumbers : #
allSettings
.
lineNumbers
#,
autoFormatOnStart : #
allSettings
.
autoFormatOnStart
#,
autoFormatOnUncomment : #
allSettings
.
autoFormatOnUncomment
#,
continueComments : #
allSettings
.
continueComments
#,
enableCodeFolding : #
allSettings
.
enableCodeFolding
#,
enableSearchTools : #
allSettings
.
enableSearchTools
#,
highlightMatches : #
allSettings
.
highlightMatches
#,
indentWithTabs : #
allSettings
.
indentWithTabs
#,
lineWrapping : #
allSettings
.
lineWrapping
#,
matchBrackets : #
allSettings
.
matchBrackets
#,
matchTags : #
allSettings
.
matchTags
#,
showAutoCompleteButton : #
allSettings
.
showAutoCompleteButton
#,
showCommentButton : #
allSettings
.
showCommentButton
#,
showFormatButton : #
allSettings
.
showFormatButton
#,
showSearchButton : #
allSettings
.
showSearchButton
#,
showTrailingSpace : #
allSettings
.
showTrailingSpace
#,
showUncommentButton : #
allSettings
.
showUncommentButton
#,
styleActiveLine : #
allSettings
.
styleActiveLine
#,
useBeautifyOnStart : #
allSettings
.
useBeautifyOnStart
#,
autoLoadCodeMirror : #
allSettings
.
autoLoadCodeMirror
#,
maxHighlightLineLength : #
allSettings
.
maxHighlightLineLength
#
}
"
;
}
/**
* Fired when the module is registered and activated.
*/
function
onLoad
(){
//
Let's add ourselves to the main menu in the Modules section
var
menuService
=
wirebox
.
getInstance
(
"
AdminMenuService@cb
"
);
//
Add Menu Contribution
menuService
.
addSubMenu
(
topMenu
=
menuService
.
MODULES
,
name
=
"
CKCodeMirror
"
,
label
=
"
CK Code Mirror
"
,
href
=
"
#
menuService
.
buildModuleLink
(
'
CKCodeMirror
'
,
'
home.settings
'
)
#
"
);
//
Override settings?
var
settingService
=
wirebox
.
getInstance
(
"
SettingService@cb
"
);
var
args
=
{
name
=
"
cbox-ckcodemirror
"
};
var
setting
=
settingService
.
findWhere
(
criteria
=
args
);
if
(
!
isNull
(
setting
) ){
//
override settings from contentbox custom setting
var
allSettings
=
deserializeJSON
(
setting
.
getvalue
() );
for
(
var
key
in
allSettings
){
if
(
structKeyExists
(
controller
.
getSetting
(
"
modules
"
).
CKCodeMirror
.
settings
,
key
) ){
controller
.
getSetting
(
"
modules
"
).
CKCodeMirror
.
settings
[
key
]
=
allSettings
[
key
];
}
}
}
}
/**
* Fired when the module is activated
*/
function
onActivate
(){
var
settingService
=
wirebox
.
getInstance
(
"
SettingService@cb
"
);
//
store default settings
var
findArgs
=
{
name
=
"
cbox-ckcodemirror
"
};
var
setting
=
settingService
.
findWhere
(
criteria
=
findArgs
);
if
(
isNull
(
setting
) ){
var
args
=
{
name
=
"
cbox-ckcodemirror
"
,
value
=
serializeJSON
(
settings
) };
var
codeMirrorSettings
=
settingService
.
new
(
properties
=
args
);
settingService
.
save
(
codeMirrorSettings
);
}
//
Install the ckeditor plugin
var
ckeditorPluginsPath
=
controller
.
getSetting
(
"
modules
"
)[
"
contentbox-admin
"
].
path
&
"
/modules/contentbox-ckeditor/includes/ckeditor/plugins/codemirror
"
;
var
pluginPath
=
moduleMapping
&
"
/includes/codemirror
"
;
directoryCopy
(
source
=
pluginPath
,
destination
=
ckeditorPluginsPath
,
recurse
=
true
);
}
/**
* Fired when the module is unregistered and unloaded
*/
function
onUnload
(){
//
Let's remove ourselves to the main menu in the Modules section
var
menuService
=
wirebox
.
getInstance
(
"
AdminMenuService@cb
"
);
//
Remove Menu Contribution
menuService
.
removeSubMenu
(
topMenu
=
menuService
.
MODULES
,
name
=
"
CKCodeMirror
"
);
}
/**
* Fired when the module is deactivated by ContentBox Only
*/
function
onDeactivate
(){
var
settingService
=
wirebox
.
getInstance
(
"
SettingService@cb
"
);
var
args
=
{
name
=
"
cbox-ckcodemirror
"
};
var
setting
=
settingService
.
findWhere
(
criteria
=
args
);
if
(
!
isNull
(
setting
) ){
settingService
.
delete
(
setting
);
}
//
Uninstall the ckeditor plugin
var
ckeditorPluginsPath
=
controller
.
getSetting
(
"
modules
"
)[
"
contentbox-admin
"
].
path
&
"
/modules/contentbox-ckeditor/includes/ckeditor/plugins/codemirror
"
;
directoryDelete
(
path
=
ckeditorPluginsPath
,
recurse
=
true
);
}
}
Back
|
FazBrowse Home
|
New Git URL