Advertisement
Guest User

Untitled

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