Advertisement
Colornapse_Themes

Untitled

Nov 6th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.08 KB | None | 0 0
  1. ____________________________________________
  2. Synapse Lemon Theme (Pure Yellow)
  3. ____________________________________________
  4. Replace all text with the text below.
  5. ____________________________________________
  6. Do not include this part!
  7. ____________________________________________
  8.  
  9.  
  10. <!DOCTYPE html>
  11.  
  12. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  13. <head>
  14. <style type="text/css">
  15. html,
  16. body {
  17. width: 100%;
  18. height: 100%;
  19. margin: 0;
  20. padding: 0;
  21. overflow: hidden;
  22. }
  23. </style>
  24. <meta charset="utf-8" />
  25. <title></title>
  26. </head>
  27. <body>
  28. <div id="container" style="width:100%;height:100%;"></div>
  29. <script src="vs/loader.js"></script>
  30. <script type="text/javascript">
  31. require.config({ paths: { 'vs': 'vs' } });
  32. // API
  33. var GetText;
  34. var SetText;
  35. var SetTheme;
  36. var SetScroll;
  37. var ShowErr;
  38. var Refresh;
  39.  
  40. // Enablers
  41. var SwitchMinimap;
  42. var SwitchReadonly;
  43. var SwitchRenderWhitespace;
  44. var SwitchLinks;
  45. var SwitchLineHeight;
  46. var SwitchFontSize;
  47. var SwitchFolding;
  48. var SwitchAutoIndent;
  49. var SwitchFontFamily;
  50. var SwitchFontLigatures;
  51. var AddIntellisense;
  52.  
  53. // Variables
  54. var editor;
  55. var Proposals = [];
  56.  
  57. require(['vs/editor/editor.main'], function () {
  58. function getDependencyProposals() {
  59. return Proposals;
  60. }
  61.  
  62. monaco.languages.registerCompletionItemProvider('lua', {
  63. provideCompletionItems: function(model, position) {
  64. return getDependencyProposals();
  65. }
  66. });
  67.  
  68. monaco.editor.defineTheme('net-theme-light', {
  69. base: 'vs',
  70. inherit: true,
  71. rules: [
  72. { token: 'global', foreground: 'fff600' },
  73. { token: 'keyword', foreground: 'fff726' },
  74. { token: 'comment', foreground: 'fff842' },
  75. { token: 'number', foreground: 'fff960' },
  76. { token: 'string', foreground: 'fff97a' },
  77. ]
  78. });
  79.  
  80. monaco.editor.defineTheme('net-theme-dark', {
  81. base: 'vs-dark',
  82. inherit: true,
  83. rules: [
  84. { token: 'global', foreground: 'fff600', fontStyle: "Italic" },
  85. { token: 'keyword', foreground: 'fff726', fontStyle: "Italic" },
  86. { token: 'comment', foreground: 'fff842' },
  87. { token: 'number', foreground: 'fff960' },
  88. { token: 'string', foreground: 'fff97a' },
  89. ]
  90. });
  91.  
  92. editor = monaco.editor.create(document.getElementById('container'), {
  93. value: [
  94. "--[[",
  95. " Lua Script",
  96. "--]]",
  97. ].join('\n'),
  98. language: 'lua',
  99. theme: "net-theme-light",
  100. folding: true,
  101. scrollbar: {
  102. verticalHasArrows: true,
  103. },
  104. dragAndDrop: true,
  105. links: false,
  106. minimap: {
  107. enabled: false,
  108. },
  109. showFoldingControls: "always",
  110. smoothScrolling: true,
  111. });
  112.  
  113. window.onresize = function() {
  114. editor.layout();
  115. };
  116.  
  117. GetText = function() {
  118. return editor.getValue();
  119. }
  120.  
  121. SetText = function(x) {
  122. editor.setValue(x);
  123. }
  124.  
  125. SetTheme = function(themeName) {
  126. if (themeName == "Dark") {
  127. monaco.editor.setTheme("net-theme-dark");
  128. }
  129. if (themeName == "Light") {
  130. monaco.editor.setTheme("net-theme-light");
  131. }
  132. }
  133.  
  134. SwitchMinimap = function(flag) {
  135. editor.updateOptions({
  136. minimap: {
  137. enabled: flag,
  138. }
  139. });
  140. }
  141.  
  142. SwitchReadonly = function(flag) {
  143. editor.updateOptions({
  144. readOnly: flag,
  145. });
  146. }
  147.  
  148. SwitchRenderWhitespace = function(op) {
  149. editor.updateOptions({
  150. renderWhitespace: op,
  151. });
  152. }
  153.  
  154. SwitchLinks = function(flag) {
  155. editor.updateOptions({
  156. links: flag,
  157. });
  158. }
  159.  
  160. SwitchLineHeight = function(num) {
  161. editor.updateOptions({
  162. lineHeight: num,
  163. });
  164. }
  165.  
  166. SwitchFontSize = function(num) {
  167. editor.updateOptions({
  168. fontSize: num,
  169. });
  170. }
  171.  
  172. SwitchFolding = function(flag) {
  173. editor.updateOptions({
  174. folding: flag,
  175. });
  176. }
  177.  
  178. SwitchAutoIndent = function(flag) {
  179. editor.updateOptions({
  180. autoIndent: flag,
  181. });
  182. }
  183.  
  184. SwitchFontFamily = function(name) {
  185. editor.updateOptions({
  186. fontFamily: name,
  187. });
  188. }
  189.  
  190. SwitchFontLigatures = function(flag) {
  191. editor.updateOptions({
  192. fontLigatures: flag,
  193. });
  194. }
  195.  
  196.  
  197. ShowErr = function(line, column, endline, endcolumn, errMessage) {
  198. editor.revealPositionInCenter({ lineNumber: line, column: column});
  199. editor.deltaDecorations([], [
  200. {
  201. range: new monaco.Range(line, column, endline, endcolumn),
  202. options: {
  203. inlineClassName: 'squiggly-error',
  204. hoverMessage: {
  205. value: errMessage,
  206. }
  207. },
  208. },
  209. ]);
  210. }
  211.  
  212. AddIntellisense = function(l, k, d, i) {
  213. var t;
  214. switch(k)
  215. {
  216. case "Class":
  217. t = monaco.languages.CompletionItemKind.Class;
  218. break;
  219. case "Color":
  220. t = monaco.languages.CompletionItemKind.Color;
  221. break;
  222. case "Constructor":
  223. t = monaco.languages.CompletionItemKind.Constructor;
  224. break;
  225. case "Enum":
  226. t = monaco.languages.CompletionItemKind.Enum;
  227. break;
  228. case "Field":
  229. t = monaco.languages.CompletionItemKind.Field;
  230. break;
  231. case "File":
  232. t = monaco.languages.CompletionItemKind.File;
  233. break;
  234. case "Folder":
  235. t = monaco.languages.CompletionItemKind.Folder;
  236. break;
  237. case "Function":
  238. t = monaco.languages.CompletionItemKind.Function;
  239. break;
  240. case "Interface":
  241. t = monaco.languages.CompletionItemKind.Interface;
  242. break;
  243. case "Keyword":
  244. t = monaco.languages.CompletionItemKind.Keyword;
  245. break;
  246. case "Method":
  247. t = monaco.languages.CompletionItemKind.Method;
  248. break;
  249. case "Module":
  250. t = monaco.languages.CompletionItemKind.Module;
  251. break;
  252. case "Property":
  253. t = monaco.languages.CompletionItemKind.Property;
  254. break;
  255. case "Reference":
  256. t = monaco.languages.CompletionItemKind.Reference;
  257. break;
  258. case "Snippet":
  259. t = monaco.languages.CompletionItemKind.Snippet;
  260. break;
  261. case "Text":
  262. t = monaco.languages.CompletionItemKind.Text;
  263. break;
  264. case "Unit":
  265. t = monaco.languages.CompletionItemKind.Unit;
  266. break;
  267. case "Value":
  268. t = monaco.languages.CompletionItemKind.Value;
  269. break;
  270. case "Variable":
  271. t = monaco.languages.CompletionItemKind.Variable;
  272. break;
  273. }
  274.  
  275. Proposals.push({
  276. label: l,
  277. kind: t,
  278. detail: d,
  279. insertText: i
  280. });
  281. }
  282.  
  283. SetScroll = function(line) {
  284. editor.revealLineInCenter({ lineNumber: line});
  285. }
  286.  
  287. Refresh = function() {
  288. var text = getText();
  289. setText("");
  290. editor.trigger('keyboard', 'type', {text: text});
  291. }
  292. });
  293. </script>
  294. </body>
  295. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement