MCPcopy Index your code
hub / github.com/hoothin/UserScripts / createEdit

Function createEdit

Pagetual/pagetual.user.js:9390–9454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9388
9389 var editor, editorChanged = false, customRulesInput, wedata2githubInputRef;
9390 function createEdit() {
9391 var options = {
9392 mode: 'code',
9393 modes: ['code', 'tree'],
9394 templates: [
9395 {
9396 text: 'New site',
9397 title: 'Insert a new site',
9398 className: 'jsoneditor-type-object',
9399 field: 'SiteTemplate',
9400 value: {
9401 'name': 'Site name',
9402 'url': 'Site url'
9403 }
9404 }
9405 ],
9406 schema: {
9407 "title": "Sites data",
9408 "description": "Object containing site config",
9409 "type": "array",
9410 "items": {
9411 "type": 'object',
9412 "properties": {
9413 "name": {
9414 "title": "Site Name",
9415 "description": "The site's name.",
9416 "examples": [
9417 "Google"
9418 ],
9419 "type": "string"
9420 },
9421 "url": {
9422 "title": "Site Url",
9423 "description": "The Regexp of site's url.",
9424 "examples": [
9425 "^https:\/\/yande\\.re\/"
9426 ],
9427 "type": "string"
9428 }
9429 },
9430 "required": ["name", "url"]
9431 }
9432 },
9433 onChange: () => {
9434 editorChanged = true;
9435 }
9436 };
9437 setTimeout(() => {
9438 var container = document.getElementById("jsoneditor");
9439 if (!container) {
9440 container = document.createElement("div");
9441 configCon.appendChild(container);
9442 }
9443 container.style.height = '800px';
9444 setHTML(container, "");
9445 try {
9446 editor = new _unsafeWindow.JSONEditor(container, options);
9447 editor.set(ruleParser.customRules);

Callers 1

checkGuidePageFunction · 0.85

Calls 1

setHTMLFunction · 0.70

Tested by

no test coverage detected