├── .DS_Store
├── .github
└── FUNDING.yml
├── .gitignore
├── LICENSE
├── README.md
├── assets
├── configureSnippets.png
├── defaultApp.png
├── getInfo.png
├── kofi.svg
├── kofi_color.svg
├── paypal.svg
└── setDefault.png
├── manifest.json
├── package.json
├── rollup.config.js
├── src
├── .DS_Store
├── icons
│ └── customIcons.ts
├── modal
│ └── createSnippetModal.ts
├── plugin
│ └── main.ts
├── settings
│ ├── settingsData.ts
│ ├── settingsTab.ts
│ └── type.ts
├── ui
│ └── snippetsMenu.ts
└── util
│ ├── setAttributes.ts
│ └── wait.ts
├── styles.css
├── tsconfig.json
└── versions.json
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/.DS_Store
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: chetachiezikeuzor
2 | ko_fi: chetachi
3 | custom:
4 | [
5 | "https://www.buymeacoffee.com/chetachi",
6 | "https://paypal.me/chelseaezikeuzor",
7 | ]
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Intellij
2 | *.iml
3 | .idea
4 |
5 | # npm
6 | node_modules
7 | package-lock.json
8 |
9 | # build
10 | main.js
11 | *.js.map
12 |
13 | # obsidian
14 | data.json
15 |
16 | # history
17 | .history
18 | *.DS_Store
19 | .DS_Store
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Mozilla Public License Version 2.0
2 | ==================================
3 |
4 | 1. Definitions
5 | --------------
6 |
7 | 1.1. "Contributor"
8 | means each individual or legal entity that creates, contributes to
9 | the creation of, or owns Covered Software.
10 |
11 | 1.2. "Contributor Version"
12 | means the combination of the Contributions of others (if any) used
13 | by a Contributor and that particular Contributor's Contribution.
14 |
15 | 1.3. "Contribution"
16 | means Covered Software of a particular Contributor.
17 |
18 | 1.4. "Covered Software"
19 | means Source Code Form to which the initial Contributor has attached
20 | the notice in Exhibit A, the Executable Form of such Source Code
21 | Form, and Modifications of such Source Code Form, in each case
22 | including portions thereof.
23 |
24 | 1.5. "Incompatible With Secondary Licenses"
25 | means
26 |
27 | (a) that the initial Contributor has attached the notice described
28 | in Exhibit B to the Covered Software; or
29 |
30 | (b) that the Covered Software was made available under the terms of
31 | version 1.1 or earlier of the License, but not also under the
32 | terms of a Secondary License.
33 |
34 | 1.6. "Executable Form"
35 | means any form of the work other than Source Code Form.
36 |
37 | 1.7. "Larger Work"
38 | means a work that combines Covered Software with other material, in
39 | a separate file or files, that is not Covered Software.
40 |
41 | 1.8. "License"
42 | means this document.
43 |
44 | 1.9. "Licensable"
45 | means having the right to grant, to the maximum extent possible,
46 | whether at the time of the initial grant or subsequently, any and
47 | all of the rights conveyed by this License.
48 |
49 | 1.10. "Modifications"
50 | means any of the following:
51 |
52 | (a) any file in Source Code Form that results from an addition to,
53 | deletion from, or modification of the contents of Covered
54 | Software; or
55 |
56 | (b) any new file in Source Code Form that contains any Covered
57 | Software.
58 |
59 | 1.11. "Patent Claims" of a Contributor
60 | means any patent claim(s), including without limitation, method,
61 | process, and apparatus claims, in any patent Licensable by such
62 | Contributor that would be infringed, but for the grant of the
63 | License, by the making, using, selling, offering for sale, having
64 | made, import, or transfer of either its Contributions or its
65 | Contributor Version.
66 |
67 | 1.12. "Secondary License"
68 | means either the GNU General Public License, Version 2.0, the GNU
69 | Lesser General Public License, Version 2.1, the GNU Affero General
70 | Public License, Version 3.0, or any later versions of those
71 | licenses.
72 |
73 | 1.13. "Source Code Form"
74 | means the form of the work preferred for making modifications.
75 |
76 | 1.14. "You" (or "Your")
77 | means an individual or a legal entity exercising rights under this
78 | License. For legal entities, "You" includes any entity that
79 | controls, is controlled by, or is under common control with You. For
80 | purposes of this definition, "control" means (a) the power, direct
81 | or indirect, to cause the direction or management of such entity,
82 | whether by contract or otherwise, or (b) ownership of more than
83 | fifty percent (50%) of the outstanding shares or beneficial
84 | ownership of such entity.
85 |
86 | 2. License Grants and Conditions
87 | --------------------------------
88 |
89 | 2.1. Grants
90 |
91 | Each Contributor hereby grants You a world-wide, royalty-free,
92 | non-exclusive license:
93 |
94 | (a) under intellectual property rights (other than patent or trademark)
95 | Licensable by such Contributor to use, reproduce, make available,
96 | modify, display, perform, distribute, and otherwise exploit its
97 | Contributions, either on an unmodified basis, with Modifications, or
98 | as part of a Larger Work; and
99 |
100 | (b) under Patent Claims of such Contributor to make, use, sell, offer
101 | for sale, have made, import, and otherwise transfer either its
102 | Contributions or its Contributor Version.
103 |
104 | 2.2. Effective Date
105 |
106 | The licenses granted in Section 2.1 with respect to any Contribution
107 | become effective for each Contribution on the date the Contributor first
108 | distributes such Contribution.
109 |
110 | 2.3. Limitations on Grant Scope
111 |
112 | The licenses granted in this Section 2 are the only rights granted under
113 | this License. No additional rights or licenses will be implied from the
114 | distribution or licensing of Covered Software under this License.
115 | Notwithstanding Section 2.1(b) above, no patent license is granted by a
116 | Contributor:
117 |
118 | (a) for any code that a Contributor has removed from Covered Software;
119 | or
120 |
121 | (b) for infringements caused by: (i) Your and any other third party's
122 | modifications of Covered Software, or (ii) the combination of its
123 | Contributions with other software (except as part of its Contributor
124 | Version); or
125 |
126 | (c) under Patent Claims infringed by Covered Software in the absence of
127 | its Contributions.
128 |
129 | This License does not grant any rights in the trademarks, service marks,
130 | or logos of any Contributor (except as may be necessary to comply with
131 | the notice requirements in Section 3.4).
132 |
133 | 2.4. Subsequent Licenses
134 |
135 | No Contributor makes additional grants as a result of Your choice to
136 | distribute the Covered Software under a subsequent version of this
137 | License (see Section 10.2) or under the terms of a Secondary License (if
138 | permitted under the terms of Section 3.3).
139 |
140 | 2.5. Representation
141 |
142 | Each Contributor represents that the Contributor believes its
143 | Contributions are its original creation(s) or it has sufficient rights
144 | to grant the rights to its Contributions conveyed by this License.
145 |
146 | 2.6. Fair Use
147 |
148 | This License is not intended to limit any rights You have under
149 | applicable copyright doctrines of fair use, fair dealing, or other
150 | equivalents.
151 |
152 | 2.7. Conditions
153 |
154 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155 | in Section 2.1.
156 |
157 | 3. Responsibilities
158 | -------------------
159 |
160 | 3.1. Distribution of Source Form
161 |
162 | All distribution of Covered Software in Source Code Form, including any
163 | Modifications that You create or to which You contribute, must be under
164 | the terms of this License. You must inform recipients that the Source
165 | Code Form of the Covered Software is governed by the terms of this
166 | License, and how they can obtain a copy of this License. You may not
167 | attempt to alter or restrict the recipients' rights in the Source Code
168 | Form.
169 |
170 | 3.2. Distribution of Executable Form
171 |
172 | If You distribute Covered Software in Executable Form then:
173 |
174 | (a) such Covered Software must also be made available in Source Code
175 | Form, as described in Section 3.1, and You must inform recipients of
176 | the Executable Form how they can obtain a copy of such Source Code
177 | Form by reasonable means in a timely manner, at a charge no more
178 | than the cost of distribution to the recipient; and
179 |
180 | (b) You may distribute such Executable Form under the terms of this
181 | License, or sublicense it under different terms, provided that the
182 | license for the Executable Form does not attempt to limit or alter
183 | the recipients' rights in the Source Code Form under this License.
184 |
185 | 3.3. Distribution of a Larger Work
186 |
187 | You may create and distribute a Larger Work under terms of Your choice,
188 | provided that You also comply with the requirements of this License for
189 | the Covered Software. If the Larger Work is a combination of Covered
190 | Software with a work governed by one or more Secondary Licenses, and the
191 | Covered Software is not Incompatible With Secondary Licenses, this
192 | License permits You to additionally distribute such Covered Software
193 | under the terms of such Secondary License(s), so that the recipient of
194 | the Larger Work may, at their option, further distribute the Covered
195 | Software under the terms of either this License or such Secondary
196 | License(s).
197 |
198 | 3.4. Notices
199 |
200 | You may not remove or alter the substance of any license notices
201 | (including copyright notices, patent notices, disclaimers of warranty,
202 | or limitations of liability) contained within the Source Code Form of
203 | the Covered Software, except that You may alter any license notices to
204 | the extent required to remedy known factual inaccuracies.
205 |
206 | 3.5. Application of Additional Terms
207 |
208 | You may choose to offer, and to charge a fee for, warranty, support,
209 | indemnity or liability obligations to one or more recipients of Covered
210 | Software. However, You may do so only on Your own behalf, and not on
211 | behalf of any Contributor. You must make it absolutely clear that any
212 | such warranty, support, indemnity, or liability obligation is offered by
213 | You alone, and You hereby agree to indemnify every Contributor for any
214 | liability incurred by such Contributor as a result of warranty, support,
215 | indemnity or liability terms You offer. You may include additional
216 | disclaimers of warranty and limitations of liability specific to any
217 | jurisdiction.
218 |
219 | 4. Inability to Comply Due to Statute or Regulation
220 | ---------------------------------------------------
221 |
222 | If it is impossible for You to comply with any of the terms of this
223 | License with respect to some or all of the Covered Software due to
224 | statute, judicial order, or regulation then You must: (a) comply with
225 | the terms of this License to the maximum extent possible; and (b)
226 | describe the limitations and the code they affect. Such description must
227 | be placed in a text file included with all distributions of the Covered
228 | Software under this License. Except to the extent prohibited by statute
229 | or regulation, such description must be sufficiently detailed for a
230 | recipient of ordinary skill to be able to understand it.
231 |
232 | 5. Termination
233 | --------------
234 |
235 | 5.1. The rights granted under this License will terminate automatically
236 | if You fail to comply with any of its terms. However, if You become
237 | compliant, then the rights granted under this License from a particular
238 | Contributor are reinstated (a) provisionally, unless and until such
239 | Contributor explicitly and finally terminates Your grants, and (b) on an
240 | ongoing basis, if such Contributor fails to notify You of the
241 | non-compliance by some reasonable means prior to 60 days after You have
242 | come back into compliance. Moreover, Your grants from a particular
243 | Contributor are reinstated on an ongoing basis if such Contributor
244 | notifies You of the non-compliance by some reasonable means, this is the
245 | first time You have received notice of non-compliance with this License
246 | from such Contributor, and You become compliant prior to 30 days after
247 | Your receipt of the notice.
248 |
249 | 5.2. If You initiate litigation against any entity by asserting a patent
250 | infringement claim (excluding declaratory judgment actions,
251 | counter-claims, and cross-claims) alleging that a Contributor Version
252 | directly or indirectly infringes any patent, then the rights granted to
253 | You by any and all Contributors for the Covered Software under Section
254 | 2.1 of this License shall terminate.
255 |
256 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257 | end user license agreements (excluding distributors and resellers) which
258 | have been validly granted by You or Your distributors under this License
259 | prior to termination shall survive termination.
260 |
261 | ************************************************************************
262 | * *
263 | * 6. Disclaimer of Warranty *
264 | * ------------------------- *
265 | * *
266 | * Covered Software is provided under this License on an "as is" *
267 | * basis, without warranty of any kind, either expressed, implied, or *
268 | * statutory, including, without limitation, warranties that the *
269 | * Covered Software is free of defects, merchantable, fit for a *
270 | * particular purpose or non-infringing. The entire risk as to the *
271 | * quality and performance of the Covered Software is with You. *
272 | * Should any Covered Software prove defective in any respect, You *
273 | * (not any Contributor) assume the cost of any necessary servicing, *
274 | * repair, or correction. This disclaimer of warranty constitutes an *
275 | * essential part of this License. No use of any Covered Software is *
276 | * authorized under this License except under this disclaimer. *
277 | * *
278 | ************************************************************************
279 |
280 | ************************************************************************
281 | * *
282 | * 7. Limitation of Liability *
283 | * -------------------------- *
284 | * *
285 | * Under no circumstances and under no legal theory, whether tort *
286 | * (including negligence), contract, or otherwise, shall any *
287 | * Contributor, or anyone who distributes Covered Software as *
288 | * permitted above, be liable to You for any direct, indirect, *
289 | * special, incidental, or consequential damages of any character *
290 | * including, without limitation, damages for lost profits, loss of *
291 | * goodwill, work stoppage, computer failure or malfunction, or any *
292 | * and all other commercial damages or losses, even if such party *
293 | * shall have been informed of the possibility of such damages. This *
294 | * limitation of liability shall not apply to liability for death or *
295 | * personal injury resulting from such party's negligence to the *
296 | * extent applicable law prohibits such limitation. Some *
297 | * jurisdictions do not allow the exclusion or limitation of *
298 | * incidental or consequential damages, so this exclusion and *
299 | * limitation may not apply to You. *
300 | * *
301 | ************************************************************************
302 |
303 | 8. Litigation
304 | -------------
305 |
306 | Any litigation relating to this License may be brought only in the
307 | courts of a jurisdiction where the defendant maintains its principal
308 | place of business and such litigation shall be governed by laws of that
309 | jurisdiction, without reference to its conflict-of-law provisions.
310 | Nothing in this Section shall prevent a party's ability to bring
311 | cross-claims or counter-claims.
312 |
313 | 9. Miscellaneous
314 | ----------------
315 |
316 | This License represents the complete agreement concerning the subject
317 | matter hereof. If any provision of this License is held to be
318 | unenforceable, such provision shall be reformed only to the extent
319 | necessary to make it enforceable. Any law or regulation which provides
320 | that the language of a contract shall be construed against the drafter
321 | shall not be used to construe this License against a Contributor.
322 |
323 | 10. Versions of the License
324 | ---------------------------
325 |
326 | 10.1. New Versions
327 |
328 | Mozilla Foundation is the license steward. Except as provided in Section
329 | 10.3, no one other than the license steward has the right to modify or
330 | publish new versions of this License. Each version will be given a
331 | distinguishing version number.
332 |
333 | 10.2. Effect of New Versions
334 |
335 | You may distribute the Covered Software under the terms of the version
336 | of the License under which You originally received the Covered Software,
337 | or under the terms of any subsequent version published by the license
338 | steward.
339 |
340 | 10.3. Modified Versions
341 |
342 | If you create software not governed by this License, and you want to
343 | create a new license for such software, you may create and use a
344 | modified version of this License if you rename the license and remove
345 | any references to the name of the license steward (except to note that
346 | such modified license differs from this License).
347 |
348 | 10.4. Distributing Source Code Form that is Incompatible With Secondary
349 | Licenses
350 |
351 | If You choose to distribute Source Code Form that is Incompatible With
352 | Secondary Licenses under the terms of this version of the License, the
353 | notice described in Exhibit B of this License must be attached.
354 |
355 | Exhibit A - Source Code Form License Notice
356 | -------------------------------------------
357 |
358 | This Source Code Form is subject to the terms of the Mozilla Public
359 | License, v. 2.0. If a copy of the MPL was not distributed with this
360 | file, You can obtain one at http://mozilla.org/MPL/2.0/.
361 |
362 | If it is not possible or desirable to put the notice in a particular
363 | file, then You may include the notice in a location (such as a LICENSE
364 | file in a relevant directory) where a recipient would be likely to look
365 | for such a notice.
366 |
367 | You may add additional accurate notices of copyright ownership.
368 |
369 | Exhibit B - "Incompatible With Secondary Licenses" Notice
370 | ---------------------------------------------------------
371 |
372 | This Source Code Form is "Incompatible With Secondary Licenses", as
373 | defined by the Mozilla Public License, v. 2.0.
374 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MySnippets Plugin
2 |
3 | 
4 | 
5 |
6 |
7 |
8 | ### Status: This plugin is currently available in the Obsidian plugin store
9 |
10 | Remember that one time, where you were trying to test out a few cool and new snippets? Oh, but you had to constantly, go back and forth between workspace and settings tab just to toggle them on and off. Been there, done that… but wait! What if you could… I dunno… have your snippets right there in front of you? What if you could toggle your snippets on and off from the comfort of your workspace? That'd be super cool, right? I know! Well, you've come to the right place!
11 |
12 | MySnippets is a plugin that adds a status bar menu allowing the user to quickly manage their snippets within the comfort of their workspace 🖌. This plugin makes managing snippets a breeze with a beautiful mini menu that shows up with a click of a button!
13 |
14 | ## Demo
15 |
16 |
17 |
18 |
19 |
20 | ## Ease of Use
21 |
22 | We all love hacking away at Obsidian with a bunch of different snippets, but I'm willing to bet that most of us don't like having to trigger and re-trigger the settings tab just to get to our snippets. With MySnippets, we can finally access our snippets and toggle them on and off easily! Think of it as a condensed and tucked away version of the "CSS Snippets" section in the settings tab. I don't know about you, but when I want to edit my snippets, I don't want to have to rummage through the settings tab just to get to them! It can be distracting, a time waster, and just overall annoying! So let's end the era of `Settings > Appearance > CSS Snippets` and welcome the new era of ← _Click_!
23 |
24 |
25 |
26 | ## How it Works
27 |
28 | MySnippets appends a cute little status bar icon in your workspace. All you need to do is click and see all of your lovely snippets in a menu! Here, you will see two buttons to the bottom of the menu. The first is your "Reload" button and the second is your "Folder" button. Triggering "Reload" button will allow the plugin to reread your snippets folder, in case you have decided to create a new snippet or delete a snippet. Triggering the "Folder" button will open the folder that houses your snippets. These buttons mimic the functions in the settings tab.
29 |
30 |
31 |
32 | Each snippet item has a toggle and a button. You can use the toggle to turn your snippet off/on.
33 |
34 |
35 |
36 | You can also use the button to open your snippet with your default application for CSS files.
37 |
38 |
39 |
40 | On Mac, you can change your default application by right-clicking on any CSS file, then click "Get info." Then, Go to the "Open with" section and choose the application you'd like to use. Use the "Change All..." button to set this application as your default application to open CSS files.
41 |
42 |
43 |
44 | With MySnippets, you can change the design aesthetic. You can choose to have a "glass" style for MySnippets within the settings tab, which gives it a unique and futuristic look!
45 |
46 |
47 |
48 |
49 |
50 | ### Create New CSS Snippets
51 |
52 | Version [1.1.0](https://github.com/chetachiezikeuzor/MySnippets-Plugin/releases/tag/1.1.0) now adds the functionality to create new CSS snippets using a modal. All you have to do is provide the name of the file and the file contents. You can also set a template for your new snippets within the settings tab. There are settings added that allow you to decide whether or not you want your new snippets to open automatically after creating them, and whether you want your snippets to be automatically toggled on after creating them.
53 |
54 |
55 |
56 | ## Installation
57 |
58 | This plugin is now available in the community plugin store. You can install it from there and enable it. For a manual installation, you can download the necessary files and place them within your plugins folder.
59 |
60 | ---
61 |
62 | ## Changelog
63 |
64 | ### [1.1.0](https://github.com/chetachiezikeuzor/MySnippets-Plugin/releases/tag/1.1.0) - Dec 4, 2021
65 |
66 | ##### Added
67 |
68 | - Create new CSS snippets function
69 |
70 |
71 | ##### Fixed
72 |
73 | - MySnippets menu positioning is now dependent on window coordinates (solves issue with hidden status bar).
74 |
75 | ---
76 |
77 | ## Checklist
78 |
79 | - [x] Command to open snippets menu
80 | - [x] Create new CSS snippets function
81 |
82 | ---
83 |
84 | ## Support
85 |
86 | If you like this plugin and are considering donating to support continued development, use the button below!
87 |
88 | Created with ❤️ by Chetachi
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/assets/configureSnippets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/assets/configureSnippets.png
--------------------------------------------------------------------------------
/assets/defaultApp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/assets/defaultApp.png
--------------------------------------------------------------------------------
/assets/getInfo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/assets/getInfo.png
--------------------------------------------------------------------------------
/assets/kofi.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/kofi_color.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/paypal.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/setDefault.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/assets/setDefault.png
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "mysnippets-plugin",
3 | "name": "MySnippets",
4 | "version": "1.2.3",
5 | "minAppVersion": "0.15.3",
6 | "description": "MySnippets is a plugin that adds a status bar menu allowing the user to quickly toggle their snippets on and off 🖌.",
7 | "author": "chetachi",
8 | "authorUrl": "https://github.com/chetachiezikeuzor",
9 | "isDesktopOnly": true
10 | }
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mysnippets-plugin",
3 | "version": "0.12.0",
4 | "description": "MySnippets is a plugin that adds a status bar menu allowing the user to quickly manage their snippets within the comfort of their workspace 🖌.",
5 | "main": "main.js",
6 | "scripts": {
7 | "dev": "rollup --config rollup.config.js -w",
8 | "build": "rollup --config rollup.config.js --environment BUILD:production"
9 | },
10 | "keywords": [],
11 | "author": "",
12 | "license": "MIT",
13 | "devDependencies": {
14 | "@rollup/plugin-commonjs": "^18.0.0",
15 | "@rollup/plugin-node-resolve": "^11.2.1",
16 | "@rollup/plugin-typescript": "^8.2.1",
17 | "@types/node": "^14.14.37",
18 | "@types/sortablejs": "^1.10.7",
19 | "obsidian": "^0.15.3",
20 | "rollup": "^2.32.1",
21 | "tslib": "^2.2.0",
22 | "typescript": "^4.2.4"
23 | },
24 | "dependencies": {
25 | "create-file": "^1.0.1",
26 | "open": "^8.3.0",
27 | "sortablejs": "^1.14.0"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import typescript from "@rollup/plugin-typescript";
2 | import { nodeResolve } from "@rollup/plugin-node-resolve";
3 | import commonjs from "@rollup/plugin-commonjs";
4 |
5 | const isProd = process.env.BUILD === "production";
6 |
7 | const banner = `/*
8 | THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
9 | if you want to view the source visit the plugins github repository
10 | */
11 | `;
12 |
13 | export default {
14 | input: "src/plugin/main.ts",
15 | output: {
16 | dir: ".",
17 | sourcemap: "inline",
18 | sourcemapExcludeSources: isProd,
19 | format: "cjs",
20 | exports: "default",
21 | banner,
22 | },
23 | external: ["obsidian"],
24 | plugins: [typescript(), nodeResolve({ browser: true }), commonjs()],
25 | };
26 |
--------------------------------------------------------------------------------
/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chetachiezikeuzor/MySnippets-Plugin/9c9ea94bdfa6c83127ff27d452408e6a47aec604/src/.DS_Store
--------------------------------------------------------------------------------
/src/icons/customIcons.ts:
--------------------------------------------------------------------------------
1 | import { addIcon } from "obsidian";
2 |
3 | export const icons: Record = {
4 | "art-fill": ``,
5 | "art-brush": ``,
6 | "ms-create-file": ``,
7 | "pantone-line": ``,
8 | "ms-code": ``,
9 | "ms-reload": ``,
10 | "ms-folder": ``,
11 | "ms-snippet": ``,
12 | "ms-add": ``,
13 | "ms-save": ``,
14 | "ms-delete": ``,
15 | "ms-css-file": ``,
16 | };
17 |
18 | export function addIcons() {
19 | Object.keys(icons).forEach((key) => {
20 | addIcon(key, icons[key]);
21 | });
22 | }
23 |
--------------------------------------------------------------------------------
/src/modal/createSnippetModal.ts:
--------------------------------------------------------------------------------
1 | import {
2 | Modal,
3 | Setting,
4 | TextComponent,
5 | ButtonComponent,
6 | TextAreaComponent,
7 | Notice,
8 | } from "obsidian";
9 | import type MySnippetsPlugin from "../plugin/main";
10 | import { setAttributes } from "src/util/setAttributes";
11 | import { EnhancedApp } from "src/settings/type";
12 |
13 | export default class CreateSnippetModal extends Modal {
14 | path: string;
15 | plugin: MySnippetsPlugin;
16 | mySnippetsEl: HTMLDivElement;
17 | app: EnhancedApp;
18 |
19 | constructor(app: EnhancedApp, plugin: MySnippetsPlugin) {
20 | super(app);
21 | this.app = app;
22 | this.plugin = plugin;
23 | this.onOpen = () => this.display(true);
24 | }
25 |
26 | private async display(focus?: boolean) {
27 | const { contentEl } = this;
28 | const customCss = this.app.customCss;
29 |
30 | contentEl.empty();
31 | contentEl.setAttribute("style", "margin-top: 0px");
32 |
33 | const title = document.createElement("h1");
34 | title.setText("Create a CSS Snippet");
35 | contentEl.appendChild(title);
36 |
37 | const fileTitleSetting = new Setting(contentEl);
38 | const fileTitleValue = new TextComponent(fileTitleSetting.controlEl);
39 | fileTitleSetting
40 | .setName("CSS Snippet Title")
41 | .setDesc("Write the title for this CSS snippet file.");
42 |
43 | const cssStylesSetting = new Setting(contentEl);
44 |
45 | // avoiding having to reference this specific modal - add style in code
46 | cssStylesSetting.settingEl.setAttribute(
47 | "style",
48 | "display: grid; grid-template-columns: 1fr;"
49 | );
50 | const cssStylesValue = new TextAreaComponent(cssStylesSetting.controlEl);
51 | setAttributes(cssStylesValue.inputEl, {
52 | style: "margin-top: 12px; width: 100%; height: 32vh;",
53 | class: "ms-css-editor",
54 | });
55 | cssStylesSetting
56 | .setName("CSS Snippet Styles")
57 | .setDesc("Add in styling for this CSS snippet file.");
58 | cssStylesValue.setValue(this.plugin.settings.stylingTemplate);
59 |
60 | const doAdd = async () => {
61 | let fileName = fileTitleValue.getValue();
62 | let fileContents = cssStylesValue.getValue();
63 | let snippetPath = customCss.getSnippetPath(fileName);
64 | if (fileName) {
65 | if (!customCss.snippets.includes(fileName)) {
66 | await app.vault.create(
67 | `${customCss.getSnippetsFolder()}/${fileName}.css`,
68 | fileContents
69 | );
70 | console.log(`%c"${fileName}.css" has been created!`, "color: Violet");
71 | if (this.plugin.settings.snippetEnabledStatus)
72 | customCss.setCssEnabledStatus(fileName, true);
73 |
74 | if (this.plugin.settings.openSnippetFile)
75 | this.app.openWithDefaultApp(snippetPath);
76 |
77 | customCss.requestLoadSnippets();
78 | this.close();
79 | } else new Notice(`"${fileName}.css" already exists.`);
80 | } else new Notice("Missing name for file");
81 | };
82 | const saveButton = new ButtonComponent(contentEl)
83 | .setButtonText("Create Snippet")
84 | .onClick(doAdd);
85 | saveButton.buttonEl.addClass("wg-button");
86 | fileTitleValue.inputEl.focus();
87 | }
88 |
89 | onClose(): void {
90 | const { contentEl } = this;
91 | contentEl.empty();
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/plugin/main.ts:
--------------------------------------------------------------------------------
1 | import { Plugin, setIcon } from "obsidian";
2 | import { setAttributes } from "src/util/setAttributes";
3 | import snippetsMenu from "src/ui/snippetsMenu";
4 | import { addIcons } from "src/icons/customIcons";
5 | import { MySnippetsSettingTab } from "src/settings/settingsTab";
6 | import {
7 | MySnippetsSettings,
8 | DEFAULT_SETTINGS,
9 | } from "src/settings/settingsData";
10 | import CreateSnippetModal from "src/modal/createSnippetModal";
11 | import { EnhancedApp } from "src/settings/type";
12 |
13 | export default class MySnippetsPlugin extends Plugin {
14 | settings: MySnippetsSettings;
15 | statusBarIcon: HTMLElement;
16 | app: EnhancedApp;
17 |
18 | async onload() {
19 | console.log(`MySnippets v${this.manifest.version} loaded`);
20 | addIcons();
21 |
22 | await this.loadSettings();
23 |
24 | this.addSettingTab(new MySnippetsSettingTab(this.app, this));
25 | this.app.workspace.onLayoutReady(() => {
26 | setTimeout(() => {
27 | this.setupSnippetsStatusBarIcon();
28 | });
29 | });
30 | }
31 |
32 | setupSnippetsStatusBarIcon() {
33 | this.statusBarIcon = this.addStatusBarItem();
34 | this.statusBarIcon.addClass("MiniSettings-statusbar-button");
35 | this.statusBarIcon.addClass("mod-clickable");
36 |
37 | setAttributes(this.statusBarIcon, {
38 | "aria-label": "Configure Snippets",
39 | "aria-label-position": "top",
40 | });
41 | setIcon(this.statusBarIcon, "pantone-line");
42 |
43 | this.statusBarIcon.addEventListener("click", () => {
44 | snippetsMenu(this.app, this, this.settings);
45 | });
46 |
47 | this.addCommand({
48 | id: `open-snippets-menu`,
49 | name: `Open snippets in status bar`,
50 | icon: `pantone-line`,
51 | callback: async () => {
52 | snippetsMenu(this.app, this, this.settings);
53 | },
54 | });
55 | this.addCommand({
56 | id: `open-snippets-create`,
57 | name: `Create new CSS snippet`,
58 | icon: `ms-css-file`,
59 | callback: async () => {
60 | new CreateSnippetModal(this.app, this).open();
61 | },
62 | });
63 | }
64 |
65 | onunload() {
66 | console.log("MySnippets unloaded");
67 | }
68 |
69 | async loadSettings() {
70 | this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
71 | }
72 |
73 | async saveSettings() {
74 | await this.saveData(this.settings);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/settings/settingsData.ts:
--------------------------------------------------------------------------------
1 | export const SNIPPET_VIEW_SIDE = ["right", "left"];
2 |
3 | export interface MySnippetsSettings {
4 | aestheticStyle: boolean;
5 | snippetViewPosition: string;
6 | openSnippetFile: boolean;
7 | stylingTemplate: string;
8 | snippetEnabledStatus: boolean;
9 | }
10 |
11 | export const DEFAULT_SETTINGS: MySnippetsSettings = {
12 | aestheticStyle: false,
13 | snippetViewPosition: "left",
14 | openSnippetFile: true,
15 | stylingTemplate: "",
16 | snippetEnabledStatus: false,
17 | };
18 |
--------------------------------------------------------------------------------
/src/settings/settingsTab.ts:
--------------------------------------------------------------------------------
1 | import type MySnippetsPlugin from "src/plugin/main";
2 | import { App, Setting, PluginSettingTab, TextAreaComponent } from "obsidian";
3 | import { setAttributes } from "src/util/setAttributes";
4 |
5 | export class MySnippetsSettingTab extends PluginSettingTab {
6 | plugin: MySnippetsPlugin;
7 | appendMethod: string;
8 |
9 | constructor(app: App, plugin: MySnippetsPlugin) {
10 | super(app, plugin);
11 | this.plugin = plugin;
12 | }
13 |
14 | display(): void {
15 | const { containerEl } = this;
16 | containerEl.empty();
17 | containerEl.createEl("h1", { text: "MySnippets" });
18 | containerEl.createEl("p", { text: "Created by " }).createEl("a", {
19 | text: "Chetachi 👩🏽💻",
20 | href: "https://github.com/chetachiezikeuzor",
21 | });
22 | containerEl.createEl("h2", { text: "Plugin Settings" });
23 | new Setting(containerEl)
24 | .setName("Glass menu effect")
25 | .setDesc(
26 | "Choose to change the background from the secondary background color of your theme to a glass background."
27 | )
28 | .addToggle((toggle) => {
29 | toggle
30 | .setValue(this.plugin.settings.aestheticStyle)
31 | .onChange(async (value) => {
32 | this.plugin.settings.aestheticStyle = value;
33 | this.plugin.saveSettings();
34 | });
35 | });
36 |
37 | new Setting(containerEl)
38 | .setName("Auto open new snippet")
39 | .setDesc(
40 | "Choose whether or not to open CSS snippet files immeditaley after creating them. It will open in your default app."
41 | )
42 | .addToggle((toggle) => {
43 | toggle
44 | .setValue(this.plugin.settings.openSnippetFile)
45 | .onChange(async (value) => {
46 | this.plugin.settings.openSnippetFile = value;
47 | this.plugin.saveSettings();
48 | });
49 | });
50 | new Setting(containerEl)
51 | .setName("Set new snippet status")
52 | .setDesc(
53 | "Choose whether or not to have newly created CSS snippet files toggled on automatically upon creation."
54 | )
55 | .addToggle((toggle) => {
56 | toggle
57 | .setValue(this.plugin.settings.snippetEnabledStatus)
58 | .onChange(async (value) => {
59 | this.plugin.settings.snippetEnabledStatus = value;
60 | this.plugin.saveSettings();
61 | });
62 | });
63 |
64 | const stylingTemplateSetting = new Setting(containerEl);
65 | stylingTemplateSetting.settingEl.setAttribute(
66 | "style",
67 | "display: grid; grid-template-columns: 1fr;"
68 | );
69 | stylingTemplateSetting
70 | .setName("CSS snippet template")
71 | .setDesc(
72 | "Set default CSS styling as a template for new CSS files you choose to create."
73 | );
74 |
75 | const stylingTemplateContent = new TextAreaComponent(
76 | stylingTemplateSetting.controlEl
77 | );
78 | setAttributes(stylingTemplateContent.inputEl, {
79 | style: "margin-top: 12px; width: 100%; height: 32vh;",
80 | class: "ms-css-editor",
81 | });
82 | stylingTemplateContent
83 |
84 | .setValue(this.plugin.settings.stylingTemplate)
85 | .onChange(async (value) => {
86 | this.plugin.settings.stylingTemplate = value;
87 | this.plugin.saveSettings();
88 | });
89 |
90 | const msDonationDiv = containerEl.createEl("div", {
91 | cls: "msDonationSection",
92 | });
93 |
94 | const donateText = createEl("p");
95 | donateText.appendText(
96 | "If you like this Plugin and are considering donating to support continued development, use the buttons below!"
97 | );
98 | msDonationDiv.appendChild(donateText);
99 | msDonationDiv.appendChild(
100 | paypalButton("https://paypal.me/chelseaezikeuzor")
101 | );
102 | msDonationDiv.appendChild(
103 | buyMeACoffeeButton("https://www.buymeacoffee.com/chetachi")
104 | );
105 | msDonationDiv.appendChild(kofiButton("https://ko-fi.com/chetachi"));
106 | }
107 | }
108 |
109 | const buyMeACoffeeButton = (link: string): HTMLElement => {
110 | const a = createEl("a");
111 | a.setAttribute("href", link);
112 | a.addClass("buymeacoffee-chetachi-img");
113 | a.innerHTML = ` `;
114 | return a;
115 | };
116 |
117 | const paypalButton = (link: string): HTMLElement => {
118 | const a = createEl("a");
119 | a.setAttribute("href", link);
120 | a.addClass("buymeacoffee-chetachi-img");
121 | a.innerHTML = ``;
129 | return a;
130 | };
131 |
132 | const kofiButton = (link: string): HTMLElement => {
133 | const a = createEl("a");
134 | a.setAttribute("href", link);
135 | a.addClass("buymeacoffee-chetachi-img");
136 | a.innerHTML = ``;
137 | return a;
138 | };
139 |
--------------------------------------------------------------------------------
/src/settings/type.ts:
--------------------------------------------------------------------------------
1 | import { App, Menu, MenuItem } from "obsidian";
2 |
3 | export type EnhancedMenu = Menu & {
4 | dom: HTMLElement;
5 | items: EnhancedMenuItem[];
6 | setUseNativeMenu: Function;
7 | };
8 |
9 | export type EnhancedMenuItem = MenuItem & {
10 | dom: HTMLElement;
11 | titleEl: HTMLDivElement;
12 | handleEvent(event: Event): void;
13 | disabled: boolean;
14 | };
15 |
16 | export type EnhancedApp = App & {
17 | customCss: {
18 | snippets: string[];
19 | getSnippetsFolder: Function;
20 | getSnippetPath: Function;
21 | enabledSnippets: Function & { has: Function };
22 | setCssEnabledStatus: Function;
23 | requestLoadSnippets: Function;
24 | };
25 | openWithDefaultApp: Function;
26 | };
27 |
--------------------------------------------------------------------------------
/src/ui/snippetsMenu.ts:
--------------------------------------------------------------------------------
1 | import type MySnippetsPlugin from "src/plugin/main";
2 | import { Menu, ToggleComponent, ButtonComponent, Notice } from "obsidian";
3 | import { setAttributes } from "src/util/setAttributes";
4 | import { MySnippetsSettings } from "src/settings/settingsData";
5 | import CreateSnippetModal from "src/modal/createSnippetModal";
6 | import { EnhancedApp, EnhancedMenu, EnhancedMenuItem } from "src/settings/type";
7 |
8 | export default function snippetsMenu(
9 | app: EnhancedApp,
10 | plugin: MySnippetsPlugin,
11 | settings: MySnippetsSettings
12 | ) {
13 | const windowX = window.innerWidth;
14 | const windowY = window.innerHeight;
15 | const menuExists = document.querySelector(".menu.MySnippets-statusbar-menu");
16 |
17 | if (!menuExists) {
18 | const menu = new Menu() as unknown as EnhancedMenu;
19 |
20 | // menu.setUseNativeMenu(false);
21 |
22 | const menuDom = (menu as any).dom as HTMLElement;
23 | menuDom.addClass("MySnippets-statusbar-menu");
24 |
25 | if (settings.aestheticStyle) {
26 | menuDom.setAttribute(
27 | "style",
28 | "background-color: transparent; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);"
29 | );
30 | }
31 | const customCss = app.customCss;
32 | const currentSnippets = customCss.snippets;
33 | const snippetsFolder = customCss.getSnippetsFolder();
34 |
35 | currentSnippets.forEach((snippet: string) => {
36 | const snippetPath = customCss.getSnippetPath(snippet);
37 |
38 | menu.addItem((snippetElement) => {
39 | snippetElement.setTitle(snippet);
40 |
41 | const snippetElementDom = (snippetElement as any).dom as HTMLElement;
42 | const toggleComponent = new ToggleComponent(snippetElementDom);
43 | const buttonComponent = new ButtonComponent(snippetElementDom);
44 |
45 | function changeSnippetStatus() {
46 | const isEnabled = customCss.enabledSnippets.has(snippet);
47 | customCss.setCssEnabledStatus(snippet, !isEnabled);
48 | }
49 |
50 | toggleComponent
51 | .setValue(customCss.enabledSnippets.has(snippet))
52 | .onChange(changeSnippetStatus);
53 |
54 | buttonComponent
55 | .setIcon("ms-snippet")
56 | .setClass("MS-OpenSnippet")
57 | .setTooltip(`Open snippet`)
58 |
59 | .onClick((e: any) => {
60 | app.openWithDefaultApp(snippetPath);
61 | });
62 |
63 | snippetElement.onClick((e: any) => {
64 | e.preventDefault();
65 | e.stopImmediatePropagation();
66 | });
67 | });
68 | });
69 |
70 | menu.addSeparator();
71 |
72 | menu.addItem((actions: EnhancedMenuItem) => {
73 | actions.setIcon(null);
74 | actions.setTitle("Actions");
75 | const actionsDom = (actions as any).dom as HTMLElement;
76 | setAttributes(actions.titleEl, { style: "font-weight: 700" });
77 |
78 | const reloadButton = new ButtonComponent(actionsDom);
79 | const folderButton = new ButtonComponent(actionsDom);
80 | const addButton = new ButtonComponent(actionsDom);
81 |
82 | setAttributes(reloadButton.buttonEl, { style: "margin-right: 3px" });
83 | setAttributes(addButton.buttonEl, { style: "margin-left: 3px" });
84 |
85 | reloadButton
86 | .setIcon("ms-reload")
87 | .setClass("MySnippetsButton")
88 | .setClass("MS-Reload")
89 | .setTooltip("Reload snippets")
90 | .onClick((e: any) => {
91 | customCss.requestLoadSnippets();
92 | new Notice("Snippets reloaded");
93 | });
94 | folderButton
95 | .setIcon("ms-folder")
96 | .setClass("MySnippetsButton")
97 | .setClass("MS-Folder")
98 | .setTooltip("Open snippets folder")
99 | .onClick((e: any) => {
100 | app.openWithDefaultApp(snippetsFolder);
101 | });
102 | addButton
103 | .setIcon("ms-add")
104 | .setClass("MySnippetsButton")
105 | .setClass("MS-Folder")
106 | .setTooltip("Create new snippet")
107 | .onClick((e: any) => {
108 | new CreateSnippetModal(app, plugin).open();
109 | });
110 | });
111 |
112 | menu.showAtPosition({
113 | x: windowX - 15,
114 | y: windowY - 37,
115 | });
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/util/setAttributes.ts:
--------------------------------------------------------------------------------
1 | export function setAttributes(element: any, attributes: any) {
2 | for (let key in attributes) {
3 | element.setAttribute(key, attributes[key]);
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/src/util/wait.ts:
--------------------------------------------------------------------------------
1 | export async function wait(delay: number) {
2 | return new Promise((resolve) => setTimeout(resolve, delay));
3 | }
4 |
--------------------------------------------------------------------------------
/styles.css:
--------------------------------------------------------------------------------
1 | .ms-css-editor {
2 | width: 100%;
3 | height: 36vh;
4 | margin-top: 12px;
5 | text-align: left;
6 | white-space: pre;
7 | word-wrap: normal;
8 | overflow-x: scroll;
9 | padding: 6px 10px;
10 | font-size: 0.875em;
11 | border-radius: 6px;
12 | white-space: pre-wrap;
13 | color: var(--text-muted);
14 | font-family: var(--font-monospace);
15 | background-color: var(--background-primary);
16 | border: 1px solid var(--background-modifier-border);
17 | }
18 |
19 | /*----------------------------------------------------------------
20 | STATUS BAR MENU
21 | ----------------------------------------------------------------*/
22 |
23 | .MiniSettings-statusbar-button {
24 | cursor: pointer;
25 | display: flex;
26 | align-items: center;
27 | line-height: 1;
28 | }
29 |
30 | .MySnippets-statusbar-menu {
31 | width: 290px;
32 | max-height: calc(100% - 90px);
33 | }
34 |
35 | .MySnippets-statusbar-menu .menu-item-icon {
36 | display: none;
37 | }
38 |
39 | .MySnippets-statusbar-menu .menu-item {
40 | display: flex;
41 | align-items: center;
42 | justify-content: space-between;
43 | flex-direction: row;
44 | }
45 |
46 | .MySnippets-statusbar-menu .menu-item.settings-item {
47 | font-size: 12px;
48 | text-align: center;
49 | line-height: 1;
50 | border-radius: 5px;
51 | height: auto;
52 | padding: 8px 5px 0px 5px;
53 | margin: 0 auto;
54 | width: fit-content;
55 | color: var(--text-faint);
56 | }
57 |
58 | .MySnippets-statusbar-menu.menu-item:hover,
59 | .MySnippets-statusbar-menu.menu-item .selected:hover,
60 | .MySnippets-statusbar-menu
61 | .menu-item.selected:not(.is-disabled):not(.is-label) {
62 | background-color: transparent;
63 | }
64 |
65 | .MySnippets-statusbar-menu .menu-item-title {
66 | margin-right: 10px;
67 | width: 60%;
68 | line-height: initial;
69 | overflow-x: hidden;
70 | text-overflow: ellipsis;
71 | }
72 |
73 | .MS-OpenSnippet {
74 | padding: 3px 10px;
75 | border-radius: 6px;
76 | margin-right: 0;
77 | margin-left: 8px;
78 | display: flex;
79 | background-color: var(--interactive-accent);
80 | }
81 |
82 | .MS-OpenSnippet svg {
83 | height: 1.35em;
84 | width: 1.35em;
85 | }
86 |
87 | .MS-OpenSnippet:hover {
88 | background-color: var(--interactive-accent);
89 | }
90 |
91 | .MySnippetsButton {
92 | width: auto;
93 | padding: 5px 14px;
94 | margin-right: 0;
95 | margin-top: 4px;
96 | border-radius: 6px;
97 | display: flex;
98 | font-size: 12px !important;
99 | }
100 |
101 | .MySnippetsButton svg {
102 | height: 1.35em;
103 | margin: auto;
104 | width: 1.35em;
105 | }
106 |
107 | .MySnippetsButton.MS-Reload,
108 | .MySnippetsButton.MS-Reload:hover,
109 | .MySnippetsButton.MS-Folder,
110 | .MySnippetsButton.MS-Folder:hover {
111 | background-color: var(--interactive-accent);
112 | }
113 |
114 | .MySnippets-statusbar-menu .menu-item.buttonitem {
115 | justify-self: space-between;
116 | }
117 |
118 | .menu.MySnippets-statusbar-menu {
119 | overflow: auto;
120 | }
121 |
122 | /*----------------------------------------------------------------
123 | MYSNIPPETS SUPPORT
124 | ----------------------------------------------------------------*/
125 |
126 | .msDonationSection {
127 | width: 65%;
128 | height: 50vh;
129 | margin: 0 auto;
130 | text-align: center;
131 | color: var(--text-normal);
132 | }
133 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "inlineSourceMap": true,
5 | "inlineSources": true,
6 | "allowSyntheticDefaultImports": true,
7 | "module": "ESNext",
8 | "target": "es6",
9 | "allowJs": true,
10 | "noImplicitAny": true,
11 | "moduleResolution": "node",
12 | "importHelpers": true,
13 | "lib": ["dom", "es5", "scripthost", "es2015"]
14 | },
15 | "include": ["**/*.ts"]
16 | }
17 |
--------------------------------------------------------------------------------
/versions.json:
--------------------------------------------------------------------------------
1 | {
2 | "1.0.0": "0.9.12",
3 | "1.1.2": "0.9.12",
4 | "1.2.0": "0.15.3"
5 | }
6 |
--------------------------------------------------------------------------------