-
Notifications
You must be signed in to change notification settings - Fork 939
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add CodeMirror editor to control panel (#1656)
* feat: Add CodeMirror editor to control panel * refactor: removed unused code, added galen styling suggestion and altered vanilla go codeMirror tokenizer (rangers suggestion) * Apply suggestions from code review Co-authored-by: Galen CC <[email protected]> * refactor: Update script reference to yagFuncs.js in customcommands-editcmd.html and go.js * fix: modernjs impl triggering alert without need, so impl codemirror in jquery --------- Co-authored-by: Ashish <[email protected]> Co-authored-by: Galen CC <[email protected]>
- Loading branch information
1 parent
2a58570
commit 22ed700
Showing
6 changed files
with
290 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
// https://github.com/jo3-l/yagfuncdata | ||
var yagFuncs = { | ||
editMessage: true, | ||
editMessageNoEscape: true, | ||
pinMessage: true, | ||
publishMessage: true, | ||
publishResponse: true, | ||
sendDM: true, | ||
sendMessage: true, | ||
sendMessageNoEscape: true, | ||
sendMessageNoEscapeRetID: true, | ||
sendMessageRetID: true, | ||
sendTemplate: true, | ||
sendTemplateDM: true, | ||
unpinMessage: true, | ||
mentionEveryone: true, | ||
mentionHere: true, | ||
mentionRoleID: true, | ||
mentionRoleName: true, | ||
hasRoleID: true, | ||
hasRoleName: true, | ||
addRoleID: true, | ||
removeRoleID: true, | ||
setRoles: true, | ||
addRoleName: true, | ||
removeRoleName: true, | ||
giveRoleID: true, | ||
giveRoleName: true, | ||
takeRoleID: true, | ||
takeRoleName: true, | ||
targetHasRoleID: true, | ||
targetHasRoleName: true, | ||
hasPermissions: true, | ||
targetHasPermissions: true, | ||
getTargetPermissionsIn: true, | ||
addMessageReactions: true, | ||
addReactions: true, | ||
addResponseReactions: true, | ||
deleteAllMessageReactions: true, | ||
deleteMessage: true, | ||
deleteMessageReaction: true, | ||
deleteResponse: true, | ||
deleteTrigger: true, | ||
getChannel: true, | ||
getChannelPins: true, | ||
getChannelOrThread: true, | ||
getMember: true, | ||
getMessage: true, | ||
getPinCount: true, | ||
getRole: true, | ||
getThread: true, | ||
createThread: true, | ||
deleteThread: true, | ||
addThreadMember: true, | ||
removeThreadMember: true, | ||
createForumPost: true, | ||
deleteForumPost: true, | ||
currentUserAgeHuman: true, | ||
currentUserAgeMinutes: true, | ||
currentUserCreated: true, | ||
reFind: true, | ||
reFindAll: true, | ||
reFindAllSubmatches: true, | ||
reReplace: true, | ||
reSplit: true, | ||
sleep: true, | ||
editChannelName: true, | ||
editChannelTopic: true, | ||
editNickname: true, | ||
onlineCount: true, | ||
onlineCountBots: true, | ||
sort: true, | ||
str: true, | ||
toString: true, | ||
toInt: true, | ||
toInt64: true, | ||
toFloat: true, | ||
toDuration: true, | ||
toRune: true, | ||
toByte: true, | ||
hasPrefix: true, | ||
hasSuffix: true, | ||
joinStr: true, | ||
lower: true, | ||
slice: true, | ||
split: true, | ||
title: true, | ||
trimSpace: true, | ||
upper: true, | ||
urlescape: true, | ||
urlunescape: true, | ||
sanitizeText: true, | ||
reQuoteMeta: true, | ||
add: true, | ||
cbrt: true, | ||
div: true, | ||
fdiv: true, | ||
log: true, | ||
mathConst: true, | ||
max: true, | ||
min: true, | ||
mod: true, | ||
mult: true, | ||
pow: true, | ||
round: true, | ||
roundCeil: true, | ||
roundEven: true, | ||
roundFloor: true, | ||
sqrt: true, | ||
sub: true, | ||
bitwiseAnd: true, | ||
bitwiseOr: true, | ||
bitwiseXor: true, | ||
bitwiseNot: true, | ||
bitwiseAndNot: true, | ||
bitwiseLeftShift: true, | ||
bitwiseRightShift: true, | ||
humanizeThousands: true, | ||
dict: true, | ||
sdict: true, | ||
structToSdict: true, | ||
cembed: true, | ||
cslice: true, | ||
complexMessage: true, | ||
complexMessageEdit: true, | ||
kindOf: true, | ||
adjective: true, | ||
in: true, | ||
inFold: true, | ||
json: true, | ||
jsonToSdict: true, | ||
noun: true, | ||
randInt: true, | ||
roleAbove: true, | ||
seq: true, | ||
shuffle: true, | ||
verb: true, | ||
currentTime: true, | ||
parseTime: true, | ||
formatTime: true, | ||
loadLocation: true, | ||
newDate: true, | ||
snowflakeToTime: true, | ||
timestampToTime: true, | ||
weekNumber: true, | ||
humanizeDurationHours: true, | ||
humanizeDurationMinutes: true, | ||
humanizeDurationSeconds: true, | ||
humanizeTimeSinceDays: true, | ||
pastUsernames: true, | ||
pastNicknames: true, | ||
createTicket: true, | ||
exec: true, | ||
execAdmin: true, | ||
userArg: true, | ||
parseArgs: true, | ||
carg: true, | ||
execCC: true, | ||
scheduleUniqueCC: true, | ||
cancelScheduledUniqueCC: true, | ||
dbSet: true, | ||
dbSetExpire: true, | ||
dbIncr: true, | ||
dbGet: true, | ||
dbGetPattern: true, | ||
dbGetPatternReverse: true, | ||
dbDel: true, | ||
dbDelById: true, | ||
dbDelMultiple: true, | ||
dbTopEntries: true, | ||
dbBottomEntries: true, | ||
dbCount: true, | ||
dbRank: true | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Based on https://github.com/dempfi/ayu */ | ||
|
||
.cm-s-ayu-mirage.CodeMirror { background: #1f2430; color: #cbccc6; } | ||
.cm-s-ayu-mirage div.CodeMirror-selected { background: #34455a; } | ||
.cm-s-ayu-mirage .CodeMirror-line::selection, .cm-s-ayu-mirage .CodeMirror-line > span::selection, .cm-s-ayu-mirage .CodeMirror-line > span > span::selection { background: #34455a; } | ||
.cm-s-ayu-mirage .CodeMirror-line::-moz-selection, .cm-s-ayu-mirage .CodeMirror-line > span::-moz-selection, .cm-s-ayu-mirage .CodeMirror-line > span > span::-moz-selection { background: rgba(25, 30, 42, 99); } | ||
.cm-s-ayu-mirage .CodeMirror-gutters { background: #1f2430; border-right: 0px; } | ||
.cm-s-ayu-mirage .CodeMirror-guttermarker { color: white; } | ||
.cm-s-ayu-mirage .CodeMirror-guttermarker-subtle { color: rgba(112, 122, 140, 66); } | ||
.cm-s-ayu-mirage .CodeMirror-linenumber { color: rgba(61, 66, 77, 99); } | ||
.cm-s-ayu-mirage .CodeMirror-cursor { border-left: 1px solid #ffcc66; } | ||
.cm-s-ayu-mirage.cm-fat-cursor .CodeMirror-cursor {background-color: #a2a8a175 !important;} | ||
.cm-s-ayu-mirage .cm-animate-fat-cursor { background-color: #a2a8a175 !important; } | ||
|
||
.cm-s-ayu-mirage span.cm-comment { color: #5c6773; font-style:italic; } | ||
.cm-s-ayu-mirage span.cm-atom { color: #ae81ff; } | ||
.cm-s-ayu-mirage span.cm-number { color: #ffcc66; } | ||
|
||
.cm-s-ayu-mirage span.cm-comment.cm-attribute { color: #ffd580; } | ||
.cm-s-ayu-mirage span.cm-comment.cm-def { color: #d4bfff; } | ||
.cm-s-ayu-mirage span.cm-comment.cm-tag { color: #5ccfe6; } | ||
.cm-s-ayu-mirage span.cm-comment.cm-type { color: #5998a6; } | ||
|
||
.cm-s-ayu-mirage span.cm-property { color: #f29e74; } | ||
.cm-s-ayu-mirage span.cm-attribute { color: #ffd580; } | ||
.cm-s-ayu-mirage span.cm-keyword { color: #ffa759; } | ||
.cm-s-ayu-mirage span.cm-builtin { color: #ffcc66; } | ||
.cm-s-ayu-mirage span.cm-string { color: #bae67e; } | ||
|
||
.cm-s-ayu-mirage span.cm-variable { color: #cbccc6; } | ||
.cm-s-ayu-mirage span.cm-variable-2 { color: #f28779; } | ||
.cm-s-ayu-mirage span.cm-variable-3 { color: #5ccfe6; } | ||
.cm-s-ayu-mirage span.cm-type { color: #ffa759; } | ||
.cm-s-ayu-mirage span.cm-def { color: #ffd580; } | ||
.cm-s-ayu-mirage span.cm-bracket { color: rgba(92, 207, 230, 80); } | ||
.cm-s-ayu-mirage span.cm-tag { color: #5ccfe6; } | ||
.cm-s-ayu-mirage span.cm-header { color: #bae67e; } | ||
.cm-s-ayu-mirage span.cm-link { color: #5ccfe6; } | ||
.cm-s-ayu-mirage span.cm-error { color: #ff3333; } | ||
|
||
.cm-s-ayu-mirage .CodeMirror-activeline-background { background: #191e2a; } | ||
.cm-s-ayu-mirage .CodeMirror-matchingbracket { | ||
text-decoration: underline; | ||
color: white !important; | ||
} |