-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsn-injects.json
1 lines (1 loc) · 11.9 KB
/
sn-injects.json
1
{"settings":{"aboutOpened":false,"badgeCounter":false,"editor":{"fontSize":15,"keyboardHandler":null,"showInvisibles":false,"tabSize":4,"theme":"ace/theme/dracula","useSoftTabs":false,"useWorker":true,"wrap":"free"},"rulesSortBy":"name","rulesSortDesc":true,"themeBg":"231.42deg 14.89% 18.43%","themeDark":true,"themeText":"60deg 29.99% 96.07%"},"rules":[{"id":"7d570974140a4ea4bc3b1eb73fe16b2d","name":"All SN","urls":"https://*.service-now.com","js":"\r\n\r\n\r\n// ==UserScript==\r\n// @name Code Editor patch - playcanvas.com\r\n// @namespace yaustar\r\n// @match https://playcanvas.com/editor/code/*\r\n// @grant none\r\n// @version 1.0\r\n// @author @yaustar\r\n// @description 15/11/2021, 17:46:17\r\n// ==/UserScript==\r\n\r\n\r\n(function () {\r\n\t\r\n // Load a chosen theme\r\n var loadTheme = function () {\r\n // Taken from: https://github.com/brijeshb42/monaco-themes/tree/master/themes\r\n var data = dracula\r\n\r\n gsft_main.monaco.editor.defineTheme('dracula', data);\r\n gsft_main.monaco.editor.setTheme('dracula');\r\n console.log(\"Theme loaded\");\r\n };\r\n \r\n var loadSnippets = function() {\r\n \tvar data = snippets;\r\n \t\r\n \tgsft_main.monaco.languages.registerCompletionItemProvider('javascript', data);\r\n \tconsole.log(\"Snippets loaded\");\r\n }\r\n\r\n\r\n\r\n // Check if Monaco exists\r\n var codeEditorPoll = setInterval(function () {\r\n \t// console.log('polling for monaco');\r\n if (typeof gsft_main != \"undefined\" && gsft_main?.monaco) {\r\n \tconsole.log('monaco found')\r\n loadTheme();\r\n loadSnippets();\r\n clearInterval(codeEditorPoll);\r\n }\r\n }, 500);\r\n\r\n})();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nvar dracula = {\r\n \"base\": \"vs-dark\",\r\n \"inherit\": true,\r\n \"rules\": [\r\n {\r\n \"background\": \"282a36\",\r\n \"token\": \"\"\r\n },\r\n {\r\n \"foreground\": \"6272a4\",\r\n \"token\": \"comment\"\r\n },\r\n {\r\n \"foreground\": \"f1fa8c\",\r\n \"token\": \"string\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"constant.numeric\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"constant.language\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"constant.character\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"constant.other\"\r\n },\r\n {\r\n \"foreground\": \"ffb86c\",\r\n \"token\": \"variable.other.readwrite.instance\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"constant.character.escaped\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"constant.character.escape\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"string source\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"string source.ruby\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"keyword\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"storage\"\r\n },\r\n {\r\n \"foreground\": \"8be9fd\",\r\n \"fontStyle\": \"italic\",\r\n \"token\": \"storage.type\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"fontStyle\": \"underline\",\r\n \"token\": \"entity.name.class\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"fontStyle\": \"italic underline\",\r\n \"token\": \"entity.other.inherited-class\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"token\": \"entity.name.function\"\r\n },\r\n {\r\n \"foreground\": \"ffb86c\",\r\n \"fontStyle\": \"italic\",\r\n \"token\": \"variable.parameter\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"entity.name.tag\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"token\": \"entity.other.attribute-name\"\r\n },\r\n {\r\n \"foreground\": \"8be9fd\",\r\n \"token\": \"support.function\"\r\n },\r\n {\r\n \"foreground\": \"6be5fd\",\r\n \"token\": \"support.constant\"\r\n },\r\n {\r\n \"foreground\": \"66d9ef\",\r\n \"fontStyle\": \" italic\",\r\n \"token\": \"support.type\"\r\n },\r\n {\r\n \"foreground\": \"66d9ef\",\r\n \"fontStyle\": \" italic\",\r\n \"token\": \"support.class\"\r\n },\r\n {\r\n \"foreground\": \"f8f8f0\",\r\n \"background\": \"ff79c6\",\r\n \"token\": \"invalid\"\r\n },\r\n {\r\n \"foreground\": \"f8f8f0\",\r\n \"background\": \"bd93f9\",\r\n \"token\": \"invalid.deprecated\"\r\n },\r\n {\r\n \"foreground\": \"cfcfc2\",\r\n \"token\": \"meta.structure.dictionary.json string.quoted.double.json\"\r\n },\r\n {\r\n \"foreground\": \"6272a4\",\r\n \"token\": \"meta.diff\"\r\n },\r\n {\r\n \"foreground\": \"6272a4\",\r\n \"token\": \"meta.diff.header\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"markup.deleted\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"token\": \"markup.inserted\"\r\n },\r\n {\r\n \"foreground\": \"e6db74\",\r\n \"token\": \"markup.changed\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"constant.numeric.line-number.find-in-files - match\"\r\n },\r\n {\r\n \"foreground\": \"e6db74\",\r\n \"token\": \"entity.name.filename\"\r\n },\r\n {\r\n \"foreground\": \"f83333\",\r\n \"token\": \"message.error\"\r\n },\r\n {\r\n \"foreground\": \"eeeeee\",\r\n \"token\": \"punctuation.definition.string.begin.json - meta.structure.dictionary.value.json\"\r\n },\r\n {\r\n \"foreground\": \"eeeeee\",\r\n \"token\": \"punctuation.definition.string.end.json - meta.structure.dictionary.value.json\"\r\n },\r\n {\r\n \"foreground\": \"8be9fd\",\r\n \"token\": \"meta.structure.dictionary.json string.quoted.double.json\"\r\n },\r\n {\r\n \"foreground\": \"f1fa8c\",\r\n \"token\": \"meta.structure.dictionary.value.json string.quoted.double.json\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"token\": \"meta meta meta meta meta meta meta.structure.dictionary.value string\"\r\n },\r\n {\r\n \"foreground\": \"ffb86c\",\r\n \"token\": \"meta meta meta meta meta meta.structure.dictionary.value string\"\r\n },\r\n {\r\n \"foreground\": \"ff79c6\",\r\n \"token\": \"meta meta meta meta meta.structure.dictionary.value string\"\r\n },\r\n {\r\n \"foreground\": \"bd93f9\",\r\n \"token\": \"meta meta meta meta.structure.dictionary.value string\"\r\n },\r\n {\r\n \"foreground\": \"50fa7b\",\r\n \"token\": \"meta meta meta.structure.dictionary.value string\"\r\n },\r\n {\r\n \"foreground\": \"ffb86c\",\r\n \"token\": \"meta meta.structure.dictionary.value string\"\r\n }\r\n ],\r\n \"colors\": {\r\n \"editor.foreground\": \"#f8f8f2\",\r\n \"editor.background\": \"#282a36\",\r\n \"editor.selectionBackground\": \"#44475a\",\r\n \"editor.lineHighlightBackground\": \"#44475a\",\r\n \"editorCursor.foreground\": \"#f8f8f0\",\r\n \"editorWhitespace.foreground\": \"#3B3A32\",\r\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\r\n \"editor.selectionHighlightBorder\": \"#222218\"\r\n }\r\n};\r\n\r\nvar snippets = {\r\n provideCompletionItems: () => {\r\n return {\r\n suggestions: [\r\n {\r\n label: 'ga',\r\n detail: \"GlideAggregate\",\r\n kind: gsft_main.monaco.languages.CompletionItemKind.Snippet,\r\n documentation: 'Add a GlideAggregate query block',\r\n insertText: [\r\n 'var ga = new GlideAggregate(\"${1:table}\");',\r\n 'ga.addAggregate(\"COUNT\");',\r\n 'ga.addQuery(\"${2:field}\",\"${3:value}\");',\r\n '${4://ga.groupBy(\"field\")}',\r\n 'ga.query();',\r\n 'ga.next();',\r\n '',\r\n 'gs.info(ga.getAggregate(\"COUNT\"));'].join('\\n'),\r\n insertTextRules:\r\n\t\t\tgsft_main.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\r\n },\r\n {\r\n label: 'gr',\r\n detail: \"GlideRecord\",\r\n kind: gsft_main.monaco.languages.CompletionItemKind.Snippet,\r\n documentation: 'Add a GlideRecord query block',\r\n insertText: [\r\n 'var ${1:table}GR = new GlideRecord(\"${1:table}\");',\r\n '${1:table}GR.addQuery(\"${2:field}\",\"${3:value}\");',\r\n '${1:table}GR.query();',\r\n 'while(${1:table}GR.next()){',\r\n '\\t${4}',\r\n '\\tgs.info(${1:table}GR.getDisplayValue());',\r\n '}'].join('\\n'),\r\n insertTextRules:\r\n\t\t\tgsft_main.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\r\n },\r\n {\r\n label: 'iife',\r\n detail: \"Immediately Invoked function expression\",\r\n kind: gsft_main.monaco.languages.CompletionItemKind.Snippet,\r\n documentation: 'Add an iife block',\r\n insertText: [\r\n '(function(){',\r\n '\\t${1:}',\r\n '})()'].join('\\n'),\r\n insertTextRules:\r\n\t\t\tgsft_main.monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\r\n },\r\n \r\n ]\r\n };\r\n }\r\n}\r\n\r\n\r\n","enabled":false},{"css":"@keyframes border-pulsate {\n 0% {\n border-color: rgb(255, 0, 0);\n }\n 50% {\n border-color: rgb(120, 0, 0);\n }\n 100% {\n border-color: rgb(255, 0, 0);\n }\n}\nbody.section_header_body_no_scroll {\n border: 15px solid red;\n animation: border-pulsate 2s infinite;\n}\n\nbody {\n border: 15px solid red;\n animation: border-pulsate 2s infinite;\n}\n\n/*\nNo longer works in polaris\n*/\n/*.navpage-layout {*/\n/* border: 15px solid red;*/\n/* animation: border-pulsate 2s infinite;*/\n/*}*/","id":"47038486906e09b866c3263a9ab07617","urls":"https://ac3.service-now.com","js":"if(!g_form && gsft_main) var g_form = gsft_main.g_form;\r\nif(!g_user && gsft_main) var g_user = gsft_main.g_user;\r\n\r\nlet path = top.location.pathname;\r\n\r\nif (g_user.hasRoleExactly('security_admin')) {\r\n return; //break glass by elevating\r\n}\r\n\r\ng_form.elements\r\n .filter((el) => {\r\n if (el.type == 'script' || el.type == 'script_plain' || el.type == 'xml') return true;\r\n })\r\n .map((el) => el.fieldName)\r\n .forEach((fieldName) => {\r\n g_form.setReadOnly(fieldName, true);\r\n g_form.showFieldMsg(fieldName, 'Set read only because you are in prod', 'info', false);\r\n });\r\nlet dangerousPaths = ['script', 'sysauto'];\r\nfor (var p of dangerousPaths) {\r\n console.log(p);\r\n if (path.includes(p)) {\r\n console.log('true', p);\r\n g_form.addInfoMessage('Warning: You are in production, careful what you change');\r\n } else {\r\n console.log('false', p);\r\n }\r\n}","scss":"@keyframes border-pulsate {\r\n 0% {\r\n border-color: rgba(255, 0, 0, 1);\r\n }\r\n 50% {\r\n border-color: rgba(120, 0, 0, 1);\r\n }\r\n 100% {\r\n border-color: rgba(255, 0, 0, 1);\r\n }\r\n}\r\n\r\nbody.section_header_body_no_scroll {\r\n border: 15px solid red;\r\n animation: border-pulsate 2s infinite;\r\n}\r\n\r\nbody {\r\n border: 15px solid red;\r\n animation: border-pulsate 2s infinite;\r\n}\r\n\r\n/*\r\nNo longer works in polaris\r\n*/\r\n/*.navpage-layout {*/\r\n/* border: 15px solid red;*/\r\n/* animation: border-pulsate 2s infinite;*/\r\n \r\n/*}*/","enabled":false}],"libs":[{"isDefault":true,"name":"jQuery 3","src":"@extension@jquery.min.js"}],"version":10,"sync":{"id":"956a96a3-48f1-4f1b-a993-2d21f8aaa275","lastEmitterId":"c5fcff7f-d2ba-47d8-9dbe-79b1af8b40a5","updatedAt":1714975409882}}