Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5968885
ext.CodeMirror.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
828 B
Referenced Files
None
Subscribers
None
ext.CodeMirror.js
View Options
require
(
'./ext.CodeMirror.data.js'
);
if
(
mw
.
config
.
get
(
'extCodeMirrorConfig'
).
useV6
)
{
const
deprecationFn
=
mw
.
log
.
makeDeprecated
(
'CodeMirror5-deprecation'
,
'CodeMirror 5 has been deprecated in MediaWiki 1.43 and will be removed in 1.44. '
+
'Please migrate to CodeMirror 6. See https://w.wiki/B3pr for more information.'
);
deprecationFn
();
}
/**
* Save CodeMirror enabled preference.
*
* @param {boolean} prefValue True, if CodeMirror should be enabled by default, otherwise false.
*/
function
setCodeEditorPreference
(
prefValue
)
{
if
(
!
mw
.
user
.
isNamed
()
)
{
// Skip it for unnamed users
return
;
}
new
mw
.
Api
().
saveOption
(
'usecodemirror'
,
prefValue
?
1
:
0
);
mw
.
user
.
options
.
set
(
'usecodemirror'
,
prefValue
?
1
:
0
);
}
module
.
exports
=
{
setCodeEditorPreference
:
setCodeEditorPreference
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 3, 13:22 (1 d, 20 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c5/89/e6fe17fde29099c63841496fe437
Default Alt Text
ext.CodeMirror.js (828 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment