130 |
131 |
132 | Custom Dock
133 |
134 |
135 |
136 |
137 |
138 | ${dock.data.text}
139 |
140 |
`;
141 | }
142 | },
143 | destroy() {
144 | console.log("destroy dock:", DOCK_TYPE);
145 | }
146 | });
147 |
148 | const textareaElement = document.createElement("textarea");
149 | this.setting = new Setting({
150 | confirmCallback: () => {
151 | this.saveData(STORAGE_NAME, {readonlyText: textareaElement.value});
152 | }
153 | });
154 | this.setting.addItem({
155 | title: "Readonly text",
156 | direction: "row",
157 | description: "Open plugin url in browser",
158 | createActionElement: () => {
159 | textareaElement.className = "b3-text-field fn__block";
160 | textareaElement.placeholder = "Readonly text in the menu";
161 | textareaElement.value = this.data[STORAGE_NAME].readonlyText;
162 | return textareaElement;
163 | },
164 | });
165 | const btnaElement = document.createElement("button");
166 | btnaElement.className = "b3-button b3-button--outline fn__flex-center fn__size200";
167 | btnaElement.textContent = "Open";
168 | btnaElement.addEventListener("click", () => {
169 | window.open("https://github.com/siyuan-note/plugin-sample");
170 | });
171 | this.setting.addItem({
172 | title: "Open plugin url",
173 | description: "Open plugin url in browser",
174 | actionElement: btnaElement,
175 | });
176 |
177 | this.protyleSlash = [{
178 | filter: ["insert emoji 😊", "插入表情 😊", "crbqwx"],
179 | html: `