7034.js 1.2 KB

12
  1. "use strict";(self.webpackChunkmy_application=self.webpackChunkmy_application||[]).push([[7034],{7034:(n,t,e)=>{e.r(t),e.d(t,{default:()=>o});const o='var jsCode = [\n\t\'"use strict";\',\n\t"function Person(age) {",\n\t"\tif (age) {",\n\t"\t\tthis.age = age;",\n\t"\t}",\n\t"}",\n\t"Person.prototype.getAge = function () {",\n\t"\treturn this.age;",\n\t"};",\n].join("\\n");\n\nvar editor = monaco.editor.create(document.getElementById("container"), {\n\tvalue: jsCode,\n\tlanguage: "javascript",\n});\n\nvar myCondition1 = editor.createContextKey(\n\t/*key name*/ "myCondition1",\n\t/*default value*/ false\n);\nvar myCondition2 = editor.createContextKey(\n\t/*key name*/ "myCondition2",\n\t/*default value*/ false\n);\n\neditor.addCommand(\n\tmonaco.KeyCode.Tab,\n\tfunction () {\n\t\t// services available in `ctx`\n\t\tconsole.log("my command is executing!");\n\t},\n\t"myCondition1 && myCondition2"\n);\n// @ts-ignore\nmyCondition1.set(true);\n\nsetTimeout(function () {\n\tconsole.log("now enabling also myCondition2, try pressing Tab!");\n\t// @ts-ignore\n\tmyCondition2.set(true);\n\t// you can use myCondition2.reset() to go back to the default\n}, 2000);\n'}}]);
  2. //# sourceMappingURL=7034.js.map