PageSourceSearch

https://jakobvogelsang.github.io/src/editors/Substation.js

js jakobvogelsang.github.io collected 2026-10-03 09:23:02 UTC 1,688 bytes, 49 lines download raw bytes

1var __defProp = Object.defineProperty;
2var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3var __decorate = (decorators, target, key, kind) => {
4  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6    if (decorator = decorators[i])
7      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8  if (kind && result)
9    __defProp(target, key, result);
10  return result;
11};
12import {LitElement, html, property, css} from "../../_snowpack/pkg/lit-element.js";
13import {get} from "../../_snowpack/pkg/lit-translate.js";
14import "../../_snowpack/pkg/@material/mwc-fab.js";
15import "./substation/zeroline-pane.js";
16import {newWizardEvent} from "../foundation.js";
17import {wizards} from "../wizards/wizard-library.js";
18export default class SubstationPlugin extends LitElement {
19  openCreateSubstationWizard() {
20    const wizard = wizards["Substation"].create(this.doc.documentElement);
21    if (wizard)
22      this.dispatchEvent(newWizardEvent(wizard));
23  }
24  render() {
25    return html` <zeroline-pane .doc=${this.doc}></zeroline-pane>
26      ${!this.doc?.querySelector(":root > Substation") ? html`<h1>
27            <mwc-fab
28              extended
29              icon="add"
30              label="${get("substation.wizard.title.add")}"
31              @click=${() => this.openCreateSubstationWizard()}
32            ></mwc-fab>
33          </h1>` : html``}`;
34  }
35}
36SubstationPlugin.styles = css`
37    mwc-fab {
38      position: fixed;
39      bottom: 32px;
40      right: 32px;
41    }
42
43    :host {
44      width: 100vw;
45    }
46  `;
47__decorate([
48  property()
49], SubstationPlugin.prototype, "doc", 2);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.