vault backup: 2023-06-30 15:32:06
This commit is contained in:
parent
32f2e2e6f6
commit
49ad72a82c
1
.obsidian/community-plugins.json
vendored
1
.obsidian/community-plugins.json
vendored
@ -31,7 +31,6 @@
|
||||
"workspaces-plus",
|
||||
"Enhanced-editing",
|
||||
"obsidian42-brat",
|
||||
"obsidian-editing-toolbar",
|
||||
"remotely-save",
|
||||
"table-editor-obsidian",
|
||||
"dataview",
|
||||
|
46
.obsidian/plugins/obsidian-bartender/data.json
vendored
46
.obsidian/plugins/obsidian-bartender/data.json
vendored
@ -1,46 +0,0 @@
|
||||
{
|
||||
"statusBarOrder": [
|
||||
"44751841237401602368623156",
|
||||
"12843970849669122596921091",
|
||||
"86515888475340801543377291",
|
||||
"21212843474944064247010",
|
||||
"59523608157880323101081134",
|
||||
"4185832177008644156991330",
|
||||
"35658965975040004261697505",
|
||||
"86589804862504962434026302",
|
||||
"6265085974544384162810726"
|
||||
],
|
||||
"ribbonBarOrder": [
|
||||
"79372327069941761204210982",
|
||||
"798508723260620822378052",
|
||||
"10343183191900161451753391",
|
||||
"88573907954565123003701357",
|
||||
"62657388095733763115464037",
|
||||
"60992143375728644142598242",
|
||||
"70995981201571844078151274",
|
||||
"76874417040261121352673776",
|
||||
"20512377258639363877619960",
|
||||
"6844575847022592185085343",
|
||||
"4384744997388288661022522",
|
||||
"4370133518647296621305815"
|
||||
],
|
||||
"fileExplorerOrder": {},
|
||||
"actionBarOrder": {
|
||||
"markdown-table-editor-view": [
|
||||
"3424304410656768167261794",
|
||||
"19187852294225921578290960",
|
||||
"30107033550192642960974060",
|
||||
"73781782889103362323969276"
|
||||
],
|
||||
"markdown": [
|
||||
"6146527697305603961893867",
|
||||
"3424304410656768167261794",
|
||||
"19187852294225921578290960",
|
||||
"30107033550192642960974060",
|
||||
"73781782889103362323969276"
|
||||
]
|
||||
},
|
||||
"autoHide": false,
|
||||
"autoHideDelay": 500,
|
||||
"dragDelay": 200
|
||||
}
|
13
.obsidian/plugins/obsidian-bartender/main.js
vendored
13
.obsidian/plugins/obsidian-bartender/main.js
vendored
File diff suppressed because one or more lines are too long
@ -1 +0,0 @@
|
||||
{"id":"obsidian-bartender","name":"Bartender","version":"0.5.2","minAppVersion":"0.12.5","description":"Allows for rearranging the elements in the status bar and sidebar ribbon","author":"NothingIsLost","authorUrl":"https://github.com/nothingislost","isDesktopOnly":false}
|
140
.obsidian/plugins/obsidian-bartender/styles.css
vendored
140
.obsidian/plugins/obsidian-bartender/styles.css
vendored
@ -1,140 +0,0 @@
|
||||
:root {
|
||||
--left-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M58.079 20.579L28.663 50l29.417 29.421l8.842 -8.842L46.338 50l20.583 -20.579z"></path></svg>');
|
||||
--right-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M41.921 79.421L71.338 50l-29.417 -29.421l-8.842 8.842L53.663 50l-20.583 20.579z"></path></svg>');
|
||||
--up-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M26.221 55.388l5.892 5.892L50 43.392l17.888 17.888l5.892 -5.892L50 31.608z"></path></svg>');
|
||||
--down-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M67.888 38.721L50 56.608L32.113 38.721l-5.892 5.892L50 68.392l23.779 -23.779z"></path></svg>');
|
||||
}
|
||||
|
||||
.side-dock-actions .sortable-ghost,
|
||||
.status-bar .sortable-ghost,
|
||||
.view-actions .sortable-ghost,
|
||||
.workspace-tab-header-container .sortable-ghost {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator {
|
||||
cursor: grab;
|
||||
padding: 0px 4px;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
justify-content: center;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
div.separator svg {
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator .glyph {
|
||||
/* margin-top: -4px; */
|
||||
display: flex;
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator:hover {
|
||||
/* some themes highlight the hovered icon and it looks bad on the separator */
|
||||
background: none;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator svg {
|
||||
-webkit-mask-image: var(--up-indicator);
|
||||
}
|
||||
.side-dock-ribbon div.separator.is-collapsed.sortable-chosen svg {
|
||||
/* so that the icon updates to show the expand icon on drag start */
|
||||
-webkit-mask-image: var(--up-indicator);
|
||||
}
|
||||
.side-dock-ribbon div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--down-indicator);
|
||||
}
|
||||
|
||||
/* for minimal floating ribbon support */
|
||||
|
||||
.hider-ribbon .side-dock-ribbon div.separator {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.hider-ribbon .side-dock-ribbon div.separator .glyph {
|
||||
display: flex;
|
||||
align-self: flex-end;
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator svg {
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator.is-collapsed.sortable-chosen svg {
|
||||
/* so that the icon updates to show the expand icon on drag start */
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--right-indicator);
|
||||
}
|
||||
|
||||
.view-actions div.separator.is-collapsed {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
.status-bar .is-hidden,
|
||||
.side-dock-ribbon .is-hidden,
|
||||
.view-actions .is-hidden {
|
||||
/* if you're mad about this !important
|
||||
set the --is-hidden-display variable to override it */
|
||||
--is-hidden-display: none;
|
||||
display: var(--is-hidden-display) !important;
|
||||
}
|
||||
|
||||
.status-bar div.separator {
|
||||
--cursor: grab; /* to deal with minimal theme */
|
||||
cursor: grab;
|
||||
padding: 0px 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* line-height: 1; */
|
||||
}
|
||||
|
||||
.status-bar div.separator .glyph {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.status-bar div.separator svg,
|
||||
.status-bar div.separator.is-collapsed.sortable-chosen svg {
|
||||
-webkit-mask-image: var(--right-indicator);
|
||||
}
|
||||
|
||||
.status-bar div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.side-dock-ribbon-action.sortable-chosen,
|
||||
.side-dock-ribbon div.separator.sortable-chosen,
|
||||
.status-bar div.separator.sortable-chosen {
|
||||
--cursor: grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
body.is-dragging .tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-header,
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-container-before,
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-container-after {
|
||||
background: none;
|
||||
}
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-header-inner-icon:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="file-explorer"] .nav-header .search-input-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="file-explorer"] .nav-header .search-input-container.is-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.nav-action-button[data-sort-method] + div.nav-action-button.drag-to-rearrange {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.nav-action-button[data-sort-method="custom"] + div.nav-action-button.drag-to-rearrange {
|
||||
display: block;
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
github: cumany
|
||||
custom:
|
||||
[
|
||||
"https://www.buymeacoffee.com/cuman",
|
||||
"https://user-images.githubusercontent.com/42957010/172568261-8a732d3d-303a-4367-993e-23c3efbf62a8.png",
|
||||
]
|
@ -1,38 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
@ -1,22 +0,0 @@
|
||||
# Intellij
|
||||
*.iml
|
||||
.idea
|
||||
|
||||
# npm
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
# build
|
||||
main.js
|
||||
.DS_Store
|
||||
*.js.map
|
||||
.env
|
||||
|
||||
# obsidian
|
||||
data.json
|
||||
|
||||
#history
|
||||
.history
|
||||
|
||||
#DS Store
|
||||
.DS_Store
|
373
.obsidian/plugins/obsidian-editing-toolbar/LICENSE
vendored
373
.obsidian/plugins/obsidian-editing-toolbar/LICENSE
vendored
@ -1,373 +0,0 @@
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
@ -1,105 +0,0 @@
|
||||
# obsidian-editing-toolbar 插件
|
||||
|
||||
感谢 [cmenu](https://github.com/chetachiezikeuzor/cMenu-Plugin)插件的开发,给我了很多灵感,但这个插件已经一年多没有维护了,于是我重新魔改了它,并增加了很多有趣的功能,包括置顶工具栏,光标跟随等,于是 Cmenu toolbar 就诞生了。
|
||||
**Obsidian Editing Toolbar**是一个提供类似于 MS-Word 的工具栏的插件,并增加了一个最小的和用户友好的文本编辑器模式,以获得更顺畅的写作/编辑体验。不需要记住复杂的 markdown 命令,类似于富文本编辑器的所见即所得。
|
||||
这个插件是专门为那些希望有一个简单的文本编辑器来帮助标记他们的笔记设计的。它解决了必须记住许多热键或命令来实现所需要的功能的问题。一个简单的工具条可以改善你在 Obsidian 中的写作体验。
|
||||
|
||||
> 建议配合[增强编辑插件](https://github.com/obsidian-canzi/Enhanced-editing),可以添加更多的实用的编辑指令。
|
||||
|
||||

|
||||
|
||||
## 目录导航
|
||||
|
||||
- [如何安装](#如何安装)
|
||||
- [视频介绍](#视频介绍)
|
||||
- [功能特性](#功能特性)
|
||||
- [跟其他插件协作](#跟其他插件协作)
|
||||
- [完整示例库分享](#完整示例库分享)
|
||||
|
||||
## 如何安装
|
||||
|
||||
1. brat 安装。插件目前还没有上架官方商店可以通过 [BRAT Plugin](https://obsidian.md/plugins?id=obsidian42-brat)去安装。
|
||||
`cumany/obsidian-editing-toolbar`
|
||||
2. 手动安装 参考教程
|
||||
[Plugins mini FAQ ](https://forum.obsidian.md/t/plugins-mini-faq/7737)
|
||||
[如何安装 obsdiain 插件](https://publish.obsidian.md/chinesehelp/01+2021%E6%96%B0%E6%95%99%E7%A8%8B/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85obsdiain%E6%8F%92%E4%BB%B6)
|
||||
|
||||
## 视频介绍
|
||||
|
||||
[谁说 Obsidian 不如语雀,这个插件让你使用 ob 不用再记那么多指令了,ob 工具栏你值得拥有](https://www.bilibili.com/video/BV1mY4y1T7g2/)
|
||||
|
||||
## 功能特性
|
||||
|
||||
功能在延续之前 cmenu 功能的基础上增加了下面额外的功能。
|
||||
|
||||
1. 增加新的工具栏样式 tiny
|
||||
|
||||

|
||||
2. 增加工具栏位置选项,top,following
|
||||
|
||||

|
||||

|
||||
|
||||
3. 增加一些内置命令
|
||||
1. change-font-color
|
||||
字体颜色调色板和格式刷
|
||||
2. change-background-color
|
||||
背景颜色调色板和格式刷
|
||||
3. indent-list
|
||||
列表缩进
|
||||
4. undent-list
|
||||
列表反缩进
|
||||
5. editor-undo
|
||||
6. editor-redo
|
||||
7. hrline
|
||||
会插入一个`---`分割线
|
||||
8. justify 两端对齐
|
||||
插入一个 html 代码,让文字两端对齐`<p align="justify">.....</p>`
|
||||
9. left
|
||||
插入一个 html 代码,让文字左对齐`<p align="left">.....</p>`
|
||||
10. right
|
||||
插入一个 html 代码,让文字右对齐`<p align="right">.....</p>`
|
||||
11. center 居中对齐
|
||||
插入一个 html 代码,让文字居中`<center>.....</center>`
|
||||
12. fullscreen-focus
|
||||
默认绑定快捷键`Ctrl+shift+F11`。
|
||||
将使笔记页面全屏显示,让你更专注于写作本身。要退出全屏,请按 ESC 或再次执行全屏命令。
|
||||
13. workplace-fullscreen-focus
|
||||
默认绑定快捷键`Ctrl+F11`。
|
||||
与全屏聚焦模式不同,这个模式只是隐藏了左右侧边栏的面板,它只是工作区全屏。
|
||||
14. head 1-6 级标题设置
|
||||
默认绑定快捷键`Ctrl+1,ctrl+2,...Ctrl+6`。
|
||||
|
||||

|
||||
15. 支持自定义命令图标
|
||||
|
||||

|
||||
16. 支持修改命令名称
|
||||
|
||||

|
||||
17. 支持添加子菜单
|
||||
|
||||

|
||||
18. 支持菜单拖动排序
|
||||
19. 增加格式刷功能 内置字体颜色和背景颜色两种格式刷(鼠标中键或者右键可取消格式刷状态)
|
||||
|
||||

|
||||
20. 工具栏图标宽度自适应收缩
|
||||
|
||||

|
||||
|
||||
### 跟其他插件协作
|
||||
|
||||
1. [emjoi toolbar ](obsidian://show-plugin?id=obsidian-emoji-toolbar)快捷插入表情
|
||||

|
||||
|
||||
|
||||
2. [Obsidian-Table-Generator](https://github.com/Quorafind/Obsidian-Table-Generator/) & [ob-table-enhance](https://github.com/Stardusten/ob-table-enhancer) 快捷插入表格并编辑
|
||||

|
||||
|
||||
> 上面插件均可从示例库获取,示例库的插件一般都经过了优化并修复了一些错误
|
||||
☟☟☟
|
||||
### 完整示例库分享
|
||||
|
||||
这是可以让你大开眼界的 Obsidian 示例库,里面有很多眼花缭乱的功能和示例,相信你看过一定会惊叹,这是 Obsidian 吗?
|
||||
[Blue-topaz-examples](https://github.com/cumany/Blue-topaz-examples)
|
@ -1,99 +0,0 @@
|
||||
# obsidian-editing-toolbar Plugin
|
||||
|
||||

|
||||
|
||||
Thanks to the [cmenu](https://github.com/chetachiezikeuzor/cMenu-Plugin) plugin, which gave me a lot of inspiration, but this plugin has not been maintained for more than a year, so I re-modified it and added a lot of interesting features, including the top toolbar, cursor following, etc., so editing toolbar was created.
|
||||
|
||||
**Obsidian Editing Toolbar** is a plugin that provides a toolbar similar to MS-Word,and adds a minimal and user friendly text editor modal for a smoother writing/editing experience . This plugin makes text editing and firing commands easier for those that don't wish to configure a multitude of hotkeys.No need to remember complex markdown commands, similar to a rich text editor as WYSIWYG.
|
||||
This plugin was specifically designed for note-takers that want to have a simple text editor to aid in marking up their notes. It solves the issue of having to memorize numerous hotkeys and/or use multiple key presses to get the desired markup. A simple toolbar to improve your writing experience in Obsidian!
|
||||
|
||||
> It is recommended to work with [Enhanced Editing Plugin](https://github.com/obsidian-canzi/Enhanced-editing), which can add more useful editing commands.
|
||||
|
||||
_[点击这里](./README-zh_cn.md)查看中文文档。_
|
||||
|
||||
## TOC
|
||||
|
||||
- [obsidian-editing-toolbar Plugin](#obsidian-editing-toolbar-plugin)
|
||||
- [TOC](#toc)
|
||||
- [how-to-install](#how-to-install)
|
||||
- [Video Introduction](#video-introduction)
|
||||
- [Key Features](#key-features)
|
||||
- [Work with other plugins](#work-with-other-plugins)
|
||||
- [Full Vault showcase](#full-vault-showcase)
|
||||
|
||||
## how-to-install
|
||||
|
||||
Please Refer: [How to install Obsidian Plugins](https://forum.obsidian.md/t/plugins-mini-faq/7737)
|
||||
|
||||
## Video Introduction
|
||||
|
||||
[About Cmenu toolbar](https://www.bilibili.com/video/BV1mY4y1T7g2/)
|
||||
|
||||
## Key Features
|
||||
|
||||
1. add a new toolbar style tiny
|
||||
|
||||

|
||||
|
||||
2. add toolbar position options, top, following
|
||||
|
||||

|
||||

|
||||
|
||||
3. add some built-in commands
|
||||
1. change-font-color
|
||||
2. change-background-color
|
||||
3. indent-list
|
||||
4. undent-list
|
||||
5. editor-undo
|
||||
6. editor-redo
|
||||
7. hrline
|
||||
will insert a `---` split line
|
||||
8. justify Both ends aligned
|
||||
Inserts an html code to align the text at both ends `<p align="justify">..... </p>`
|
||||
9. left
|
||||
Insert an html code to align the text left `<p align="left">..... </p>`
|
||||
10. right
|
||||
Insert an html code to align the text right `<p align="right">..... </p>`
|
||||
11. center
|
||||
Insert an html code to center the text `<center>..... </center>`
|
||||
12. fullscreen-focus
|
||||
Default binding shortcut key `Ctrl+shift+F11`
|
||||
Will make the notes page display full screen, let you focus more on the writing itself. To exit full screen press ESC or execute the full screen command again
|
||||
13. workplace-fullscreen-focus
|
||||
Default binding shortcut key `Ctrl+F11`
|
||||
Unlike fullscreen-focus mode, this one just hides the left and right sidebar panels, it's only workspace full screen
|
||||
14. head 1-6 level heading settings
|
||||
Default binding shortcut key `Ctrl+1,ctrl+2,...Ctrl+6`
|
||||

|
||||
15. support custom command icons
|
||||

|
||||
16. Support modify command name
|
||||

|
||||
17. Support for adding submenus
|
||||

|
||||
18. Support menu dragging and sorting
|
||||
19. Add formatting brush function Built-in two kinds of formatting brush for font color and background color (middle mouse button or right click can cancel the formatting brush status)
|
||||

|
||||
20. Adaptive shrinkage of toolbar icon width
|
||||

|
||||
|
||||
|
||||
|
||||
### Work with other plugins
|
||||
|
||||
1. [emjoi toolbar ](obsidian://show-plugin?id=obsidian-emoji-toolbar) Quickly Insert a emoji
|
||||

|
||||
|
||||
|
||||
2. [Obsidian-Table-Generator](https://github.com/Quorafind/Obsidian-Table-Generator/) & [ob-table-enhance](https://github.com/Stardusten/ob-table-enhancer) Quickly Insert a table and edit
|
||||

|
||||
|
||||
> The above plugins are available from the example vault , all of which have been optimized and have some bugs fixed
|
||||
☟☟☟
|
||||
|
||||
|
||||
### Full Vault showcase
|
||||
|
||||
This is the Obsidian example vault is amazing, there are a lot of dazzling features and showcase, I believe you will wonder a bit, is this Obsidian?
|
||||
[Blue-topaz-examples](https://github.com/cumany/Blue-topaz-examples)
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "obsidian-editing-toolbar",
|
||||
"name": "Obsidian Editing Toolbar",
|
||||
"version": "2.1.0",
|
||||
"minAppVersion": "0.9.12",
|
||||
"description": "The Obsidian Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.",
|
||||
"author": "Cuman",
|
||||
"authorUrl": "https://github.com/cumany/obsidian-editing-toolbar",
|
||||
"isDesktopOnly": true
|
||||
}
|
@ -1,846 +0,0 @@
|
||||
|
||||
|
||||
#cMenuToolbarModalBar {
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 3px;
|
||||
display: grid;
|
||||
user-select: none;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
transition: 200ms ease;
|
||||
-webkit-transition: 200ms ease;
|
||||
min-width: fit-content;
|
||||
justify-content: space-around;
|
||||
z-index: var(--layer-status-bar);
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex {
|
||||
display: flex;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]) {
|
||||
min-width: 20px;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: 2px;
|
||||
border: none;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
padding: 5px 6px;
|
||||
box-shadow: none;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
font-size: initial !important;
|
||||
background-color: var(--background-primary-alt);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
/* #cMenuToolbarModalBar button.cMenuToolbarCommandItem svg {
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
} */
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTINGS BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd {
|
||||
background-color: var(--interactive-accent);
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete {
|
||||
background-color: #989cab;
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh {
|
||||
background-color: var(--text-accent);
|
||||
}
|
||||
|
||||
button.cMenuToolbarSettingsButton {
|
||||
padding: 4px 14px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTING ITEMS
|
||||
----------------------------------------------------------------*/
|
||||
.setting-item.cMenuToolbarCommandItem:first-child {
|
||||
padding-top: 18px;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandItem {
|
||||
cursor: grab;
|
||||
padding: 18px 0 18px 0;
|
||||
}
|
||||
|
||||
.sortable-fallback {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.sortable-grab {
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.sortable-chosen {
|
||||
cursor: grabbing;
|
||||
padding: 18px 0 18px 18px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.sortable-drag {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer {
|
||||
border-top: 1px solid var(--background-modifier-border);
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar CLASS CHANGES
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic
|
||||
{
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem])
|
||||
{
|
||||
min-height:28px ;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 6px;
|
||||
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
.cMenuToolbarDefaultAesthetic {
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ,#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ~#cMenuToolbarPopoverBar {
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
box-shadow:none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar ICONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbarIconPick {
|
||||
line-height: normal;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.cMenuToolbarIconPick svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR MENU
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-menu {
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
border-radius: 5px;
|
||||
height: auto;
|
||||
padding: 8px 5px 0px 5px;
|
||||
margin: 0 auto;
|
||||
width: fit-content;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item .menu-item-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item .selected:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item.selected:not(.is-disabled):not(.is-label) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 4px;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem button.cMenuToolbarSettingsButton {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg path {
|
||||
fill: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg {
|
||||
stroke: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu > .menu-item {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) .menu-item-icon{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-button {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-button svg {
|
||||
display: flex;
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SUPPORT
|
||||
---------------------------------------------`-------------------*/
|
||||
|
||||
.cDonationSection {
|
||||
width: 60%;
|
||||
height: 50vh;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar{
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic .cMenuToolbarCommandItem{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic [class^=cMenuToolbarCommandsubItem]{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem{
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* #cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem svg{
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
} */
|
||||
|
||||
|
||||
|
||||
div.modal-container.cMenuToolbar-Modal:not(.changename) .modal-bg
|
||||
{
|
||||
background-color:transparent!important;
|
||||
backdrop-filter: none!important;
|
||||
position: relative;
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal:not(.changename) .modal {
|
||||
padding: 10px 30px;
|
||||
min-width: 130px;
|
||||
position: absolute;
|
||||
bottom: 2em;
|
||||
right: 0.5em;
|
||||
background-color: rgb(var(--background-primary-rgb),0.5);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal .modal-title
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
width: 90%;
|
||||
|
||||
}
|
||||
body.theme-dark .modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
/*tiny 样式*/
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic {
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
background-color: var(--background-secondary);
|
||||
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
|
||||
margin-left: 4px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar).cMenuToolbarTinyAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
|
||||
}
|
||||
button[class^=cMenuToolbarCommandsubItem]::after {
|
||||
|
||||
content: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
margin-left: 1px;
|
||||
margin-top:6px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
|
||||
position: absolute;
|
||||
z-index: var(--layer-menu);
|
||||
user-select: none;
|
||||
transform: translateY(90%) translateX(-40%);
|
||||
-webkit-transform: translateY(90%) translateX(-40%);
|
||||
display: flex;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem svg
|
||||
{
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button.menu-item
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
line-height:2em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button:hover
|
||||
{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem .menu-item {
|
||||
|
||||
margin-right: 4px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem {
|
||||
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
position: absolute;
|
||||
margin-left: 18px;
|
||||
bottom: 8%;
|
||||
background-size: 4px 4px;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
background-position: center;
|
||||
|
||||
background-repeat: no-repeat;
|
||||
min-width: unset;
|
||||
border-left: 2px solid transparent;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
margin-left: 16px;
|
||||
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .x-color-picker-wrapper
|
||||
{
|
||||
top:auto;
|
||||
bottom:calc(100% + 1em);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem
|
||||
{
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem]:hover >.subitem {
|
||||
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandsubItem-font-color button
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
.cMenuToolbarCommandsubItem-font-color button:hover
|
||||
{
|
||||
background-color: var(--interactive-normal);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandItem .setting-item-info {
|
||||
|
||||
flex:30%;
|
||||
margin: 0;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub
|
||||
{
|
||||
border-left: 1px solid var(--background-modifier-border);
|
||||
flex-flow: column;
|
||||
min-height: 45px;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin-left: 10px;
|
||||
flex: 70%;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty
|
||||
{
|
||||
border: 2px dashed rgba(var(--interactive-accent-rgb),0.5);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty::before {
|
||||
content: "✖️Drag it here";
|
||||
margin: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .cMenuToolbarCommandItem
|
||||
{
|
||||
flex: auto;
|
||||
margin-left: 2em;;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .setting-item-control
|
||||
{
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandSubItem>.setting-item-info
|
||||
{
|
||||
flex: 70px;
|
||||
}
|
||||
.cMenuToolbarCommandSubItem>.setting-item-control
|
||||
{
|
||||
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonaddsub {
|
||||
background-color: var(--background-secondary-alt);
|
||||
}
|
||||
|
||||
|
||||
.setting-item button.cMenuToolbarSettingsIcon{
|
||||
display: block;
|
||||
transform: translateX(-30%);
|
||||
-webkit-transform: translateX(-30%);
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon:empty::before{
|
||||
content: "❗";
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon svg{
|
||||
max-width: 1.5em;
|
||||
max-height: 1.5em;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon:hover{
|
||||
background-color: var(--interactive-accent-hover);
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon
|
||||
{
|
||||
background-color: transparent;
|
||||
box-shadow: 0 1px 1px 0px var(--background-modifier-border);
|
||||
}
|
||||
@media screen and (min-width: 781px){
|
||||
.cMenuToolbar-Modal .wideInputPromptInputEl {
|
||||
width: 40rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
background-color: rgb(var(--background-primary-rgb),0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.cMenuToolbarcustomIcon svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbarSettingsButton svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.cmdr-page-header
|
||||
{
|
||||
min-width: 1em;;
|
||||
}
|
||||
|
||||
|
||||
.x-color-picker-wrapper {
|
||||
right: 0px;
|
||||
top:1.8em;
|
||||
min-width: 1px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14);
|
||||
position: absolute;
|
||||
width: fit-content;
|
||||
font-weight: 400;
|
||||
font-family: Source Sans Pro,sans-serif;
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
.markdown-source-view.mod-cm6 .x-color-picker-wrapper table.x-color-picker-table#x-color-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper table.x-color-picker-table#x-backgroundcolor-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table th {
|
||||
border: 0;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
background: transparent !important;
|
||||
color: #718096;
|
||||
}
|
||||
.x-color-picker-wrapper #x-color-picker-table td {
|
||||
font-size: 1px;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper #x-backgroundcolor-picker-table td {
|
||||
font-size: 1px;
|
||||
border-radius: 50%;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table tr td:hover {
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
}
|
||||
.x-color-picker-wrapper tbody>tr:hover
|
||||
{
|
||||
background-color:transparent !important;
|
||||
}
|
||||
/**top**/
|
||||
#cMenuToolbarModalBar.top {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
height: 38px;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.top :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):not(.cMenuToolbar-Divider-Line)
|
||||
{
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar.top button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#cMenuToolbarPopoverBar{
|
||||
|
||||
padding: 0 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
z-index: var(--layer-status-bar);
|
||||
background-color: var(--background-secondary);
|
||||
background-clip: padding-box;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
box-shadow: 0 0 8px rgba(0,0,0,.15)\9;
|
||||
margin-left: auto;
|
||||
margin-right: 25px;
|
||||
transition: all 0.1s linear;
|
||||
-webkit-transition: all 0.1s linear;
|
||||
margin-top: 32px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]){
|
||||
|
||||
height: 26px;
|
||||
margin-left: 4px;
|
||||
font-size: 10px;
|
||||
margin-right: 4px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):hover{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar .more-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow:none;
|
||||
margin-left: 4px;
|
||||
border-left: 1px inset var( --background-modifier-form-field);
|
||||
height: 24px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
/*Divider-Line**/
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line
|
||||
{
|
||||
padding: 0;
|
||||
|
||||
line-height: 0px;
|
||||
border-left: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
border-right: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
text-align: center;
|
||||
background: rgba(var(--interactive-accent-rgb),0.2);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:not(:last-child)
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info
|
||||
{
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control
|
||||
{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info .setting-item-name
|
||||
{
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child
|
||||
{
|
||||
padding: 0;
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child svg
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child::before
|
||||
{
|
||||
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M511.674077 66.707284c-246.52265 0-446.347744 199.835328-446.347744 446.347744s199.825095 446.356954 446.347744 446.356954c246.50423 0 446.348768-199.844537 446.348768-446.356954S758.177284 66.707284 511.674077 66.707284zM744.967424 667.159826c21.8701 21.8701 21.8701 57.310264 0 79.199807-21.8701 21.851681-57.30924 21.851681-79.198783-0.019443L511.674077 592.264045 357.56007 746.359632c-21.8701 21.8701-57.30924 21.851681-79.17934-0.019443s-21.8701-57.290821 0-79.160921L432.493713 513.065262 278.379707 358.950232c-21.8701-21.86089-21.8701-57.328683 0-79.18855 21.8701-21.87931 57.30924-21.87931 79.17934 0l154.114007 154.104797 154.095587-154.104797c21.889543-21.87931 57.32766-21.87931 79.198783-0.010233 21.8701 21.8701 21.8701 57.348126 0 79.207993L590.89128 513.065262 744.967424 667.159826z' fill='%23666666'/%3E%3C/svg%3E");
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
min-width:unset;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
width: 0.6px;
|
||||
background-color: var(--background-modifier-border);
|
||||
height: 22px;
|
||||
opacity: 0.8;
|
||||
margin: 0;
|
||||
}
|
||||
.theme-dark :is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
|
||||
background-color: #4f4f5188;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line svg
|
||||
{
|
||||
display: none;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 770 KiB |
@ -1 +0,0 @@
|
||||
{"id":"obsidian-editing-toolbar","name":"Obsidian Editing Toolbar","version":"2.1.1","minAppVersion":"0.9.12","description":"The Obsidian Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.","author":"Cuman","authorUrl":"https://github.com/cumany/obsidian-editing-toolbar","isDesktopOnly":true}
|
@ -1,44 +0,0 @@
|
||||
{
|
||||
"name": "Editing Toolbar",
|
||||
"version": "2.0.4",
|
||||
"description": "The Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.",
|
||||
"main": "main.js",
|
||||
"repository": "https://github.com/cumany/obsidian-editing-toolbar",
|
||||
"scripts": {
|
||||
"dev": "rollup --config rollup.config.js -w",
|
||||
"build": "rollup --config rollup.config.js --environment BUILD:production"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Cuman",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-typescript": "^8.2.1",
|
||||
"@types/feather-icons": "^4.7.0",
|
||||
"@types/node": "^14.17.6",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/sortablejs": "^1.10.7",
|
||||
"obsidian": "^0.15.0",
|
||||
"rollup": "^2.56.3",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-watch": "^4.3.1",
|
||||
"tslib": "^2.2.0",
|
||||
"typescript": "^4.4.2",
|
||||
"typings": "^2.1.1"
|
||||
},
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"feather-icons": "^4.28.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dom-server": "0.0.5",
|
||||
"react-icons": "^4.2.0",
|
||||
"remixicon": "^2.5.0",
|
||||
"sortablejs": "^1.14.0",
|
||||
"terser": "^5.15.0"
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
const isProd = process.env.BUILD === "production";
|
||||
|
||||
const banner = `/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
||||
if you want to view the source visit the plugins github repository
|
||||
*/
|
||||
`;
|
||||
|
||||
export default {
|
||||
input: "src/plugin/main.ts",
|
||||
output: {
|
||||
dir: "./build",
|
||||
sourcemap: "inline",
|
||||
sourcemapExcludeSources: isProd,
|
||||
format: "cjs",
|
||||
exports: "default",
|
||||
banner,
|
||||
},
|
||||
external: ["obsidian"],
|
||||
plugins: [
|
||||
typescript(),
|
||||
resolve({
|
||||
browser: true,
|
||||
}),
|
||||
commonjs({ include: "node_modules/**" }),
|
||||
terser()
|
||||
],
|
||||
};
|
@ -1,166 +0,0 @@
|
||||
export const appIcons: string[] = [
|
||||
// from obsidian app.js file
|
||||
"Custom",
|
||||
"add-note-glyph",
|
||||
"any-key",
|
||||
"audio-file",
|
||||
"blocks",
|
||||
"bold-glyph",
|
||||
"bot-glyph",
|
||||
"box-glyph",
|
||||
"bracket-glyph",
|
||||
"broken-link",
|
||||
"bullet-list-glyph",
|
||||
"bullet-list",
|
||||
"calendar-glyph",
|
||||
"calendar-with-checkmark",
|
||||
"check-in-circle",
|
||||
"check-small",
|
||||
"checkbox-glyph",
|
||||
"checkmark",
|
||||
"clock-glyph",
|
||||
"clock",
|
||||
"cloud",
|
||||
"codeblock-glyph",
|
||||
"code-glyph",
|
||||
"command-glyph",
|
||||
"compress-glyph",
|
||||
"create-new",
|
||||
"cross-in-box",
|
||||
"cross",
|
||||
"crossed-star",
|
||||
"csv",
|
||||
"deleteColumn",
|
||||
"deleteRow",
|
||||
"dice-glyph",
|
||||
"dice",
|
||||
"document",
|
||||
"documents",
|
||||
"dot-network",
|
||||
"double-down-arrow-glyph",
|
||||
"double-up-arrow-glyph",
|
||||
"down-arrow-with-tail",
|
||||
"down-chevron-glyph",
|
||||
"down-curly-arrow-glyph",
|
||||
"duplicate-glyph",
|
||||
"enlarge-glyph",
|
||||
"enter",
|
||||
"exit-fullscreen",
|
||||
"expand-vertically",
|
||||
"file-explorer-glyph",
|
||||
"filled-pin",
|
||||
"formula",
|
||||
"folder",
|
||||
"forward-arrow",
|
||||
"fullscreen",
|
||||
"gear",
|
||||
"go-to-file",
|
||||
"graph-glyph",
|
||||
"hashtag",
|
||||
"heading-glyph",
|
||||
"help",
|
||||
"highlight-glyph",
|
||||
"horizontal-split",
|
||||
"image-file",
|
||||
"image-glyph",
|
||||
"import-glyph",
|
||||
"indent-glyph",
|
||||
"info",
|
||||
"insertColumn",
|
||||
"insertRow",
|
||||
"install",
|
||||
"italic-glyph",
|
||||
"keyboard-glyph",
|
||||
"languages",
|
||||
"left-arrow-with-tail",
|
||||
"left-arrow",
|
||||
"left-chevron-glyph",
|
||||
"lines-of-text",
|
||||
"link-glyph",
|
||||
"link",
|
||||
"links-coming-in",
|
||||
"links-going-out",
|
||||
"logo-crystal",
|
||||
"magnifying-glass",
|
||||
"merge-files-glyph",
|
||||
"merge-files",
|
||||
"microphone-filled",
|
||||
"microphone",
|
||||
"minus-with-circle",
|
||||
"moveColumnLeft",
|
||||
"moveColumnRight",
|
||||
"moveRowDown",
|
||||
"moveRowUp",
|
||||
"navigate-glyph",
|
||||
"note-glyph",
|
||||
"number-list-glyph",
|
||||
"open-elsewhere-glyph",
|
||||
"open-vault",
|
||||
"pane-layout",
|
||||
"paper-plane-glyph",
|
||||
"paper-plane",
|
||||
"paste-text",
|
||||
"paste",
|
||||
"paused",
|
||||
"pdf-file",
|
||||
"pencil",
|
||||
"percent-sign-glyph",
|
||||
"pin",
|
||||
"play-audio-glyph",
|
||||
"plus-minus-glyph",
|
||||
"plus-with-circle",
|
||||
"popup-open",
|
||||
"presentation-glyph",
|
||||
"presentation",
|
||||
"price-tag-glyph",
|
||||
"question-mark-glyph",
|
||||
"quote-glyph",
|
||||
"redo-glyph",
|
||||
"reset",
|
||||
"restore-file-glyph",
|
||||
"right-arrow-with-tail",
|
||||
"right-arrow",
|
||||
"right-chevron-glyph",
|
||||
"right-triangle",
|
||||
"run-command",
|
||||
"scissors-glyph",
|
||||
"scissors",
|
||||
"search-glyph",
|
||||
"search",
|
||||
"select-all-text",
|
||||
"sheets-in-box",
|
||||
"sortAsc",
|
||||
"sortDesc",
|
||||
"spreadsheet",
|
||||
"split",
|
||||
"stacked-levels",
|
||||
"star-glyph",
|
||||
"star-list",
|
||||
"star",
|
||||
"stop-audio-glyph",
|
||||
"strikethrough-glyph",
|
||||
"subscript-glyph",
|
||||
"superscript-glyph",
|
||||
"switch",
|
||||
"sync-small",
|
||||
"sync",
|
||||
"tag-glyph",
|
||||
"three-horizontal-bars",
|
||||
"tomorrow-glyph",
|
||||
"trash",
|
||||
"two-blank-pages",
|
||||
"underline-glyph",
|
||||
"undo-glyph",
|
||||
"unindent-glyph",
|
||||
"up-and-down-arrows",
|
||||
"up-arrow-with-tail",
|
||||
"up-chevron-glyph",
|
||||
"up-curly-arrow-glyph",
|
||||
"uppercase-lowercase-a",
|
||||
"vault",
|
||||
"vertical-split",
|
||||
"vertical-three-dots",
|
||||
"workspace-glyph",
|
||||
"wrench-screwdriver-glyph",
|
||||
"yesterday-glyph",
|
||||
];
|
@ -1,87 +0,0 @@
|
||||
import * as featherIcons from "feather-icons";
|
||||
import * as remixicons from "react-icons/ri/";
|
||||
//import * as boxicons from "react-icons/bi/";
|
||||
import { renderToString } from "react-dom/server";
|
||||
import { addIcon } from "obsidian";
|
||||
|
||||
export interface Icon {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const icons: Record<string, string> = {
|
||||
cMenuToolbar: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="currentColor"/></svg>`,
|
||||
cMenuToolbarSub:`<svg t="1661526346488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16880" ><path d="M597.333333 85.333333h-341.333333C187.733333 85.333333 128 140.8 128 213.333333v597.333334c0 72.533333 59.733333 128 128 128h426.666667c72.533333 0 128-55.466667 128-128V298.666667l-213.333334-213.333334z m170.666667 725.333334c0 46.933333-38.4 85.333333-85.333333 85.333333H256c-46.933333 0-85.333333-38.4-85.333333-85.333333V213.333333c0-46.933333 38.4-85.333333 85.333333-85.333333h298.666667v213.333333h213.333333v469.333334z m-320-234.666667h128c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333334h-128v128c0 12.8-8.533333 21.333333-21.333333 21.333333s-21.333333-8.533333-21.333334-21.333333v-128h-128c-12.8 0-21.333333-8.533333-21.333333-21.333334s8.533333-21.333333 21.333333-21.333333h128v-128c0-12.8 8.533333-21.333333 21.333334-21.333333s21.333333 8.533333 21.333333 21.333333v128z" fill="#8a8a8a" p-id="16881"></path></svg>`,
|
||||
cMenuToolbarAdd: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z" fill="white"/><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10s10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8s8 3.589 8 8s-3.589 8-8 8z" fill="white"/></svg>`,
|
||||
cMenuToolbarDelete: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z" fill="white"/><path d="M9 10h2v8H9zm4 0h2v8h-2z" fill="white"/></svg>`,
|
||||
cMenuToolbarReload: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="white"/></svg>`,
|
||||
"codeblock-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zM4 19V7h16l.002 12H4z" fill="currentColor"/><path d="M9.293 9.293L5.586 13l3.707 3.707l1.414-1.414L8.414 13l2.293-2.293zm5.414 0l-1.414 1.414L15.586 13l-2.293 2.293l1.414 1.414L18.414 13z"/></svg>`,
|
||||
"underline-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 1024 1024"><path fill="currentColor" d="M824 804H200c-4.4 0-8 3.4-8 7.6v60.8c0 4.2 3.6 7.6 8 7.6h624c4.4 0 8-3.4 8-7.6v-60.8c0-4.2-3.6-7.6-8-7.6zm-312-76c69.4 0 134.6-27.1 183.8-76.2C745 602.7 772 537.4 772 468V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 97-79 176-176 176s-176-79-176-176V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 69.4 27.1 134.6 76.2 183.8C377.3 701 442.6 728 512 728z"/></svg>`,
|
||||
"superscript-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor"d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41M21.85 9h-4.88V8l.89-.82c.76-.64 1.32-1.18 1.7-1.63c.37-.44.56-.85.57-1.23a.884.884 0 0 0-.27-.7c-.18-.19-.47-.28-.86-.29c-.31.01-.58.07-.84.17l-.66.39l-.45-1.17c.27-.22.59-.39.98-.53S18.85 2 19.32 2c.78 0 1.38.2 1.78.61c.4.39.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.48-.76.93-1.27 1.36l-.64.52v.02h2.58V9z"/></svg>`,
|
||||
"subscript-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41m5.85 13.62h-4.88v-1l.89-.8c.76-.65 1.32-1.19 1.7-1.63c.37-.44.56-.85.57-1.24a.898.898 0 0 0-.27-.7c-.18-.16-.47-.28-.86-.28c-.31 0-.58.06-.84.18l-.66.38l-.45-1.17c.27-.21.59-.39.98-.53s.82-.24 1.29-.24c.78.04 1.38.25 1.78.66c.4.41.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.47-.76.92-1.27 1.36l-.64.52v.02h2.58v1.35z"/></svg>`,
|
||||
"bot-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M21.928 11.607c-.202-.488-.635-.605-.928-.633V8c0-1.103-.897-2-2-2h-6V4.61c.305-.274.5-.668.5-1.11a1.5 1.5 0 0 0-3 0c0 .442.195.836.5 1.11V6H5c-1.103 0-2 .897-2 2v2.997l-.082.006A1 1 0 0 0 1.99 12v2a1 1 0 0 0 1 1H3v5c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5a1 1 0 0 0 1-1v-1.938a1.006 1.006 0 0 0-.072-.455zM5 20V8h14l.001 3.996L19 12v2l.001.005l.001 5.995H5z" fill="currentColor"/><ellipse cx="8.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><ellipse cx="15.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><path d="M8 16h8v2H8z" fill="currentColor"/></svg>`,
|
||||
"header-1":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill="currentColor" d="M835.626667 349.397333A42.666667 42.666667 0 0 1 853.333333 384v426.666667a42.666667 42.666667 0 0 1-85.333333 0v-367.488l-71.850667 23.978666a42.666667 42.666667 0 0 1-26.965333-80.981333l128-42.666667a42.666667 42.666667 0 0 1 38.4 5.888zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1635"></path></svg>`,
|
||||
"header-2":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M768 426.666667a85.333333 85.333333 0 0 0-85.333333 85.333333v21.333333a42.666667 42.666667 0 1 1-85.333334 0V512a170.666667 170.666667 0 0 1 170.666667-170.666667h7.338667a163.328 163.328 0 0 1 115.498666 278.869334L742.997333 768H896a42.666667 42.666667 0 1 1 0 85.333333h-256a42.666667 42.666667 0 0 1-30.165333-72.832l220.672-220.672A77.994667 77.994667 0 0 0 775.338667 426.666667H768zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1791"></path></svg>`,
|
||||
"header-3":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M597.333333 384a42.666667 42.666667 0 0 1 42.666667-42.666667h256a42.666667 42.666667 0 0 1 30.165333 72.832l-105.941333 105.984A170.752 170.752 0 0 1 768 853.333333a170.666667 170.666667 0 0 1-160.938667-113.877333 42.666667 42.666667 0 0 1 80.469334-28.373333A85.333333 85.333333 0 1 0 768 597.333333h-42.666667a42.666667 42.666667 0 0 1-30.165333-72.832L793.002667 426.666667H640a42.666667 42.666667 0 0 1-42.666667-42.666667zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1949"></path></svg>`,
|
||||
"header-4":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M780.714667 343.296a42.666667 42.666667 0 0 1 28.032 53.418667L719.36 682.666667H896a42.666667 42.666667 0 1 1 0 85.333333h-234.666667a42.666667 42.666667 0 0 1-40.704-55.381333l106.666667-341.333334a42.666667 42.666667 0 0 1 53.418667-27.989333z" p-id="2107"></path><path d="M853.333333 554.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v213.333334a42.666667 42.666667 0 1 1-85.333333 0v-213.333334a42.666667 42.666667 0 0 1 42.666666-42.666666zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2108"></path></svg>`,
|
||||
"header-5":`
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M683.946667 373.674667A42.666667 42.666667 0 0 1 725.333333 341.333333h170.666667a42.666667 42.666667 0 1 1 0 85.333334h-137.301333l-22.016 88.234666A170.666667 170.666667 0 1 1 640 795.562667a42.666667 42.666667 0 1 1 64-56.448 85.333333 85.333333 0 1 0 0-112.896 42.666667 42.666667 0 0 1-73.386667-38.528l53.333334-214.016zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2264"></path></svg>`,
|
||||
"header-6":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M831.274667 303.957333a42.666667 42.666667 0 0 1 16.725333 57.984l-83.498667 151.466667a170.453333 170.453333 0 0 1 88.746667 22.741333 169.557333 169.557333 0 0 1 62.506667 232.277334 171.093333 171.093333 0 0 1-232.96 62.165333 169.557333 169.557333 0 0 1-62.805334-231.850667l153.301334-278.016a42.666667 42.666667 0 0 1 57.984-16.768z m-20.48 306.176a85.76 85.76 0 0 0-116.736 31.018667 84.224 84.224 0 0 0 31.189333 115.456 85.76 85.76 0 0 0 116.736-31.018667 84.224 84.224 0 0 0-31.232-115.456zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2422"></path></svg>`,
|
||||
"header-n":`<svg viewBox="0 0 24 24" ><path d="M2 3a1 1 0 0 0-1 1v16a1 1 0 1 0 2 0v-7h9v7a1 1 0 1 0 2 0V4a1 1 0 1 0-2 0v7H3V4a1 1 0 0 0-1-1Zm14 9a1 1 0 0 1 1.984-.177 4.099 4.099 0 0 1 1.757-.576 3.447 3.447 0 0 1 3.759 3.432V20a1 1 0 1 1-2 0v-5.32c0-.851-.73-1.519-1.578-1.442A2.114 2.114 0 0 0 18 15.344V20a1 1 0 1 1-2 0v-8Z" fill="currentColor"></path></svg>`,
|
||||
};
|
||||
|
||||
export default function addIcons() {
|
||||
Object.keys(icons).forEach((key) => {
|
||||
addIcon(key, icons[key]);
|
||||
});
|
||||
}
|
||||
|
||||
export function addFeatherIcons(appIcons: string[]) {
|
||||
Object.values(featherIcons.icons).forEach((icon) => {
|
||||
const svg = icon.toSvg({
|
||||
viewBox: "0 0 24 24",
|
||||
width: "100",
|
||||
height: "100",
|
||||
"stroke-width": "2",
|
||||
});
|
||||
addIcon("feather-" + icon.name, svg);
|
||||
appIcons.push("feather-" + icon.name);
|
||||
});
|
||||
}
|
||||
|
||||
export function addRemixIcons(appIcons: string[]) {
|
||||
const iconKeys: Icon[] = [];
|
||||
for (const icon in remixicons) {
|
||||
iconKeys.push({
|
||||
id: icon,
|
||||
name: icon.substring(2),
|
||||
});
|
||||
const svg = renderToString(
|
||||
// @ts-ignore
|
||||
remixicons[icon]({
|
||||
size: "100",
|
||||
})
|
||||
);
|
||||
addIcon("remix-" + icon.substring(2), svg);
|
||||
appIcons.push("remix-" + icon.substring(2));
|
||||
}
|
||||
}
|
||||
|
||||
/* export function addBoxIcons(appIcons: string[]) {
|
||||
const iconKeys: Icon[] = [];
|
||||
for (const icon in boxicons) {
|
||||
iconKeys.push({
|
||||
id: icon,
|
||||
name: icon.substring(2),
|
||||
});
|
||||
const svg = renderToString(
|
||||
// @ts-ignore
|
||||
boxicons[icon]({
|
||||
size: "100",
|
||||
})
|
||||
);
|
||||
addIcon("bx-" + icon.substring(2), svg);
|
||||
appIcons.push("bx-" + icon.substring(2));
|
||||
}
|
||||
}
|
||||
*/
|
@ -1,755 +0,0 @@
|
||||
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { App, Notice, Command, requireApiVersion, MarkdownView, ButtonComponent, WorkspaceParent, WorkspaceWindow } from "obsidian";
|
||||
import { WorkspaceExt, WorkspaceItemExt, WorkspaceParentExt } from 'src/util/obsidian-ext';
|
||||
import { setBottomValue } from "src/util/statusBarConstants";
|
||||
import { backcolorpicker, colorpicker } from "src/util/util";
|
||||
import { t } from "src/translations/helper";
|
||||
import { cMenuToolbarSettings } from "src/settings/settingsData";
|
||||
|
||||
window.ISMORE = false;
|
||||
window.isBgC = false;
|
||||
window.isCTxt = false;
|
||||
window.isText = false;
|
||||
let activeDocument: Document;
|
||||
|
||||
export function getRootSplits(): WorkspaceParentExt[] {
|
||||
const rootSplits: WorkspaceParentExt[] = [];
|
||||
|
||||
// push the main window's root split to the list
|
||||
rootSplits.push(app.workspace.rootSplit as WorkspaceParent as WorkspaceParentExt)
|
||||
|
||||
// @ts-ignore floatingSplit is undocumented
|
||||
const floatingSplit = app.workspace.floatingSplit as WorkspaceParentExt;
|
||||
floatingSplit?.children.forEach((child: WorkspaceParentExt) => {
|
||||
// if this is a window, push it to the list
|
||||
if (child instanceof WorkspaceWindow) {
|
||||
rootSplits.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
return rootSplits;
|
||||
}
|
||||
export function selfDestruct() {
|
||||
const rootSplits = getRootSplits();
|
||||
const clearToolbar = (leaf: HTMLElement) => {
|
||||
|
||||
let cMenuToolbarModalBar = leaf.querySelector(
|
||||
"#cMenuToolbarModalBar"
|
||||
);
|
||||
let cMenuToolbarPopoverBar = leaf.querySelector(
|
||||
"#cMenuToolbarPopoverBar"
|
||||
);
|
||||
|
||||
if (cMenuToolbarModalBar) {
|
||||
if (cMenuToolbarModalBar.firstChild) {
|
||||
cMenuToolbarModalBar.removeChild(cMenuToolbarModalBar.firstChild);
|
||||
}
|
||||
cMenuToolbarModalBar.remove();
|
||||
}
|
||||
if (cMenuToolbarPopoverBar) {
|
||||
if (cMenuToolbarPopoverBar.firstChild) {
|
||||
cMenuToolbarPopoverBar.removeChild(cMenuToolbarPopoverBar.firstChild);
|
||||
}
|
||||
cMenuToolbarPopoverBar.remove();
|
||||
}
|
||||
}
|
||||
if (rootSplits)
|
||||
rootSplits.forEach((rootSplit: WorkspaceParentExt) => {
|
||||
if (rootSplit?.containerEl)
|
||||
clearToolbar(rootSplit?.containerEl)
|
||||
});
|
||||
|
||||
}
|
||||
export const getcoords = (editor: any) => {
|
||||
const cursorFrom = editor.getCursor("head");
|
||||
|
||||
let coords;
|
||||
if (editor.cursorCoords) coords = editor.cursorCoords(true, "window");
|
||||
else if (editor.coordsAtPos) {
|
||||
const offset = editor.posToOffset(cursorFrom);
|
||||
coords = editor.cm.coordsAtPos?.(offset) ?? editor.coordsAtPos(offset);
|
||||
} else return;
|
||||
|
||||
return coords;
|
||||
};
|
||||
|
||||
export function getModestate(app: {
|
||||
workspace: { getActiveViewOfType: (arg0: typeof MarkdownView) => any };
|
||||
}) {
|
||||
const activePane = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activePane) {
|
||||
let currentmode = activePane?.getMode();
|
||||
|
||||
if (currentmode === "empty") {
|
||||
return false;
|
||||
}
|
||||
if (currentmode == "preview") {
|
||||
return false;
|
||||
}
|
||||
if (currentmode == "source") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function checksvg(htmlStr: string) {
|
||||
let reg = /<[^>]+>/g;
|
||||
return reg.test(htmlStr);
|
||||
}
|
||||
|
||||
export function CreateDiv(selector: string) {
|
||||
let div = createEl("div");
|
||||
div.addClass(selector);
|
||||
return div;
|
||||
}
|
||||
|
||||
export function tabCell(app: App, plugin: cMenuToolbarPlugin, el: string) {
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
let tab = activeDocument.getElementById(el);
|
||||
// @ts-ignore
|
||||
let rows = tab.rows;
|
||||
let rlen = rows.length;
|
||||
for (let i = 1; i < rlen; i++) {
|
||||
//遍历所有行
|
||||
let cells = rows[i].cells; //得到这一行的所有单元格
|
||||
for (let j = 0; j < cells.length; j++) {
|
||||
//给每一个单元格添加click事件
|
||||
cells[j].onclick = function () {
|
||||
let backcolor = this.style.backgroundColor;
|
||||
if (backcolor != "") {
|
||||
backcolor = colorHex(backcolor);
|
||||
if (el == "x-color-picker-table") {
|
||||
plugin.settings.cMenuFontColor = backcolor;
|
||||
Setfontcolor(app, backcolor);
|
||||
activeDocument.getElementById("change-font-color-icon").style.fill =
|
||||
plugin.settings.cMenuFontColor;
|
||||
} else if (el == "x-backgroundcolor-picker-table") {
|
||||
plugin.settings.cMenuBackgroundColor = backcolor;
|
||||
Setbackgroundcolor(app, backcolor);
|
||||
activeDocument.getElementById(
|
||||
"change-background-color-icon"
|
||||
).style.fill = plugin.settings.cMenuBackgroundColor;
|
||||
}
|
||||
|
||||
plugin.saveSettings();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function Setfontcolor(app: App, color: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || "") {
|
||||
return;
|
||||
}
|
||||
|
||||
let _html0 = /\<font color=[0-9a-zA-Z#]+[^\<\>]*\>[^\<\>]+\<\/font\>/g;
|
||||
let _html1 = /^\<font color=[0-9a-zA-Z#]+[^\<\>]*\>([^\<\>]+)\<\/font\>$/;
|
||||
let _html2 = '<font color="' + color + '">$1</font>';
|
||||
let _html3 = /\<font color=[^\<]*$|^[^\>]*font\>/g; //是否只包含一侧的<>
|
||||
|
||||
if (_html3.test(selectText)) {
|
||||
return;
|
||||
} else if (_html0.test(selectText)) {
|
||||
if (_html1.test(selectText)) {
|
||||
|
||||
selectText = selectText.replace(_html1, _html2);
|
||||
} else {
|
||||
selectText = selectText.replace(
|
||||
/\<font color=[0-9a-zA-Z#]+[^\<\>]*?\>|\<\/font\>/g,
|
||||
""
|
||||
);
|
||||
}
|
||||
} else {
|
||||
selectText = selectText.replace(/^(.+)$/gm, _html2);
|
||||
}
|
||||
editor.replaceSelection(selectText);
|
||||
editor.exec("goRight");
|
||||
// @ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
}
|
||||
|
||||
export function Setbackgroundcolor(app: App, color: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || selectText == "") {
|
||||
return;
|
||||
}
|
||||
let _html0 =
|
||||
/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>[^\<\>]+\<\/span\>/g;
|
||||
let _html1 =
|
||||
/^\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>([^\<\>]+)\<\/span\>$/;
|
||||
let _html2 = '<span style="background:' + color + '">$1</span>';
|
||||
let _html3 = /\<span style=[^\<]*$|^[^\>]*span\>/g; //是否只包含一侧的<>
|
||||
if (_html3.test(selectText)) {
|
||||
return;
|
||||
} else if (_html0.test(selectText)) {
|
||||
if (_html1.test(selectText)) {
|
||||
selectText = selectText.replace(_html1, _html2);
|
||||
} else {
|
||||
selectText = selectText.replace(
|
||||
/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>|\<\/span\>/g,
|
||||
""
|
||||
);
|
||||
|
||||
}
|
||||
} else {
|
||||
selectText = selectText.replace(/^(.+)$/gm, _html2);
|
||||
}
|
||||
editor.replaceSelection(selectText);
|
||||
editor.exec("goRight");
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
}
|
||||
|
||||
export const colorHex = function (color: string) {
|
||||
let that = color;
|
||||
let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
||||
if (/^(rgb|RGB)/.test(that)) {
|
||||
let aColor = that.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
|
||||
let strHex = "#";
|
||||
for (let i = 0; i < aColor.length; i++) {
|
||||
let hex = Number(aColor[i]).toString(16);
|
||||
if (hex === "0") {
|
||||
hex += hex;
|
||||
}
|
||||
strHex += hex;
|
||||
}
|
||||
if (strHex.length !== 7) {
|
||||
strHex = that;
|
||||
}
|
||||
return strHex;
|
||||
} else if (reg.test(that)) {
|
||||
let aNum = that.replace(/#/, "").split("");
|
||||
if (aNum.length === 6) {
|
||||
return that;
|
||||
} else if (aNum.length === 3) {
|
||||
let numHex = "#";
|
||||
for (let i = 0; i < aNum.length; i += 1) {
|
||||
numHex += aNum[i] + aNum[i];
|
||||
}
|
||||
console.log(numHex);
|
||||
return numHex;
|
||||
}
|
||||
} else {
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
export function CreateMoreMenu(selector: HTMLDivElement) {
|
||||
// let issubmenu= activeDocument.getElementById("cMenuToolbarModalBar").querySelector('.'+selector);
|
||||
// let barHeight = activeDocument.getElementById("cMenuToolbarModalBar").offsetHeight;
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (!window.ISMORE) return;
|
||||
let cMoreMenu = selector.createEl("span");
|
||||
cMoreMenu.addClass("more-menu");
|
||||
let morebutton = new ButtonComponent(cMoreMenu);
|
||||
morebutton
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setTooltip(t("More"))
|
||||
.onClick(() => {
|
||||
if (
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility ==
|
||||
"hidden"
|
||||
) {
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility =
|
||||
"visible";
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.height = "32px";
|
||||
} else {
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility =
|
||||
"hidden";
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.height = "0";
|
||||
}
|
||||
});
|
||||
morebutton.buttonEl.innerHTML = `<svg width="14" height="14" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" enable-background="new 0 0 1024 1024" xml:space="preserve"><path fill="#666" d="M510.29 14.13 q17.09 -15.07 40.2 -14.07 q23.12 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.1 q-23.62 2.01 -41.71 -13.07 q-18.08 -15.08 -20.09 -38.19 q-2.01 -23.12 13.06 -41.21 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.67 -386.92 q-15.07 -17.09 -13.56 -40.7 q1.51 -23.62 19.59 -38.7 ZM81.17 14.13 q17.08 -15.07 40.19 -14.07 q23.11 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.6 q-23.61 2.51 -41.7 -12.57 q-18.09 -15.08 -20.1 -38.69 q-2.01 -23.62 13.06 -41.71 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.66 -386.92 q-15.08 -17.09 -13.57 -40.7 q1.51 -23.62 19.6 -38.7 Z"/></svg>`;
|
||||
window.ISMORE = false;
|
||||
return cMoreMenu;
|
||||
}
|
||||
|
||||
export function QuiteFormatBrushes() {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
//关闭所有格式刷变量
|
||||
if (window.newNotice) window.newNotice.hide();
|
||||
window.isBgC = false; //多彩背景刷
|
||||
window.isCTxt = false; //多彩文字刷
|
||||
window.isText = false;
|
||||
}
|
||||
|
||||
export function SetHeader(_str: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let linetext = editor.getLine(editor.getCursor().line);
|
||||
let newstr, linend = "";
|
||||
if (_str == "") { //若为标题,转为普通文本
|
||||
newstr = linetext.replace(/^(\>*(\[[!\w]+\])?\s*)#+\s/, "$1");
|
||||
} else { //列表、引用,先转为普通文本,再转为标题
|
||||
newstr = linetext.replace(/^\s*(#*|\>|\-|\d+\.)\s*/m, "");
|
||||
newstr = _str + " " + newstr;
|
||||
}
|
||||
if (newstr != "") {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: linetext.length });
|
||||
} else {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: 0 });
|
||||
};
|
||||
editor.setLine(editor.getCursor().line, newstr);
|
||||
editor.setCursor({ line: editor.getCursor().line, ch: Number(newstr.length - linend.length) });
|
||||
};
|
||||
}
|
||||
export function FormatEraser() {
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor
|
||||
let linend;
|
||||
let selstart = editor.getRange({ line: editor.getCursor().line, ch: 0 }, editor.getCursor());
|
||||
let linetext = editor.getLine(editor.getCursor().line);
|
||||
|
||||
if (linetext != "") {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: linetext.length });
|
||||
} else {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: 0 });
|
||||
};
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || selectText == "") {
|
||||
QuiteFormatBrushes();
|
||||
window.isText = true;
|
||||
if (window.newNotice) {
|
||||
if (window.newNotice.noticeEl.innerText != t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"))
|
||||
window.newNotice = new Notice(t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"), 0);
|
||||
}
|
||||
else window.newNotice = new Notice(t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"), 0);
|
||||
|
||||
//new obsidian.Notice("请先划选部分文本,再执行命令!");
|
||||
let reg1 = /(~~|%%|\*==|==|\*\*?|\<[^\<\>]*?\>|!?\[\[*|`|_|!?\[)([^!#=\[\]\<\>\`_\*~\(\)]*)$/;
|
||||
let reg2 = /^([^!=\[\]\<\>\`_\*~\(\)]*)(~~|%%|==\*|==|\*\*?|\<[^\<\>]*\>|\]\]|`|_|\]\([^\(\)\[\]]*\))/;
|
||||
if (selstart.match(reg1) != null && linend.match(reg2) != null) {
|
||||
selstart = selstart.replace(reg1, "$2");
|
||||
linend = linend.replace(reg2, "$1");
|
||||
//笔记全文.replaceRange(selstart+linend, {line:当前行号,ch:0},{line:当前行号,ch:当前行文本.length});
|
||||
editor.setLine(editor.getCursor().line, selstart + linend);
|
||||
editor.setCursor({ line: editor.getCursor().line, ch: Number(selstart.length) });
|
||||
}
|
||||
|
||||
} else {
|
||||
let mdText = /(^#+\s|(?<=^|\s*)#|^\>|^\- \[( |x)\]|^\+ |\<[^\<\>]+?\>|^1\. |^\s*\- |^\-+$|^\*+$|==\*|\*==|==\*\*|\*\*==|==\*\*\*|\*\*\*==)/mg;
|
||||
selectText = selectText.replace(mdText, "");
|
||||
selectText = selectText.replace(/^[ ]+|[ ]+$/mg, "");
|
||||
selectText = selectText.replace(/\!?\[\[([^\[\]\|]*\|)*([^\(\)\[\]]+)\]\]/g, "$2");
|
||||
selectText = selectText.replace(/\!?\[+([^\[\]\(\)]+)\]+\(([^\(\)]+)\)/g, "$1");
|
||||
selectText = selectText.replace(/`([^`]+)`/g, "$1");
|
||||
selectText = selectText.replace(/_([^_]+)_/g, "$1");
|
||||
selectText = selectText.replace(/==([^=]+)==/g, "$1");
|
||||
selectText = selectText.replace(/\*\*?([^\*]+)\*\*?/g, "$1");
|
||||
selectText = selectText.replace(/~~([^~]+)~~/g, "$1");
|
||||
selectText = selectText.replace(/(\r*\n)+/mg, "\r\n");
|
||||
editor.replaceSelection(selectText);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
export const followingbar = (settings: cMenuToolbarSettings) => {
|
||||
|
||||
let isource = getModestate(app);
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
//console.log(activeLeaf.getViewState().state.mode)
|
||||
if (isource) {
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
|
||||
|
||||
if (cMenuToolbarModalBar) {
|
||||
|
||||
let selection = editor.somethingSelected();
|
||||
let cMenuToolbarRows = settings.cMenuNumRows;
|
||||
selection
|
||||
? (cMenuToolbarModalBar.style.visibility = "visible")
|
||||
: (cMenuToolbarModalBar.style.visibility = "hidden");
|
||||
|
||||
let ElementCount = cMenuToolbarModalBar.childElementCount;
|
||||
if (ElementCount) {
|
||||
ElementCount == cMenuToolbarRows
|
||||
? (cMenuToolbarModalBar.addClass("cMenuToolbarGrid"), cMenuToolbarModalBar.removeClass("cMenuToolbarFlex"))
|
||||
: (cMenuToolbarModalBar.addClass("cMenuToolbarFlex"), cMenuToolbarModalBar.removeClass("cMenuToolbarGrid"))
|
||||
} else {
|
||||
ElementCount = 0;
|
||||
}
|
||||
|
||||
let cmheight = Math.ceil(ElementCount / cMenuToolbarRows);
|
||||
|
||||
cMenuToolbarModalBar.style.height = 40 * cmheight + "px";
|
||||
if (settings.aestheticStyle == "tiny") {
|
||||
cMenuToolbarModalBar.style.height = 25 * cmheight + "px";
|
||||
}
|
||||
let rleftwidth =
|
||||
activeDocument.getElementsByClassName("side-dock-ribbon mod-left")[0]
|
||||
?.clientWidth ?? 0;
|
||||
|
||||
let leftwidth =
|
||||
activeDocument.getElementsByClassName("mod-left-split")[0]
|
||||
?.clientWidth ?? 0;
|
||||
|
||||
let barwidth = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
).offsetWidth;
|
||||
let barHeight = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
).offsetHeight;
|
||||
|
||||
let bodywidth = activeDocument.body.offsetWidth;
|
||||
let coords = getcoords(editor);
|
||||
let cursor_head = editor.getCursor("head").ch
|
||||
let cursor_from = editor.getCursor("from").ch
|
||||
|
||||
let toppx = 0;
|
||||
/*添加判断边界 */
|
||||
let leftpx = coords.left - leftwidth - rleftwidth + 20;
|
||||
if (coords.left + barwidth + 15 > bodywidth)
|
||||
leftpx = coords.left - leftwidth - rleftwidth - barwidth / 1.3 - 60;
|
||||
cursor_head == cursor_from ?
|
||||
toppx = coords.top - barHeight - 30 : (toppx = coords.top, leftpx = leftpx - 40);
|
||||
if (leftpx < 0) leftpx = 0;
|
||||
cMenuToolbarModalBar.style.visibility == "visible" ?
|
||||
(cMenuToolbarModalBar.style.left = leftpx + "px", cMenuToolbarModalBar.style.top = toppx + "px") : true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
}
|
||||
export function cMenuToolbarPopover(
|
||||
app: App,
|
||||
plugin: cMenuToolbarPlugin
|
||||
): void {
|
||||
let settings = plugin.settings;
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
function createMenu() {
|
||||
const generateMenu = () => {
|
||||
let btnwidth = 0;
|
||||
let cMenuToolbar = createEl("div");
|
||||
if (cMenuToolbar) {
|
||||
if (settings.positionStyle == "top") {
|
||||
cMenuToolbar.setAttribute(
|
||||
"style",
|
||||
`position: relative; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));`
|
||||
);
|
||||
} else {
|
||||
cMenuToolbar.setAttribute(
|
||||
"style",
|
||||
`left: calc(50% - calc(${cMenuToolbar.offsetWidth
|
||||
}px / 2)); bottom: ${settings.cMenuBottomValue
|
||||
}em; grid-template-columns: ${"1fr ".repeat(settings.cMenuNumRows)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
cMenuToolbar.setAttribute("id", "cMenuToolbarModalBar");
|
||||
//二级弹出菜单
|
||||
|
||||
let PopoverMenu = createEl("div");
|
||||
PopoverMenu.addClass("cMenuToolbarpopover");
|
||||
PopoverMenu.addClass("cMenuToolbarTinyAesthetic");
|
||||
PopoverMenu.setAttribute("id", "cMenuToolbarPopoverBar");
|
||||
PopoverMenu.style.visibility = "hidden";
|
||||
PopoverMenu.style.height = "0";
|
||||
if (settings.aestheticStyle == "default") {
|
||||
cMenuToolbar.addClass("cMenuToolbarDefaultAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarGlassAesthetic");
|
||||
} else if (settings.aestheticStyle == "tiny") {
|
||||
cMenuToolbar.addClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarDefaultAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarGlassAesthetic");
|
||||
} else {
|
||||
cMenuToolbar.addClass("cMenuToolbarGlassAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarDefaultAesthetic");
|
||||
}
|
||||
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
}
|
||||
|
||||
let leafwidth = 99999;
|
||||
if (settings.positionStyle == "top") {
|
||||
let currentleaf = activeDocument.body?.querySelector(
|
||||
".workspace-leaf.mod-active"
|
||||
);
|
||||
if (!activeDocument.getElementById("cMenuToolbarPopoverBar"))
|
||||
currentleaf
|
||||
?.querySelector(".markdown-source-view")
|
||||
.insertAdjacentElement("afterbegin", PopoverMenu);
|
||||
currentleaf
|
||||
?.querySelector(".markdown-source-view")
|
||||
.insertAdjacentElement("afterbegin", cMenuToolbar);
|
||||
leafwidth = currentleaf.querySelector<HTMLElement>(
|
||||
".markdown-source-view"
|
||||
).offsetWidth;
|
||||
} else if (settings.appendMethod == "body") {
|
||||
activeDocument.body.appendChild(cMenuToolbar);
|
||||
} else if (settings.appendMethod == "workspace") {
|
||||
activeDocument.body
|
||||
?.querySelector(".mod-vertical.mod-root")
|
||||
.insertAdjacentElement("afterbegin", cMenuToolbar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let cMenuToolbarPopoverBar = activeDocument.getElementById(
|
||||
"cMenuToolbarPopoverBar"
|
||||
);
|
||||
settings.menuCommands.forEach((item, index) => {
|
||||
if ("SubmenuCommands" in item) {
|
||||
let _btn: any;
|
||||
if (btnwidth >= leafwidth - 26 * 4 && leafwidth > 100) {
|
||||
//说明已经溢出
|
||||
window.ISMORE = true; //需要添加更多按钮
|
||||
_btn = new ButtonComponent(cMenuToolbarPopoverBar);
|
||||
} else _btn = new ButtonComponent(cMenuToolbar);
|
||||
|
||||
_btn.setClass("cMenuToolbarCommandsubItem" + index);
|
||||
|
||||
checksvg(item.icon)
|
||||
? (_btn.buttonEl.innerHTML = item.icon)
|
||||
: _btn.setIcon(item.icon);
|
||||
|
||||
let __btnwidth;
|
||||
if (_btn.buttonEl.offsetWidth > 100) __btnwidth = 26;
|
||||
else {
|
||||
if (_btn.buttonEl.offsetWidth < 26) __btnwidth = 26;
|
||||
else __btnwidth = _btn.buttonEl.offsetWidth;
|
||||
}
|
||||
btnwidth += __btnwidth + 2;
|
||||
let submenu = CreateDiv("subitem");
|
||||
if (submenu) {
|
||||
item.SubmenuCommands.forEach(
|
||||
(subitem: { name: string; id: any; icon: string }) => {
|
||||
let sub_btn = new ButtonComponent(submenu)
|
||||
.setTooltip(subitem.name)
|
||||
.setClass("menu-item")
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(subitem.id);
|
||||
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(subitem.icon)
|
||||
? (sub_btn.buttonEl.innerHTML = subitem.icon)
|
||||
: sub_btn.setIcon(subitem.icon);
|
||||
|
||||
_btn.buttonEl.insertAdjacentElement("afterbegin", submenu);
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (item.id == "obsidian-editing-toolbar:change-font-color") {
|
||||
let button2 = new ButtonComponent(cMenuToolbar);
|
||||
button2
|
||||
.setClass("cMenuToolbarCommandsubItem-font-color")
|
||||
.setTooltip(t("Font Colors"))
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(item.icon)
|
||||
? (button2.buttonEl.innerHTML = item.icon)
|
||||
: button2.setIcon(item.icon);
|
||||
|
||||
btnwidth += 26;
|
||||
// let Selection = createDiv("triangle-icon");
|
||||
let submenu2 = createEl("div");
|
||||
submenu2.addClass("subitem");
|
||||
|
||||
if (submenu2) {
|
||||
submenu2.innerHTML = colorpicker;
|
||||
|
||||
button2.buttonEl.insertAdjacentElement("afterbegin", submenu2);
|
||||
if (settings.cMenuFontColor)
|
||||
activeDocument.getElementById(
|
||||
"change-font-color-icon"
|
||||
).style.fill = settings.cMenuFontColor;
|
||||
tabCell(app, plugin, "x-color-picker-table");
|
||||
let el = submenu2.querySelector(
|
||||
".x-color-picker-wrapper"
|
||||
) as HTMLElement;
|
||||
|
||||
let button3 = new ButtonComponent(el);
|
||||
button3
|
||||
.setIcon("remix-Brush2Line")
|
||||
.setTooltip(t("Format Brush"))
|
||||
.onClick(() => {
|
||||
QuiteFormatBrushes();
|
||||
window.isCTxt = true;
|
||||
window.newNotice = new Notice(
|
||||
t("Font-Color formatting brush ON!"),
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
} else if (item.id == "obsidian-editing-toolbar:change-background-color") {
|
||||
let button2 = new ButtonComponent(cMenuToolbar);
|
||||
button2
|
||||
.setClass("cMenuToolbarCommandsubItem-font-color")
|
||||
.setTooltip(t("Background color"))
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(item.icon)
|
||||
? (button2.buttonEl.innerHTML = item.icon)
|
||||
: button2.setIcon(item.icon);
|
||||
|
||||
btnwidth += 26;
|
||||
// let Selection = CreateDiv("triangle-icon");
|
||||
let submenu2 = createEl("div");
|
||||
submenu2.addClass("subitem");
|
||||
// console.log(btnwidth,item.name)
|
||||
if (submenu2) {
|
||||
submenu2.innerHTML = backcolorpicker;
|
||||
|
||||
button2.buttonEl.insertAdjacentElement("afterbegin", submenu2);
|
||||
if (plugin.settings.cMenuBackgroundColor)
|
||||
activeDocument.getElementById(
|
||||
"change-background-color-icon"
|
||||
).style.fill = plugin.settings.cMenuBackgroundColor;
|
||||
tabCell(app, plugin, "x-backgroundcolor-picker-table");
|
||||
let el = submenu2.querySelector(
|
||||
".x-color-picker-wrapper"
|
||||
) as HTMLElement;
|
||||
|
||||
let button3 = new ButtonComponent(el);
|
||||
button3
|
||||
.setIcon("remix-Brush2Line")
|
||||
.setTooltip(t("Format Brush"))
|
||||
.onClick(() => {
|
||||
QuiteFormatBrushes();
|
||||
window.isBgC = true;
|
||||
window.newNotice = new Notice(
|
||||
t("Background-color formatting brush ON!"),
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let button;
|
||||
if (btnwidth >= leafwidth - 26 * 4 && leafwidth > 100) {
|
||||
//说明已经溢出
|
||||
window.ISMORE = true; //需要添加更多按钮
|
||||
button = new ButtonComponent(cMenuToolbarPopoverBar);
|
||||
} else button = new ButtonComponent(cMenuToolbar);
|
||||
button.setTooltip(item.name).onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
|
||||
button.setClass("cMenuToolbarCommandItem");
|
||||
if (item.id == "cMenuToolbar-Divider-Line")
|
||||
button.setClass("cMenuToolbar-Divider-Line");
|
||||
checksvg(item.icon)
|
||||
? (button.buttonEl.innerHTML = item.icon)
|
||||
: button.setIcon(item.icon);
|
||||
let __btnwidth2;
|
||||
if (button.buttonEl.offsetWidth > 100) __btnwidth2 = 26;
|
||||
else {
|
||||
if (button.buttonEl.offsetWidth < 26) __btnwidth2 = 26;
|
||||
else __btnwidth2 = button.buttonEl.offsetWidth;
|
||||
}
|
||||
|
||||
btnwidth += __btnwidth2;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
CreateMoreMenu(cMenuToolbar);
|
||||
if (Math.abs(plugin.settings.cMenuWidth - Number(btnwidth)) > 30) {
|
||||
plugin.settings.cMenuWidth = Number(btnwidth);
|
||||
setTimeout(() => {
|
||||
plugin.saveSettings();
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
let Markdown = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (Markdown) {
|
||||
let currentnode = activeDocument.getElementById("cMenuToolbarModalBar");
|
||||
if (settings.positionStyle == "top") {
|
||||
if (!getModestate(app)) return;
|
||||
let activeleaf = activeDocument.body.querySelector(
|
||||
".workspace-leaf.mod-active"
|
||||
);
|
||||
if (activeleaf)
|
||||
if (currentnode) {
|
||||
if (!activeleaf.querySelector("#cMenuToolbarModalBar")) {
|
||||
selfDestruct();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (currentnode) return;
|
||||
}
|
||||
generateMenu();
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
setBottomValue(settings);
|
||||
|
||||
settings.cMenuVisibility == false
|
||||
? (cMenuToolbarModalBar.style.visibility = "hidden")
|
||||
: settings.positionStyle == "following" ?
|
||||
(cMenuToolbarModalBar?.style.visibility = "hidden") : (cMenuToolbarModalBar?.style.visibility = "visible");
|
||||
} else {
|
||||
selfDestruct();
|
||||
}
|
||||
|
||||
}
|
||||
createMenu();
|
||||
}
|
@ -1,256 +0,0 @@
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { appIcons } from "src/icons/appIcons";
|
||||
import { Notice, Command, setIcon, FuzzyMatch, FuzzySuggestModal, Modal, SliderComponent, TextAreaComponent, TextComponent, debounce, App } from "obsidian";
|
||||
import { findmenuID } from "src/util/util";
|
||||
import { setBottomValue } from "src/util/statusBarConstants";
|
||||
import { t } from "src/translations/helper";
|
||||
|
||||
export class ChooseFromIconList extends FuzzySuggestModal<string> {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
command: Command;
|
||||
issub: boolean;
|
||||
|
||||
constructor(plugin: cMenuToolbarPlugin, command: Command, issub: boolean = false) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.command = command;
|
||||
this.issub = issub;
|
||||
this.setPlaceholder("Choose an icon");
|
||||
}
|
||||
|
||||
private capitalJoin(string: string): string {
|
||||
const icon = string.split(" ");
|
||||
|
||||
return icon
|
||||
.map((icon) => {
|
||||
return icon[0].toUpperCase() + icon.substring(1);
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
|
||||
getItems(): string[] {
|
||||
return appIcons;
|
||||
}
|
||||
|
||||
getItemText(item: string): string {
|
||||
return this.capitalJoin(
|
||||
item
|
||||
.replace("feather-", "")
|
||||
.replace("remix-", "")
|
||||
.replace("bx-", "")
|
||||
.replace(/([A-Z])/g, " $1")
|
||||
.trim()
|
||||
.replace(/-/gi, " ")
|
||||
);
|
||||
}
|
||||
|
||||
renderSuggestion(icon: FuzzyMatch<string>, iconItem: HTMLElement): void {
|
||||
const span = createSpan({ cls: "cMenuToolbarIconPick" });
|
||||
iconItem.appendChild(span);
|
||||
setIcon(span, icon.item);
|
||||
super.renderSuggestion(icon, iconItem);
|
||||
}
|
||||
|
||||
async onChooseItem(item: string): Promise<void> {
|
||||
if (item === "Custom") {
|
||||
new CustomIcon(this.app, this.plugin, this.command, this.issub).open();
|
||||
} else {
|
||||
if (this.command.icon) //存在就修改不存在新增
|
||||
{
|
||||
let menuID = findmenuID(this.plugin, this.command, this.issub)
|
||||
// console.log(menuID);
|
||||
this.issub ? this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[menuID['subindex']].icon = item : this.plugin.settings.menuCommands[menuID['index']].icon = item;
|
||||
} else {
|
||||
this.command.icon = item;
|
||||
this.plugin.settings.menuCommands.push(this.command);
|
||||
}
|
||||
|
||||
await this.plugin.saveSettings();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(
|
||||
`%cCommand '${this.command.name}' was added to cMenuToolbar`,
|
||||
"color: Violet"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CommandPicker extends FuzzySuggestModal<Command> {
|
||||
command: Command;
|
||||
|
||||
constructor(private plugin: cMenuToolbarPlugin) {
|
||||
super(plugin.app);
|
||||
this.app;
|
||||
this.setPlaceholder("Choose a command");
|
||||
}
|
||||
|
||||
getItems(): Command[] {
|
||||
//@ts-ignore
|
||||
return app.commands.listCommands();
|
||||
}
|
||||
|
||||
getItemText(item: Command): string {
|
||||
return item.name;
|
||||
}
|
||||
|
||||
async onChooseItem(item: Command): Promise<void> {
|
||||
let index = this.plugin.settings.menuCommands.findIndex((v) => v.id == item.id);
|
||||
// console.log(index)
|
||||
|
||||
if (index > -1) //存在
|
||||
{
|
||||
new Notice("The command" + item.name + "already exists", 3000);
|
||||
// console.log(`%cCommand '${item.name}' already exists `, "color: Violet");
|
||||
return;
|
||||
} else {
|
||||
if (item.icon) {
|
||||
this.plugin.settings.menuCommands.push(item);
|
||||
await this.plugin.saveSettings();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(
|
||||
`%cCommand '${item.name}' was added to cMenuToolbar`,
|
||||
"color: Violet"
|
||||
);
|
||||
} else {
|
||||
new ChooseFromIconList(this.plugin, item, false).open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CustomIcon extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
item: Command;
|
||||
issub: boolean;
|
||||
submitEnterCallback: (this: HTMLTextAreaElement, ev: KeyboardEvent) => any;
|
||||
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin, item: Command, issub: boolean) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.item = item;
|
||||
this.issub = issub;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
this.containerEl.addClass("customicon");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("b", { text: t("Enter the icon code, it looks like <svg>.... </svg> format") });
|
||||
const textComponent = new TextAreaComponent(contentEl);
|
||||
textComponent.inputEl.classList.add('wideInputPromptInputEl');
|
||||
textComponent.setPlaceholder("")
|
||||
.setValue(this.item.icon ?? '')
|
||||
.onChange(debounce(async (value: string) => {
|
||||
|
||||
this.item.icon = value;
|
||||
let menuID = findmenuID(this.plugin, this.item, this.issub)
|
||||
if (!this.issub) //不是子项
|
||||
{
|
||||
let index = menuID['index']
|
||||
index === -1 ? this.plugin.settings.menuCommands.push(this.item) :
|
||||
(this.plugin.settings.menuCommands[index].icon = this.item.icon);
|
||||
|
||||
} else {
|
||||
let subindex = menuID['subindex']
|
||||
subindex === -1 ? this.plugin.settings.menuCommands[menuID["index"]].SubmenuCommands.push(this.item) : this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[subindex].icon = value
|
||||
|
||||
}
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true)
|
||||
)
|
||||
.inputEl.addEventListener('keydown', this.submitEnterCallback);
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export class ChangeCmdname extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
item: Command;
|
||||
issub: boolean;
|
||||
submitEnterCallback: (this: HTMLInputElement, ev: KeyboardEvent) => any;
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin, item: Command, issub: boolean) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.item = item;
|
||||
this.issub = issub;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
this.containerEl.addClass("changename");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("b", { text: t("Please enter a new name:") });
|
||||
|
||||
const textComponent = new TextComponent(contentEl);
|
||||
textComponent.inputEl.classList.add('InputPromptInputEl');
|
||||
textComponent.setPlaceholder("")
|
||||
.setValue(this.item.name ?? '')
|
||||
.onChange(debounce(async (value) => {
|
||||
|
||||
let menuID = findmenuID(this.plugin, this.item, this.issub)
|
||||
this.item.name = value;
|
||||
if (!this.issub) //不是子项
|
||||
{
|
||||
let index = menuID['index']
|
||||
// console.log(index,"index")
|
||||
index === -1 ? this.plugin.settings.menuCommands.push(this.item) :
|
||||
(this.plugin.settings.menuCommands[index].name = this.item.name);
|
||||
|
||||
} else {
|
||||
let subindex = menuID['subindex']
|
||||
subindex === -1 ? this.plugin.settings.menuCommands[menuID["index"]].SubmenuCommands.push(this.item) : this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[subindex].name = value
|
||||
|
||||
}
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true))
|
||||
.inputEl.addEventListener('keydown', this.submitEnterCallback);
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
export class openSlider extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("p", { text:t("Drag the slider to move the position") });
|
||||
|
||||
new SliderComponent(contentEl)
|
||||
.setLimits(2, 18, 0.25)
|
||||
.setValue(this.plugin.settings.cMenuBottomValue)
|
||||
.onChange(debounce(async (value) => {
|
||||
console.log(`%c${value}em`, "color: Violet");
|
||||
this.plugin.settings.cMenuBottomValue = value;
|
||||
setBottomValue(this.plugin.settings);
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true))
|
||||
.setDynamicTooltip();
|
||||
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
}
|
||||
};
|
@ -1,741 +0,0 @@
|
||||
import {
|
||||
Menu,
|
||||
Plugin,
|
||||
Notice,
|
||||
Command,
|
||||
setIcon,
|
||||
debounce,
|
||||
Editor,
|
||||
MarkdownView,
|
||||
SliderComponent,
|
||||
ToggleComponent,
|
||||
ButtonComponent,
|
||||
requireApiVersion,
|
||||
App,
|
||||
} from "obsidian";
|
||||
import { wait } from "src/util/util";
|
||||
import { appIcons } from "src/icons/appIcons";
|
||||
import { CommandPicker, openSlider } from "src/modals/suggesterModals";
|
||||
import { cMenuToolbarSettingTab } from "src/settings/settingsTab";
|
||||
import { selfDestruct, cMenuToolbarPopover, getModestate, QuiteFormatBrushes, Setfontcolor, Setbackgroundcolor, SetHeader, followingbar, FormatEraser } from "src/modals/cMenuToolbarModal";
|
||||
import { cMenuToolbarSettings, DEFAULT_SETTINGS } from "src/settings/settingsData";
|
||||
import addIcons, {
|
||||
addFeatherIcons,
|
||||
addRemixIcons
|
||||
// addBoxIcons
|
||||
} from "src/icons/customIcons";
|
||||
|
||||
import { setMenuVisibility, setBottomValue } from "src/util/statusBarConstants";
|
||||
import { fullscreenMode, workplacefullscreenMode } from "src/util/fullscreen";
|
||||
import { t } from "src/translations/helper";
|
||||
|
||||
let activeDocument: Document;
|
||||
|
||||
export default class cMenuToolbarPlugin extends Plugin {
|
||||
app: App;
|
||||
settings: cMenuToolbarSettings;
|
||||
statusBarIcon: HTMLElement;
|
||||
cMenuToolbar: HTMLElement;
|
||||
modCommands: Command[] = [
|
||||
{
|
||||
id: "editor:insert-embed",
|
||||
name: "Add embed",
|
||||
icon: "note-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-link",
|
||||
name: "Insert markdown link",
|
||||
icon: "link-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-tag",
|
||||
name: "Add tag",
|
||||
icon: "price-tag-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-wikilink",
|
||||
name: "Add internal link",
|
||||
icon: "bracket-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-bold",
|
||||
name: "Toggle bold",
|
||||
icon: "bold-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-italics",
|
||||
name: "Toggle italics",
|
||||
icon: "italic-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-strikethrough",
|
||||
name: "Toggle strikethrough",
|
||||
icon: "strikethrough-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-code",
|
||||
name: "Toggle code",
|
||||
icon: "code-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-blockquote",
|
||||
name: "Toggle blockquote",
|
||||
icon: "quote-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-bullet-list",
|
||||
name: "Toggle bullet",
|
||||
icon: "bullet-list-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-checklist-status",
|
||||
name: "Toggle checklist status",
|
||||
icon: "checkbox-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-comments",
|
||||
name: "Toggle comment",
|
||||
icon: "percent-sign-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-highlight",
|
||||
name: "Toggle highlight",
|
||||
icon: "highlight-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-numbered-list",
|
||||
name: "Toggle numbered list",
|
||||
icon: "number-list-glyph",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
async onload(): Promise<void> {
|
||||
console.log("cMenuToolbar v" + this.manifest.version + " loaded");
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
await this.loadSettings();
|
||||
addIcons();
|
||||
addFeatherIcons(appIcons);
|
||||
addRemixIcons(appIcons);
|
||||
//addBoxIcons(appIcons);
|
||||
this.generateCommands();
|
||||
this.app.workspace.onLayoutReady(() => {
|
||||
setTimeout(() => {
|
||||
this.setupStatusBar();
|
||||
});
|
||||
});
|
||||
this.registerDomEvent(activeDocument, "mouseup", async (e) => {
|
||||
if (e.button) {
|
||||
if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
}
|
||||
}
|
||||
let view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (!view) { return; };
|
||||
|
||||
//let cmEditor = view.sourceMode.cmEditor;
|
||||
let cmEditor = view.editor;
|
||||
if (cmEditor.hasFocus()) {
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
if (cmEditor.getSelection() == null || cmEditor.getSelection() == "") {
|
||||
this.settings.positionStyle == "following"?cMenuToolbarModalBar.style.visibility = "hidden":true;
|
||||
return
|
||||
} else {
|
||||
if (window.isCTxt) {
|
||||
Setfontcolor(app, this.settings.cMenuFontColor);
|
||||
} else if (window.isBgC) {
|
||||
Setbackgroundcolor(app, this.settings.cMenuBackgroundColor);
|
||||
} else if (window.isText) {
|
||||
FormatEraser();
|
||||
} else if (this.settings.positionStyle == "following") {
|
||||
this.registerDomEvent(activeDocument, "keydown", async (e) => {
|
||||
if (cMenuToolbarModalBar)
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
})
|
||||
|
||||
followingbar(this.settings)
|
||||
}
|
||||
}
|
||||
} else if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
|
||||
}
|
||||
});
|
||||
if (requireApiVersion("0.15.0")) {
|
||||
this.app.workspace.on('window-open', (leaf) => {
|
||||
this.registerDomEvent(leaf.doc, 'mouseup', (e) => {
|
||||
if (e.button) {
|
||||
if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
}
|
||||
}
|
||||
|
||||
let view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (!view) { return; };
|
||||
//let cmEditor = view.sourceMode.cmEditor;
|
||||
let cmEditor = view.editor;
|
||||
if (cmEditor.hasFocus()) {
|
||||
if (this.settings.positionStyle == "following")
|
||||
followingbar(this.settings)
|
||||
else
|
||||
if (cmEditor.getSelection() == null || cmEditor.getSelection() == "") {
|
||||
return
|
||||
} else {
|
||||
if (window.isCTxt) {
|
||||
Setfontcolor(app, this.settings.cMenuFontColor);
|
||||
} else if (window.isBgC) {
|
||||
Setbackgroundcolor(app, this.settings.cMenuBackgroundColor);
|
||||
} else if (window.isText) {
|
||||
FormatEraser();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
this.addSettingTab(new cMenuToolbarSettingTab(this.app, this));
|
||||
this.registerEvent(this.app.workspace.on("active-leaf-change", this.handlecMenuToolbar));
|
||||
this.registerEvent(this.app.workspace.on("window-open", this.handlecMenuToolbar_pop));
|
||||
this.registerEvent(this.app.workspace.on("layout-change", this.handlecMenuToolbar_layout));
|
||||
this.registerEvent(this.app.workspace.on("resize", this.handlecMenuToolbar_resize));
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
|
||||
|
||||
}
|
||||
|
||||
generateCommands() {
|
||||
//Hide-show menu
|
||||
this.addCommand({
|
||||
id: "hide-show-menu",
|
||||
name: "Hide/show ",
|
||||
icon: "cMenuToolbar",
|
||||
callback: async () => {
|
||||
this.settings.cMenuVisibility = !this.settings.cMenuVisibility;
|
||||
this.settings.cMenuVisibility == true
|
||||
? setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
: setMenuVisibility(this.settings.cMenuVisibility);
|
||||
selfDestruct();
|
||||
await this.saveSettings();
|
||||
},
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'format-eraser',
|
||||
name: 'Format Eraser',
|
||||
callback: () => FormatEraser(),
|
||||
icon: `<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z\"></path></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'change-font-color',
|
||||
name: 'Change font color[html]',
|
||||
callback: () => Setfontcolor(app, this.settings.cMenuFontColor ?? "#2DC26B"),
|
||||
icon: `<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'change-background-color',
|
||||
name: 'Change Backgroundcolor[html]',
|
||||
callback: () => Setbackgroundcolor(app, this.settings.cMenuBackgroundColor ?? "#FA541C"),
|
||||
icon: `<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'indent-list',
|
||||
name: 'indent list',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
//@ts-ignore
|
||||
return editor.indentList();
|
||||
},
|
||||
icon: "indent-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'undent-list',
|
||||
name: 'unindent-list',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
//@ts-ignore
|
||||
return editor.unindentList();
|
||||
},
|
||||
icon: "unindent-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'editor-undo',
|
||||
name: 'undo editor',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
return editor.undo();
|
||||
},
|
||||
icon: "undo-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'editor-redo',
|
||||
name: 'redo editor',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
return editor.redo();
|
||||
},
|
||||
icon: "redo-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: "fullscreen-focus",
|
||||
name: "Fullscreen focus mode",
|
||||
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "F11" }],
|
||||
callback: () => {
|
||||
return fullscreenMode(app)
|
||||
},
|
||||
icon: "fullscreen"
|
||||
});
|
||||
this.addCommand({
|
||||
id: "workplace-fullscreen-focus",
|
||||
name: "workplace-Fullscreen ",
|
||||
callback: () => {
|
||||
return workplacefullscreenMode(app)
|
||||
},
|
||||
hotkeys: [{ modifiers: ['Mod'], key: "F11" }],
|
||||
icon: "remix-SplitCellsHorizontal"
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: 'header0-text',
|
||||
name: 'Remove header level',
|
||||
callback: () => SetHeader(""),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "`" }],
|
||||
icon: "feather-file-text"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header1-text',
|
||||
name: 'Header 1',
|
||||
callback: () => SetHeader("#"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "1" }],
|
||||
icon: "header-1"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header2-text',
|
||||
name: 'Header 2',
|
||||
callback: () => SetHeader("##"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "2" }],
|
||||
icon: "header-2"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header3-text',
|
||||
name: 'Header 3',
|
||||
callback: () => SetHeader("###"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "3" }],
|
||||
icon: "header-3"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header4-text',
|
||||
name: 'Header 4',
|
||||
callback: () => SetHeader("####"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "4" }],
|
||||
icon: "header-4"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header5-text',
|
||||
name: 'Header 5',
|
||||
callback: () => SetHeader("#####"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "5" }],
|
||||
icon: "header-5"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header6-text',
|
||||
name: 'Header 6',
|
||||
callback: () => SetHeader("######"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "6" }],
|
||||
icon: "header-6"
|
||||
});
|
||||
|
||||
|
||||
const applyCommand = (command: commandPlot, editor: Editor) => {
|
||||
const selectedText = editor.getSelection();
|
||||
const curserStart = editor.getCursor("from");
|
||||
const curserEnd = editor.getCursor("to");
|
||||
let prefix = command.prefix;
|
||||
if (command.islinehead && curserStart.ch > 0) // cursor position is not line head
|
||||
prefix = '\n' + prefix
|
||||
const suffix = command.suffix || prefix;
|
||||
const setCursor = (mode: number) => {
|
||||
editor.setCursor(
|
||||
curserStart.line + command.line * mode,
|
||||
curserEnd.ch + command.char * mode
|
||||
);
|
||||
};
|
||||
const preStart = {
|
||||
line: curserStart.line - command.line,
|
||||
ch: curserStart.ch - prefix.length,
|
||||
};
|
||||
const pre = editor.getRange(preStart, curserStart);
|
||||
|
||||
if (pre == prefix.trimStart()) {
|
||||
const sufEnd = {
|
||||
line: curserStart.line + command.line,
|
||||
ch: curserEnd.ch + suffix.length,
|
||||
};
|
||||
const suf = editor.getRange(curserEnd, sufEnd);
|
||||
if (suf == suffix.trimEnd()) {
|
||||
editor.replaceRange(selectedText, preStart, sufEnd); // codeblock leave blank lines
|
||||
return setCursor(-1);
|
||||
}
|
||||
}
|
||||
editor.replaceSelection(`${prefix}${selectedText}${suffix}`);
|
||||
return setCursor(1);
|
||||
};
|
||||
|
||||
type commandPlot = {
|
||||
char: number;
|
||||
line: number;
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
islinehead: boolean;
|
||||
};
|
||||
|
||||
type commandsPlot = {
|
||||
[key: string]: commandPlot;
|
||||
};
|
||||
|
||||
const commandsMap: commandsPlot = {
|
||||
hrline: {
|
||||
char: 5,
|
||||
line: 1,
|
||||
prefix: "\n---",
|
||||
suffix: "\n",
|
||||
islinehead: true
|
||||
},
|
||||
justify: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"justify\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
left: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"left\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
right: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"right\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
center: {
|
||||
char: 8,
|
||||
line: 0,
|
||||
prefix: "<center>",
|
||||
suffix: "</center>",
|
||||
islinehead: false,
|
||||
},
|
||||
underline: {
|
||||
char: 3,
|
||||
line: 0,
|
||||
prefix: "<u>",
|
||||
suffix: "</u>",
|
||||
islinehead: false,
|
||||
},
|
||||
superscript: {
|
||||
char: 5,
|
||||
line: 0,
|
||||
prefix: "<sup>",
|
||||
suffix: "</sup>",
|
||||
islinehead: false,
|
||||
},
|
||||
subscript: {
|
||||
char: 5,
|
||||
line: 0,
|
||||
prefix: "<sub>",
|
||||
suffix: "</sub>",
|
||||
islinehead: false,
|
||||
},
|
||||
codeblock: {
|
||||
char: 5,
|
||||
line: 1,
|
||||
prefix: "\n```\n",
|
||||
suffix: "\n```\n",
|
||||
islinehead: false,
|
||||
},
|
||||
};
|
||||
// Add new commands
|
||||
Object.keys(commandsMap).forEach((type) => {
|
||||
this.addCommand({
|
||||
id: `${type}`,
|
||||
name: `Toggle ${type}`,
|
||||
icon: `${type}-glyph`,
|
||||
callback: async () => {
|
||||
const activeLeaf =
|
||||
this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
applyCommand(commandsMap[type], editor);
|
||||
await wait(10);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
// Enhance editor commands
|
||||
this.modCommands.forEach((type) => {
|
||||
this.addCommand({
|
||||
id: `${type["id"]}`,
|
||||
name: `${type["name"]}`,
|
||||
icon: `${type["icon"]}`,
|
||||
callback: async () => {
|
||||
const activeLeaf =
|
||||
this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
editor.getCursor("from");
|
||||
const curserEnd = editor.getCursor("to");
|
||||
let char;
|
||||
`${type["id"]}` == "editor:insert-embed"
|
||||
? (char = 3)
|
||||
: `${type["id"]}` == "editor:insert-link"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:insert-tag"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:insert-wikilink"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-bold"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-italics"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:toggle-strikethrough"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-code"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:toggle-blockquote"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-bullet-list"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-checklist-status"
|
||||
? (char = 4)
|
||||
: `${type["id"]}` == "editor:toggle-comments"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-highlight"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-numbered-list"
|
||||
? (char = 3)
|
||||
: (char = 2);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(`${type["id"]}`);
|
||||
editor.setCursor(curserEnd.line, curserEnd.ch + char);
|
||||
await wait(10);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setupStatusBar() {
|
||||
addIcons();
|
||||
this.statusBarIcon = this.addStatusBarItem();
|
||||
this.statusBarIcon.addClass("cMenuToolbar-statusbar-button");
|
||||
setIcon(this.statusBarIcon, "cMenuToolbar");
|
||||
|
||||
this.registerDomEvent(this.statusBarIcon, "click", () => {
|
||||
const statusBarRect =
|
||||
this.statusBarIcon.parentElement.getBoundingClientRect();
|
||||
const statusBarIconRect = this.statusBarIcon.getBoundingClientRect();
|
||||
|
||||
const menu = new Menu().addItem((item) => {
|
||||
item.setTitle(t("Hide & Show"));
|
||||
requireApiVersion("0.15.0")?item.setSection("settings"):true;
|
||||
const itemDom = (item as any).dom as HTMLElement;
|
||||
const toggleComponent = new ToggleComponent(itemDom)
|
||||
.setValue(this.settings.cMenuVisibility)
|
||||
.setDisabled(true);
|
||||
|
||||
const toggle = async () => {
|
||||
this.settings.cMenuVisibility = !this.settings.cMenuVisibility;
|
||||
toggleComponent.setValue(this.settings.cMenuVisibility);
|
||||
this.settings.cMenuVisibility == true
|
||||
? setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
: setMenuVisibility(this.settings.cMenuVisibility);
|
||||
selfDestruct();
|
||||
await this.saveSettings();
|
||||
};
|
||||
|
||||
item.onClick((e) => {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
toggle();
|
||||
});
|
||||
});
|
||||
|
||||
const menuDom = (menu as any).dom as HTMLElement;
|
||||
menuDom.addClass("cMenuToolbar-statusbar-menu");
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("cMenuToolbarAdd");
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
item.onClick(() => {
|
||||
new CommandPicker(this).open();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("cMenuToolbarReload");
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
|
||||
item.onClick(() => {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%ccMenuToolbar refreshed`, "color: Violet");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("sliders")
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
item.onClick(() => {
|
||||
|
||||
new openSlider(this.app, this).open();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
menu.showAtPosition({
|
||||
x: statusBarIconRect.right + 5,
|
||||
y: statusBarRect.top - 5,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onunload(): void {
|
||||
selfDestruct();
|
||||
console.log("cMenuToolbar unloaded");
|
||||
this.app.workspace.off("active-leaf-change", this.handlecMenuToolbar);
|
||||
this.app.workspace.off("window-open", this.handlecMenuToolbar_pop);
|
||||
this.app.workspace.off("layout-change", this.handlecMenuToolbar_layout);
|
||||
this.app.workspace.off("resize", this.handlecMenuToolbar_resize);
|
||||
}
|
||||
|
||||
|
||||
handlecMenuToolbar = () => {
|
||||
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
|
||||
cMenuToolbarPopover(this.app, this)
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
handlecMenuToolbar_pop = () => {
|
||||
|
||||
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
setTimeout(() => {
|
||||
selfDestruct();
|
||||
cMenuToolbarPopover(this.app, this)
|
||||
}, 400);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
handlecMenuToolbar_layout = () => {
|
||||
let isource = getModestate(app);
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
if (!getModestate(app)) //no source mode
|
||||
{
|
||||
if (cMenuToolbarModalBar) {
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cMenuToolbarModalBar) {
|
||||
cMenuToolbarModalBar.style.visibility = "visibility"
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
handlecMenuToolbar_resize = () => {
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
if (getModestate(app)) {
|
||||
let currentleaf = activeDocument.body
|
||||
?.querySelector(".workspace-leaf.mod-active");
|
||||
|
||||
let leafwidth = currentleaf?.querySelector<HTMLElement>(".markdown-source-view").offsetWidth ?? 0
|
||||
|
||||
if (this.settings.cMenuWidth && leafwidth) {
|
||||
if ((leafwidth - this.settings.cMenuWidth) < 78 && (leafwidth > this.settings.cMenuWidth))
|
||||
return;
|
||||
else {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
|
||||
}
|
||||
|
||||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
}
|
@ -1,219 +0,0 @@
|
||||
import type { Command } from "obsidian";
|
||||
export const APPEND_METHODS = ["body", "workspace"];
|
||||
export const AESTHETIC_STYLES = ["glass", "default", "tiny"];
|
||||
export const POSITION_STYLES = ["fixed", "following", "top"];
|
||||
|
||||
|
||||
|
||||
declare module 'obsidian' {
|
||||
export interface Command {
|
||||
SubmenuCommands?: Command[];
|
||||
}
|
||||
}
|
||||
export interface cMenuToolbarSettings {
|
||||
cMenuWidth: number;
|
||||
cMenuFontColor: string;
|
||||
cMenuBackgroundColor: string;
|
||||
aestheticStyle: string;
|
||||
positionStyle: string;
|
||||
menuCommands: Command[];
|
||||
appendMethod: string;
|
||||
shouldShowMenuOnSelect: boolean;
|
||||
cMenuVisibility: boolean;
|
||||
cMenuBottomValue: number;
|
||||
cMenuNumRows: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: cMenuToolbarSettings = {
|
||||
aestheticStyle: "default",
|
||||
positionStyle: "top",
|
||||
menuCommands: [
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:editor-undo',
|
||||
name: 'undo editor',
|
||||
icon: "undo-glyph"
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:editor-redo',
|
||||
name: 'redo editor',
|
||||
icon: "redo-glyph"
|
||||
},
|
||||
{
|
||||
"id": "obsidian-editing-toolbar:format-eraser",
|
||||
"name": "Clear text formatting",
|
||||
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z\"></path></g></svg>"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header2-text",
|
||||
name: "Header 2",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "2"
|
||||
}
|
||||
],
|
||||
icon: "header-2"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header3-text",
|
||||
name: "Header 3",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "3"
|
||||
}
|
||||
],
|
||||
icon: "header-3"
|
||||
},
|
||||
{
|
||||
id: "SubmenuCommands-header",
|
||||
name: "submenu",
|
||||
icon: "header-n",
|
||||
SubmenuCommands: [
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header1-text",
|
||||
name: "Header 1",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "1"
|
||||
}
|
||||
],
|
||||
icon: "header-1"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header4-text",
|
||||
name: "Header 4",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "4"
|
||||
}
|
||||
],
|
||||
icon: "header-4"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header5-text",
|
||||
name: "Header 5",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "5"
|
||||
}
|
||||
],
|
||||
icon: "header-5"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header6-text",
|
||||
name: "Header 6",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "6"
|
||||
}
|
||||
],
|
||||
icon: "header-6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-bold",
|
||||
name: "Toggle bold",
|
||||
icon: "bold-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-italics",
|
||||
name: "Toggle italics",
|
||||
icon: "italic-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-strikethrough",
|
||||
name: "Toggle strikethrough",
|
||||
icon: "strikethrough-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:underline",
|
||||
name: "Toggle underline",
|
||||
icon: "underline-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:superscript",
|
||||
name: "Toggle superscript",
|
||||
icon: "superscript-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:subscript",
|
||||
name: "Toggle subscript",
|
||||
icon: "subscript-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-code",
|
||||
name: "Toggle code",
|
||||
icon: "code-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:codeblock",
|
||||
name: "Toggle codeblock",
|
||||
icon: "codeblock-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-blockquote",
|
||||
name: "Toggle blockquote",
|
||||
icon: "quote-glyph",
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:indent-list',
|
||||
name: 'indent list',
|
||||
icon: "indent-glyph"
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:undent-list',
|
||||
name: 'unindent-list',
|
||||
icon: "unindent-glyph"
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:change-font-color',
|
||||
name: 'Change font color[html]',
|
||||
icon: `<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>`
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:change-background-color',
|
||||
name: 'Change Backgroundcolor[html]',
|
||||
icon: `<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>`
|
||||
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:fullscreen-focus",
|
||||
name: "Fullscreen focus mode",
|
||||
icon: "fullscreen"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:workplace-fullscreen-focus",
|
||||
name: "workplace-Fullscreen ",
|
||||
icon: "remix-SplitCellsHorizontal"
|
||||
},
|
||||
],
|
||||
appendMethod: "workspace",
|
||||
shouldShowMenuOnSelect: false,
|
||||
cMenuVisibility: true,
|
||||
cMenuBottomValue: 4.25,
|
||||
cMenuNumRows: 12,
|
||||
cMenuWidth: 300,
|
||||
cMenuFontColor: "#2DC26B",
|
||||
cMenuBackgroundColor: "#d3f8b6"
|
||||
};
|
@ -1,466 +0,0 @@
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { CommandPicker,ChooseFromIconList, ChangeCmdname } from "src/modals/suggesterModals";
|
||||
import { App, Setting, PluginSettingTab, Command } from "obsidian";
|
||||
import { APPEND_METHODS, AESTHETIC_STYLES, POSITION_STYLES } from "src/settings/settingsData";
|
||||
import { selfDestruct, cMenuToolbarPopover, checksvg } from "src/modals/cMenuToolbarModal";
|
||||
import Sortable from "sortablejs";
|
||||
import { debounce } from "obsidian";
|
||||
import { GenNonDuplicateID } from "src/util/util";
|
||||
import { t } from 'src/translations/helper';
|
||||
|
||||
export function getComandindex(item: any,arr: any[]):number
|
||||
{
|
||||
let idx;
|
||||
arr.forEach((el,index) => {
|
||||
if (el.id === item) {
|
||||
idx =index;
|
||||
}
|
||||
});
|
||||
return idx;
|
||||
}
|
||||
|
||||
export class cMenuToolbarSettingTab extends PluginSettingTab {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
appendMethod: string;
|
||||
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
addEventListener("cMenuToolbar-NewCommand", () => {
|
||||
selfDestruct();
|
||||
cMenuToolbarPopover(app, this.plugin);
|
||||
this.display();
|
||||
});
|
||||
}
|
||||
|
||||
display(): void {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h1", { text: "Obsidian Editing Toolbar" });
|
||||
containerEl.createEl("span", { text: " 原创: " }).createEl("a", {
|
||||
text: "Chetachi 👩🏽💻",
|
||||
href: "https://github.com/chetachiezikeuzor",
|
||||
});
|
||||
containerEl.createEl("span", { text: " 修改者: " }).createEl("a", {
|
||||
text: "Cuman ✨",
|
||||
href: "https://github.com/cumany",
|
||||
});
|
||||
containerEl.createEl("h2", { text: t("Plugin Settings") });
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar append method'))
|
||||
.setDesc(
|
||||
t('Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let methods: Record<string, string> = {};
|
||||
APPEND_METHODS.map((method) => (methods[method] = method));
|
||||
dropdown.addOptions(methods);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.appendMethod)
|
||||
.onChange((appendMethod) => {
|
||||
this.plugin.settings.appendMethod = appendMethod;
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar aesthetic')
|
||||
)
|
||||
.setDesc(
|
||||
t('Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let aesthetics: Record<string, string> = {};
|
||||
AESTHETIC_STYLES.map(
|
||||
(aesthetic) => (aesthetics[aesthetic] = aesthetic)
|
||||
);
|
||||
dropdown.addOptions(aesthetics);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.aestheticStyle)
|
||||
.onChange((aestheticStyle: string) => {
|
||||
this.plugin.settings.aestheticStyle = aestheticStyle;
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar position')
|
||||
)
|
||||
.setDesc(t('Choose between fixed position or cursor following mode.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let posotions: Record<string, string> = {};
|
||||
POSITION_STYLES.map((posotion: string) => (posotions[posotion] = posotion));
|
||||
dropdown.addOptions(posotions);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.positionStyle)
|
||||
.onChange((positionStyle: string) => {
|
||||
this.plugin.settings.positionStyle = positionStyle;
|
||||
this.plugin.saveSettings();
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar columns')
|
||||
)
|
||||
.setDesc(
|
||||
t('Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addSlider((slider) => {
|
||||
slider
|
||||
.setLimits(1, 32, 1)
|
||||
.setValue(this.plugin.settings.cMenuNumRows)
|
||||
.onChange(
|
||||
debounce(
|
||||
async (value: number) => {
|
||||
this.plugin.settings.cMenuNumRows = value;
|
||||
await this.plugin.saveSettings();
|
||||
},
|
||||
100,
|
||||
true
|
||||
)
|
||||
)
|
||||
.setDynamicTooltip();
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar refresh')
|
||||
)
|
||||
.setDesc(
|
||||
t("Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.")
|
||||
)
|
||||
.addButton((reloadButton) => {
|
||||
reloadButton
|
||||
.setIcon("cMenuToolbarReload")
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonRefresh")
|
||||
.setTooltip(t("Refresh"))
|
||||
.onClick(() => {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%ccMenuToolbar refreshed`, "color: Violet");
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar commands')
|
||||
)
|
||||
.setDesc(
|
||||
t("Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.")
|
||||
)
|
||||
.addButton((addButton) => {
|
||||
addButton
|
||||
.setIcon("cMenuToolbarAdd")
|
||||
.setTooltip(t("Add"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonAdd")
|
||||
.onClick(() => {
|
||||
new CommandPicker(this.plugin).open();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
const cMenuToolbarCommandsContainer = containerEl.createEl("div", {
|
||||
cls: "cMenuToolbarSettingsTabsContainer",
|
||||
});
|
||||
let dragele = "";
|
||||
Sortable.create(cMenuToolbarCommandsContainer, {
|
||||
group: "item",
|
||||
animation: 500,
|
||||
draggable: ".setting-item",
|
||||
ghostClass: "sortable-ghost",
|
||||
chosenClass: "sortable-chosen",
|
||||
dragClass: "sortable-drag",
|
||||
dragoverBubble: false,
|
||||
forceFallback: true,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.7,
|
||||
fallbackClass: "sortable-fallback",
|
||||
easing: "cubic-bezier(1, 0, 0, 1)",
|
||||
onSort: (command) => {
|
||||
if (command.from.className === command.to.className) {
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
const [removed] = arrayResult.splice(command.oldIndex, 1)
|
||||
arrayResult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 300);
|
||||
},
|
||||
onStart: function (evt) {
|
||||
dragele = evt.item.className;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.plugin.settings.menuCommands.forEach((newCommand, index) => {
|
||||
const setting = new Setting(cMenuToolbarCommandsContainer)
|
||||
|
||||
if ("SubmenuCommands" in newCommand) {
|
||||
|
||||
setting.settingEl.setAttribute("data-id", newCommand.id)
|
||||
setting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setClass("cMenuToolbarCommandsubItem")
|
||||
.setName(newCommand.name)
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async() => {
|
||||
new ChooseFromIconList(this.plugin, newCommand, false).open();
|
||||
});
|
||||
checksvg(newCommand.icon) ? addicon.buttonEl.innerHTML = newCommand.icon : addicon.setIcon(newCommand.icon)
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async() => {
|
||||
this.plugin.settings.menuCommands.remove(newCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if (newCommand.id == "cMenuToolbar-plugin:change-font-color") return; //修改字体颜色指令单独处理
|
||||
if (newCommand.id == "cMenuToolbar-plugin:change-background-color") return; //修改字体颜色指令单独处理
|
||||
|
||||
const cMenuToolbarCommandsContainer_sub = setting.settingEl.createEl("div", {
|
||||
cls: "cMenuToolbarSettingsTabsContainer_sub",
|
||||
});
|
||||
Sortable.create(cMenuToolbarCommandsContainer_sub, {
|
||||
group: {
|
||||
name: "item",
|
||||
pull: true,
|
||||
put: function () {
|
||||
if (dragele.includes("cMenuToolbarCommandsubItem"))
|
||||
return false;
|
||||
else return true;
|
||||
}
|
||||
|
||||
},
|
||||
draggable: ".setting-item",
|
||||
animation: 150,
|
||||
ghostClass: "sortable-ghost",
|
||||
chosenClass: "sortable-chosen",
|
||||
dragClass: "sortable-drag",
|
||||
dragoverBubble: false,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.7,
|
||||
forceFallback: true,
|
||||
fallbackClass: "sortable-fallback",
|
||||
easing: "cubic-bezier(1, 0, 0, 1)",
|
||||
onStart: function (evt) {
|
||||
// console.log(evt);
|
||||
},
|
||||
onSort: (command) => {
|
||||
|
||||
|
||||
if (command.from.className === command.to.className) {
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
const subresult = arrayResult[index]?.SubmenuCommands;
|
||||
|
||||
|
||||
if (subresult) {
|
||||
|
||||
const [removed] = subresult.splice(command.oldIndex, 1);
|
||||
subresult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
} else
|
||||
if (command.to.className === "cMenuToolbarSettingsTabsContainer") {
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
let cmdindex = getComandindex(command.path[1].dataset["id"], arrayResult);
|
||||
|
||||
const subresult = arrayResult[cmdindex]?.SubmenuCommands;
|
||||
|
||||
|
||||
const [removed] = subresult.splice(command.oldIndex, 1);
|
||||
arrayResult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
} else
|
||||
if (command.from.className === "cMenuToolbarSettingsTabsContainer") {
|
||||
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
|
||||
let cmdindex = getComandindex(command.path[1].dataset["id"], arrayResult);
|
||||
|
||||
const subresult = arrayResult[cmdindex]?.SubmenuCommands;
|
||||
const [removed] = arrayResult.splice(command.oldIndex, 1);
|
||||
subresult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 300);
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
newCommand.SubmenuCommands.forEach((subCommand: Command) => {
|
||||
const subsetting = new Setting(cMenuToolbarCommandsContainer_sub)
|
||||
|
||||
subsetting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async()=> {
|
||||
new ChooseFromIconList(this.plugin, subCommand, true).open();
|
||||
});
|
||||
|
||||
checksvg(subCommand?.icon) ? addicon.buttonEl.innerHTML = subCommand.icon : addicon.setIcon(subCommand.icon)
|
||||
})
|
||||
.setName(subCommand.name)
|
||||
.addButton((changename) => {
|
||||
changename
|
||||
.setIcon("pencil")
|
||||
.setTooltip(t("Change Command name"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.onClick(async()=> {
|
||||
new ChangeCmdname(this.app, this.plugin, subCommand, true).open();
|
||||
});
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async()=> {
|
||||
newCommand.SubmenuCommands.remove(subCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
subsetting.nameEl;
|
||||
});
|
||||
} else {
|
||||
setting
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
// .setIcon(newCommand.icon)
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async()=> {
|
||||
new ChooseFromIconList(this.plugin, newCommand, false).open();
|
||||
});
|
||||
checksvg(newCommand.icon) ? addicon.buttonEl.innerHTML = newCommand.icon : addicon.setIcon(newCommand.icon)
|
||||
})
|
||||
|
||||
if (newCommand.id == "cMenuToolbar-Divider-Line") setting.setClass("cMenuToolbar-Divider-Line")
|
||||
setting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setName(newCommand.name)
|
||||
.addButton((changename) => {
|
||||
changename
|
||||
.setIcon("pencil")
|
||||
.setTooltip(t("Change Command name"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.onClick(async()=> {
|
||||
new ChangeCmdname(this.app, this.plugin, newCommand, false).open();
|
||||
});
|
||||
})
|
||||
.addButton((addsubButton) => {
|
||||
addsubButton
|
||||
.setIcon("cMenuToolbarSub")
|
||||
.setTooltip(t("Add submenu"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonaddsub")
|
||||
.onClick(async()=> {
|
||||
const submenu =
|
||||
{ id: "SubmenuCommands-" + GenNonDuplicateID(1), name: "submenu", icon: "remix-Filter3Line", SubmenuCommands: [] };
|
||||
this.plugin.settings.menuCommands.splice(index + 1, 0, submenu);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${submenu.id}' add `, "color: #989cab");
|
||||
});
|
||||
})
|
||||
.addButton((addsubButton) => {
|
||||
addsubButton
|
||||
.setIcon("vertical-split")
|
||||
.setTooltip(t("add hr"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonaddsub")
|
||||
.onClick(async()=> {
|
||||
const dividermenu =
|
||||
{ id: "cMenuToolbar-Divider-Line", name: "HR", icon: "vertical-split" };
|
||||
this.plugin.settings.menuCommands.splice(index + 1, 0, dividermenu);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
|
||||
});
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async()=> {
|
||||
this.plugin.settings.menuCommands.remove(newCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// setting.nameEl;
|
||||
});
|
||||
|
||||
const cDonationDiv = containerEl.createEl("div", {
|
||||
cls: "cDonationSection",
|
||||
});
|
||||
|
||||
const credit = createEl("p");
|
||||
const donateText = createEl("p");
|
||||
donateText.appendText(
|
||||
"If you like this Plugin and are considering donating to support continued development, use the button below!"
|
||||
);
|
||||
credit.setAttribute("style", "color: var(--text-muted)");
|
||||
cDonationDiv.appendChild(donateText);
|
||||
cDonationDiv.appendChild(credit);
|
||||
|
||||
cDonationDiv.appendChild(
|
||||
createDonateButton("https://www.buymeacoffee.com/cuman")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const createDonateButton = (link: string): HTMLElement => {
|
||||
const a = createEl("a");
|
||||
a.setAttribute("href", link);
|
||||
a.addClass("buymeacoffee-img");
|
||||
a.innerHTML = `<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee &emoji=&slug=Cuman&button_colour=BD5FFF&font_colour=ffffff&font_family=Poppins&outline_colour=000000&coffee_colour=FFDD00" />`;
|
||||
return a;
|
||||
};
|
||||
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
// Code from https://github.com/valentine195/obsidian-admonition/blob/master/src/lang/helpers.ts
|
||||
|
||||
import { moment } from 'obsidian';
|
||||
|
||||
import ar from './locale/ar';
|
||||
import cz from './locale/cz';
|
||||
import da from './locale/da';
|
||||
import de from './locale/de';
|
||||
import en from './locale/en';
|
||||
import enGB from './locale/en-gb';
|
||||
import es from './locale/es';
|
||||
import fr from './locale/fr';
|
||||
import hi from './locale/hi';
|
||||
import id from './locale/id';
|
||||
import it from './locale/it';
|
||||
import ja from './locale/ja';
|
||||
import ko from './locale/ko';
|
||||
import nl from './locale/nl';
|
||||
import no from './locale/no';
|
||||
import pl from './locale/pl';
|
||||
import pt from './locale/pt';
|
||||
import ptBR from './locale/pt-br';
|
||||
import ro from './locale/ro';
|
||||
import ru from './locale/ru';
|
||||
import tr from './locale/tr';
|
||||
import zhCN from './locale/zh-cn';
|
||||
import zhTW from './locale/zh-tw';
|
||||
|
||||
const localeMap: { [k: string]: Partial<typeof en> } = {
|
||||
ar,
|
||||
cs: cz,
|
||||
da,
|
||||
de,
|
||||
en,
|
||||
'en-gb': enGB,
|
||||
es,
|
||||
fr,
|
||||
hi,
|
||||
id,
|
||||
it,
|
||||
ja,
|
||||
ko,
|
||||
nl,
|
||||
nn: no,
|
||||
pl,
|
||||
pt,
|
||||
'pt-br': ptBR,
|
||||
ro,
|
||||
ru,
|
||||
tr,
|
||||
'zh-cn': zhCN,
|
||||
'zh-tw': zhTW,
|
||||
};
|
||||
|
||||
const locale = localeMap[moment.locale()];
|
||||
|
||||
export function t(str: keyof typeof en): string {
|
||||
return (locale && locale[str]) || en[str];
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
// العربية
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// čeština
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Dansk
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Deutsch
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// British English
|
||||
|
||||
export default {};
|
@ -1,35 +0,0 @@
|
||||
export default {
|
||||
'Editing Toolbar append method':'Editing Toolbar append method',
|
||||
'Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.':'Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar aesthetic':'Editing Toolbar aesthetic',
|
||||
'Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.':'Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar position':'Editing Toolbar position',
|
||||
'Choose between fixed position or cursor following mode.':'Choose between fixed position or cursor following mode.',
|
||||
'Editing Toolbar columns':'Editing Toolbar columns',
|
||||
'Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.':'Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar refresh':'Editing Toolbar refresh',
|
||||
'Editing Toolbar commands':'Editing Toolbar commands',
|
||||
"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.":"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.",
|
||||
'Format Brush Off!':'Format Brush Off!',
|
||||
'Hide & Show':'Hide & Show',
|
||||
'Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.':'Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.',
|
||||
'Font-Color formatting brush ON!':'Font-Color formatting brush ON!',
|
||||
'More':'More',
|
||||
'Font Colors':'Font Colors',
|
||||
'Format Brush':'Format Brush',
|
||||
'Background color':'Background color',
|
||||
'Refresh':'Refresh',
|
||||
'Add':'Add',
|
||||
'Delete':'Delete',
|
||||
'Change Command name':'Change Command name',
|
||||
'Add submenu':'Add submenu',
|
||||
'add hr':'add hr',
|
||||
'Enter the icon code, it looks like <svg>.... </svg> format':'Enter the icon code, it looks like <svg>.... </svg> format',
|
||||
'Please enter a new name:':'Please enter a new name:',
|
||||
'Drag the slider to move the position':'Drag the slider to move the position',
|
||||
'Plugin Settings':'Plugin Settings',
|
||||
'Background-color formatting brush ON!':'Background-color formatting brush ON!',
|
||||
'Clear formatting brush ON!':'Clear formatting brush ON!',
|
||||
'Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush':'Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush',
|
||||
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
// Español
|
||||
|
||||
export default {};
|
@ -1 +0,0 @@
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// हिन्दी
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Bahasa Indonesia
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Italiano
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// 日本語
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// 한국어
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Nederlands
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Norsk
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// język polski
|
||||
|
||||
export default {};
|
@ -1 +0,0 @@
|
||||
export default {};
|
@ -1 +0,0 @@
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Română
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// русский
|
||||
|
||||
export default {};
|
@ -1,3 +0,0 @@
|
||||
// Türkçe
|
||||
|
||||
export default {};
|
@ -1,36 +0,0 @@
|
||||
export default {
|
||||
// setting.ts
|
||||
'Editing Toolbar append method': '工具栏的附加方法。',
|
||||
'Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.': '工具栏在Obsidian中的追加的位置,只对固定和跟随模式有效。如果你遇到工具栏显示问题,可以选择body试试。请点击下面或者状态栏菜单中的刷新按钮生效。',
|
||||
'Editing Toolbar aesthetic': '工具栏样式',
|
||||
'Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.': '样式有毛玻璃,简约和默认风格选择。请点击下面或者状态栏菜单中的刷新按钮生效。',
|
||||
'Editing Toolbar position': '工具栏位置',
|
||||
'Choose between fixed position or cursor following mode.': '在固定位置,光标跟随模式或者置顶模式之间进行选择。',
|
||||
'Editing Toolbar columns': '工具栏栏目数',
|
||||
'Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.': '选择在Editing Toolbar上显示的每行的列数。',
|
||||
'Editing Toolbar refresh': '刷新工具栏',
|
||||
'Editing Toolbar commands': '在工具栏中添加命令',
|
||||
"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.": '从Obsidian的命令库中添加一个命令到工具栏。要重新排列命令,可以拖放命令项。要删除它们,请使用命令项右边的删除按钮。图标选择Custom可以自定义图标',
|
||||
'Format Brush Off!': '关闭格式刷!',
|
||||
'Hide & Show': '隐藏 & 显示',
|
||||
'Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.': '对外观的更改生效需要使用刷新按钮。如果你忘记在设置中刷新,在状态栏菜单中也有一个刷新按钮。',
|
||||
'Font-Color formatting brush ON!': '字体颜色格式刷开启!',
|
||||
'More': '更多',
|
||||
'Font Colors': '字体颜色',
|
||||
'Format Brush': '格式刷',
|
||||
'Background color': '背景颜色',
|
||||
'Refresh': '刷新',
|
||||
'Add': '添加',
|
||||
'Delete': '删除',
|
||||
'Change Command name': '更改命令名称',
|
||||
'Add submenu': '添加子菜单',
|
||||
'add hr': '添加分割线',
|
||||
'Enter the icon code, it looks like <svg>.... </svg> format': '输入图标代码,类似<svg>.... </svg>格式',
|
||||
'Please enter a new name:': '请输入新名称:',
|
||||
'Drag the slider to move the position': '拖动滑块来移动位置',
|
||||
'Plugin Settings': '插件设置',
|
||||
'Background-color formatting brush ON!':'开启背景色格式刷',
|
||||
'Clear formatting brush ON!':'清除格式刷已开启',
|
||||
'Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush':'清除格式刷已开启\n点击鼠标中键或者右键关闭格式刷',
|
||||
|
||||
};
|
@ -1,3 +0,0 @@
|
||||
// 繁體中文
|
||||
|
||||
export default {};
|
@ -1,13 +0,0 @@
|
||||
export { }
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
ISMORE: boolean ;
|
||||
isBgC: boolean ;
|
||||
isCTxt: boolean ;
|
||||
isText: boolean ;
|
||||
newNotice: any;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,131 +0,0 @@
|
||||
import { App,MarkdownView,requireApiVersion } from "obsidian";
|
||||
let activeDocument: Document;
|
||||
export function workplacefullscreenMode(app: App)
|
||||
{
|
||||
requireApiVersion("0.15.0")?activeDocument=activeWindow.document:activeDocument=window.document;
|
||||
let rightleaf= activeDocument.body?.querySelector(" .mod-right-split.is-collapsed");
|
||||
let leftleaf= activeDocument.body?.querySelector(" .mod-left-split.is-collapsed");
|
||||
if(rightleaf&&!leftleaf) //@ts-ignore
|
||||
app.commands.executeCommandById("app:toggle-left-sidebar");
|
||||
if(!rightleaf&&leftleaf) //@ts-ignore
|
||||
app.commands.executeCommandById("app:toggle-right-sidebar");
|
||||
if(!rightleaf&&!leftleaf||rightleaf&&leftleaf) {
|
||||
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("app:toggle-left-sidebar");
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("app:toggle-right-sidebar")}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//full screen mode
|
||||
export function fullscreenMode(app: App) {
|
||||
const leaf = app.workspace.getActiveViewOfType(MarkdownView)
|
||||
if (!leaf)
|
||||
return;
|
||||
let el = leaf.containerEl ;
|
||||
let fullscreenMutationObserver: MutationObserver;
|
||||
fullscreenMutationObserver = new MutationObserver(function (mutationRecords) {
|
||||
mutationRecords.forEach(function (mutationRecord) {
|
||||
mutationRecord.addedNodes.forEach(function (node) {
|
||||
if(isFull(el)){
|
||||
try{
|
||||
document.body.removeChild(node);
|
||||
el.appendChild(node);
|
||||
}catch (error)
|
||||
{
|
||||
console.log(error.message)
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
el.addEventListener("fullscreenchange", function (event: any) {
|
||||
if (!isFull(el)) {
|
||||
fullscreenMutationObserver.disconnect();
|
||||
}
|
||||
});
|
||||
if(isFull(el))
|
||||
{
|
||||
fullscreenMutationObserver.disconnect();
|
||||
|
||||
exitFull()
|
||||
|
||||
}else
|
||||
{
|
||||
|
||||
beFull(el)
|
||||
fullscreenMutationObserver.observe(document.body, { childList: true });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toggleFull = exports.isFull = exports.exitFull = exports.beFull = void 0;
|
||||
let DOC_EL = document.documentElement;
|
||||
let headEl = DOC_EL.querySelector('head');
|
||||
let styleEl = document.createElement('style');
|
||||
let TYPE_REQUEST_FULL_SCREEN = 'requestFullscreen';
|
||||
let TYPE_EXIT_FULL_SCREEN = 'exitFullscreen';
|
||||
let TYPE_FULL_SCREEN_ELEMENT = 'fullscreenElement';
|
||||
let TYPE_ON_FULL_SCREEN_CHANGE = 'onfullscreenchange';
|
||||
if ("webkitRequestFullScreen" in DOC_EL) {
|
||||
TYPE_REQUEST_FULL_SCREEN = 'webkitRequestFullScreen';
|
||||
TYPE_EXIT_FULL_SCREEN = 'webkitExitFullscreen';
|
||||
TYPE_FULL_SCREEN_ELEMENT = 'webkitFullscreenElement';
|
||||
TYPE_ON_FULL_SCREEN_CHANGE = 'onwebkitfullscreenchange';
|
||||
}
|
||||
else if ("msRequestFullscreen" in DOC_EL) {
|
||||
TYPE_REQUEST_FULL_SCREEN = 'msRequestFullscreen';
|
||||
TYPE_EXIT_FULL_SCREEN = 'msExitFullscreen';
|
||||
TYPE_FULL_SCREEN_ELEMENT = 'msFullscreenElement';
|
||||
TYPE_ON_FULL_SCREEN_CHANGE = 'MSFullscreenChange';
|
||||
}
|
||||
else if ("mozRequestFullScreen" in DOC_EL) {
|
||||
TYPE_REQUEST_FULL_SCREEN = 'mozRequestFullScreen';
|
||||
TYPE_EXIT_FULL_SCREEN = 'mozCancelFullScreen';
|
||||
TYPE_FULL_SCREEN_ELEMENT = 'mozFullScreenElement';
|
||||
TYPE_ON_FULL_SCREEN_CHANGE = 'onmozfullscreenchange';
|
||||
}
|
||||
else if (!("requestFullscreen" in DOC_EL)) {
|
||||
throw "\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301Fullscreen API !";
|
||||
}
|
||||
function getCurrentElement(el: HTMLElement) {
|
||||
return el instanceof HTMLElement ? el : DOC_EL;
|
||||
}
|
||||
function beFull(el: HTMLElement) {
|
||||
|
||||
return getCurrentElement(el)[TYPE_REQUEST_FULL_SCREEN]();
|
||||
}
|
||||
exports.beFull = beFull;
|
||||
function exitFull() {
|
||||
if (DOC_EL.contains(styleEl)) {
|
||||
headEl === null || headEl === void 0 ? void 0 : headEl.removeChild(styleEl);
|
||||
}
|
||||
return document[TYPE_EXIT_FULL_SCREEN]();
|
||||
}
|
||||
exports.exitFull = exitFull;
|
||||
function isFull(el: any) {
|
||||
return getCurrentElement(el) === document[TYPE_FULL_SCREEN_ELEMENT];
|
||||
}
|
||||
exports.isFull = isFull;
|
||||
function toggleFull(el: any) {
|
||||
if (isFull(el)) {
|
||||
exitFull();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
beFull(el);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
exports.toggleFull = toggleFull;
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
import { Workspace, WorkspaceContainer, WorkspaceItem, WorkspaceParent, WorkspaceWindow } from 'obsidian';
|
||||
|
||||
export interface WorkspaceItemExt extends WorkspaceItem {
|
||||
// the parent of the item
|
||||
parentSplit: WorkspaceParentExt;
|
||||
|
||||
// the container element
|
||||
containerEl: HTMLElement;
|
||||
|
||||
// the width of the item in pixels
|
||||
width:number;
|
||||
}
|
||||
|
||||
// interface for extending WorkspaceParent with undocumented properties
|
||||
export interface WorkspaceParentExt extends WorkspaceParent, WorkspaceItemExt, WorkspaceContainer {
|
||||
// the child items of the split
|
||||
children: WorkspaceItemExt[];
|
||||
|
||||
// function for child resizing
|
||||
onChildResizeStart: (leaf: WorkspaceItemExt, event: MouseEvent) => void;
|
||||
// ...and backup thereof
|
||||
oldChildResizeStart: (leaf: WorkspaceItemExt, event: MouseEvent) => void;
|
||||
|
||||
// split direction
|
||||
direction: 'horizontal' | 'vertical';
|
||||
}
|
||||
|
||||
export class WorkspaceExt extends Workspace {
|
||||
floatingSplit: WorkspaceParentExt;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
import {requireApiVersion} from "obsidian"
|
||||
let activeDocument: Document;
|
||||
export const setMenuVisibility = (cMenuVisibility: boolean) => {
|
||||
requireApiVersion("0.15.0")?activeDocument=activeWindow.document:activeDocument=window.document;
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById("cMenuToolbarModalBar");
|
||||
if (cMenuToolbarModalBar) {
|
||||
cMenuVisibility == false
|
||||
? (cMenuToolbarModalBar.style.visibility = "hidden")
|
||||
: (cMenuToolbarModalBar.style.visibility = "visible");
|
||||
}
|
||||
};
|
||||
|
||||
export const setBottomValue = (
|
||||
settings: any
|
||||
) => {
|
||||
requireApiVersion("0.15.0")?activeDocument=activeWindow.document:activeDocument=window.document;
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById("cMenuToolbarModalBar");
|
||||
if (cMenuToolbarModalBar) {
|
||||
|
||||
if(settings.positionStyle == "top")
|
||||
{
|
||||
|
||||
cMenuToolbarModalBar.setAttribute("style", `position: relative; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));`);
|
||||
cMenuToolbarModalBar.className +=" top";
|
||||
}else
|
||||
{
|
||||
cMenuToolbarModalBar.setAttribute("style", `left: calc(50% - calc(${cMenuToolbarModalBar.offsetWidth}px / 2)); bottom: ${settings.cMenuBottomValue}em; grid-template-columns: ${"1fr ".repeat(settings.cMenuNumRows)}`);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -1,188 +0,0 @@
|
||||
|
||||
|
||||
|
||||
export async function wait(delay: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, delay));
|
||||
}
|
||||
// GenNonDuplicateID(3) 将生成类似 ix49wl2978w 的ID
|
||||
export function GenNonDuplicateID(randomLength: number){
|
||||
let idStr = Date.now().toString(36)
|
||||
idStr += Math.random().toString(36).substr(3,randomLength)
|
||||
return idStr
|
||||
}
|
||||
export function findmenuID(plugin: { settings: { menuCommands: any; }; },command: { id: any; },issub: any){
|
||||
let index;
|
||||
let res={"index":-1,"subindex":-1};
|
||||
let menucmd=plugin.settings.menuCommands
|
||||
if(issub)
|
||||
{
|
||||
menucmd.forEach((item: { SubmenuCommands: any[]; },idx: any) => {
|
||||
if("SubmenuCommands" in item )
|
||||
{
|
||||
index= item.SubmenuCommands.findIndex((v) => v.id== command.id);
|
||||
if(index>=0)
|
||||
{
|
||||
res= {"index":idx,"subindex":index};
|
||||
return res;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
index= menucmd.findIndex((v: { id: any; }) => v.id== command.id);
|
||||
res= {"index":index,"subindex":-1};
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
export const colorpicker=`<div class='x-color-picker-wrapper'>
|
||||
<div class='x-color-picker' >
|
||||
<table class="x-color-picker-table" id='x-color-picker-table'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="10" class="ui-widget-content">Theme Colors</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#ffffff"><span></span></td>
|
||||
<td style="background-color:#000000"><span></span></td>
|
||||
<td style="background-color:#eeece1"><span></span></td>
|
||||
<td style="background-color:#1f497d"><span></span></td>
|
||||
<td style="background-color:#4f81bd"><span></span></td>
|
||||
<td style="background-color:#c0504d"><span></span></td>
|
||||
<td style="background-color:#9bbb59"><span></span></td>
|
||||
<td style="background-color:#8064a2"><span></span></td>
|
||||
<td style="background-color:#4bacc6"><span></span></td>
|
||||
<td style="background-color:#f79646"><span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="10"></th>
|
||||
</tr>
|
||||
<tr class="top">
|
||||
<td style="background-color:#f2f2f2"><span></span></td>
|
||||
<td style="background-color:#7f7f7f"><span></span></td>
|
||||
<td style="background-color:#ddd9c3"><span></span></td>
|
||||
<td style="background-color:#c6d9f0"><span></span></td>
|
||||
<td style="background-color:#dbe5f1"><span></span></td>
|
||||
<td style="background-color:#f2dcdb"><span></span></td>
|
||||
<td style="background-color:#ebf1dd"><span></span></td>
|
||||
<td style="background-color:#e5e0ec"><span></span></td>
|
||||
<td style="background-color:#dbeef3"><span></span></td>
|
||||
<td style="background-color:#fdeada"><span></span></td>
|
||||
</tr>
|
||||
<tr class="in">
|
||||
<td style="background-color:#d8d8d8"><span></span></td>
|
||||
<td style="background-color:#595959"><span></span></td>
|
||||
<td style="background-color:#c4bd97"><span></span></td>
|
||||
<td style="background-color:#8db3e2"><span></span></td>
|
||||
<td style="background-color:#b8cce4"><span></span></td>
|
||||
<td style="background-color:#e5b9b7"><span></span></td>
|
||||
<td style="background-color:#d7e3bc"><span></span></td>
|
||||
<td style="background-color:#ccc1d9"><span></span></td>
|
||||
<td style="background-color:#b7dde8"><span></span></td>
|
||||
<td style="background-color:#fbd5b5"><span></span></td>
|
||||
</tr>
|
||||
<tr class="in">
|
||||
<td style="background-color:#bfbfbf"><span></span></td>
|
||||
<td style="background-color:#3f3f3f"><span></span></td>
|
||||
<td style="background-color:#938953"><span></span></td>
|
||||
<td style="background-color:#548dd4"><span></span></td>
|
||||
<td style="background-color:#95b3d7"><span></span></td>
|
||||
<td style="background-color:#d99694"><span></span></td>
|
||||
<td style="background-color:#c3d69b"><span></span></td>
|
||||
<td style="background-color:#b2a2c7"><span></span></td>
|
||||
<td style="background-color:#92cddc"><span></span></td>
|
||||
<td style="background-color:#fac08f"><span></span></td>
|
||||
</tr>
|
||||
<tr class="in">
|
||||
<td style="background-color:#a5a5a5"><span></span></td>
|
||||
<td style="background-color:#262626"><span></span></td>
|
||||
<td style="background-color:#494429"><span></span></td>
|
||||
<td style="background-color:#17365d"><span></span></td>
|
||||
<td style="background-color:#366092"><span></span></td>
|
||||
<td style="background-color:#953734"><span></span></td>
|
||||
<td style="background-color:#76923c"><span></span></td>
|
||||
<td style="background-color:#5f497a"><span></span></td>
|
||||
<td style="background-color:#31859b"><span></span></td>
|
||||
<td style="background-color:#e36c09"><span></span></td>
|
||||
</tr>
|
||||
<tr class="bottom">
|
||||
<td style="background-color:#7f7f7f"><span></span></td>
|
||||
<td style="background-color:#0c0c0c"><span></span></td>
|
||||
<td style="background-color:#1d1b10"><span></span></td>
|
||||
<td style="background-color:#0f243e"><span></span></td>
|
||||
<td style="background-color:#244061"><span></span></td>
|
||||
<td style="background-color:#632423"><span></span></td>
|
||||
<td style="background-color:#4f6128"><span></span></td>
|
||||
<td style="background-color:#3f3151"><span></span></td>
|
||||
<td style="background-color:#205867"><span></span></td>
|
||||
<td style="background-color:#974806"><span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="10"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="10" class="ui-widget-content">Standard Colors</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="background-color:#c00000"><span></span></td>
|
||||
<td style="background-color:#ff0000"><span></span></td>
|
||||
<td style="background-color:#ffc000"><span></span></td>
|
||||
<td style="background-color:#ffff00"><span></span></td>
|
||||
<td style="background-color:#92d050"><span></span></td>
|
||||
<td style="background-color:#00b050"><span></span></td>
|
||||
<td style="background-color:#00b0f0"><span></span></td>
|
||||
<td style="background-color:#0070c0"><span></span></td>
|
||||
<td style="background-color:#002060"><span></span></td>
|
||||
<td style="background-color:#7030a0"><span></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
export const backcolorpicker=`<div class='x-color-picker-wrapper'>
|
||||
<div class='x-color-picker' >
|
||||
<table class="x-color-picker-table" id='x-backgroundcolor-picker-table'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th colspan="5" class="ui-widget-content">Translucent Colors</th>
|
||||
</tr>
|
||||
<tr class="top">
|
||||
<td style="background-color:rgba(140, 140, 140, 0.12)"><span></span></td>
|
||||
<td style="background-color:rgba(92, 92, 92, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(163, 67, 31, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(240, 107, 5, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(240, 200, 0, 0.2)"><span></span></td>
|
||||
</tr>
|
||||
<tr class="bottom">
|
||||
<td style="background-color:rgba(3, 135, 102, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(3, 135, 102, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(5, 117, 197, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(74, 82, 199, 0.2)"><span></span></td>
|
||||
<td style="background-color:rgba(136, 49, 204, 0.2)"><span></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="5" class="ui-widget-content">Highlighter Colors</th>
|
||||
</tr>
|
||||
|
||||
<tr class="top">
|
||||
<td style="background-color:rgb(255, 248, 143)"><span></span></td>
|
||||
<td style="background-color:rgb(211, 248, 182)"><span></span></td>
|
||||
<td style="background-color:rgb(175, 250, 209)"><span></span></td>
|
||||
<td style="background-color:rgb(177, 255, 255)"><span></span></td>
|
||||
<td style="background-color:rgb(253, 191, 255)"><span></span></td>
|
||||
</tr>
|
||||
<tr class="bottom">
|
||||
<td style="background-color:rgb(210, 203, 255);"><span></span></td>
|
||||
<td style="background-color:rgb(64, 169, 255);"><span></span></td>
|
||||
<td style="background-color:rgb(255, 77, 79);"><span></span></td>
|
||||
<td style="background-color:rgb(212, 177, 6);"><span></span></td>
|
||||
<td style="background-color:rgb(146, 84, 222);"><span></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>`;
|
@ -1,846 +0,0 @@
|
||||
|
||||
|
||||
#cMenuToolbarModalBar {
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 3px;
|
||||
display: grid;
|
||||
user-select: none;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
transition: 200ms ease;
|
||||
-webkit-transition: 200ms ease;
|
||||
min-width: fit-content;
|
||||
justify-content: space-around;
|
||||
z-index: var(--layer-status-bar);
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex {
|
||||
display: flex;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]) {
|
||||
min-width: 20px;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: 2px;
|
||||
border: none;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
padding: 5px 6px;
|
||||
box-shadow: none;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
font-size: initial !important;
|
||||
background-color: var(--background-primary-alt);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
/* #cMenuToolbarModalBar button.cMenuToolbarCommandItem svg {
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
} */
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTINGS BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd {
|
||||
background-color: var(--interactive-accent);
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete {
|
||||
background-color: #989cab;
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh {
|
||||
background-color: var(--text-accent);
|
||||
}
|
||||
|
||||
button.cMenuToolbarSettingsButton {
|
||||
padding: 4px 14px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTING ITEMS
|
||||
----------------------------------------------------------------*/
|
||||
.setting-item.cMenuToolbarCommandItem:first-child {
|
||||
padding-top: 18px;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandItem {
|
||||
cursor: grab;
|
||||
padding: 18px 0 18px 0;
|
||||
}
|
||||
|
||||
.sortable-fallback {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.sortable-grab {
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.sortable-chosen {
|
||||
cursor: grabbing;
|
||||
padding: 18px 0 18px 18px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.sortable-drag {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer {
|
||||
border-top: 1px solid var(--background-modifier-border);
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar CLASS CHANGES
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic
|
||||
{
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem])
|
||||
{
|
||||
min-height:28px ;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 6px;
|
||||
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
.cMenuToolbarDefaultAesthetic {
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ,#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ~#cMenuToolbarPopoverBar {
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
box-shadow:none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar ICONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbarIconPick {
|
||||
line-height: normal;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.cMenuToolbarIconPick svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR MENU
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-menu {
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
border-radius: 5px;
|
||||
height: auto;
|
||||
padding: 8px 5px 0px 5px;
|
||||
margin: 0 auto;
|
||||
width: fit-content;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item .menu-item-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item .selected:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item.selected:not(.is-disabled):not(.is-label) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 4px;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem button.cMenuToolbarSettingsButton {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg path {
|
||||
fill: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg {
|
||||
stroke: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu > .menu-item {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) .menu-item-icon{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-button {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-button svg {
|
||||
display: flex;
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SUPPORT
|
||||
---------------------------------------------`-------------------*/
|
||||
|
||||
.cDonationSection {
|
||||
width: 60%;
|
||||
height: 50vh;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar{
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic .cMenuToolbarCommandItem{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic [class^=cMenuToolbarCommandsubItem]{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem{
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* #cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem svg{
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
} */
|
||||
|
||||
|
||||
|
||||
div.modal-container.cMenuToolbar-Modal:not(.changename) .modal-bg
|
||||
{
|
||||
background-color:transparent!important;
|
||||
backdrop-filter: none!important;
|
||||
position: relative;
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal:not(.changename) .modal {
|
||||
padding: 10px 30px;
|
||||
min-width: 130px;
|
||||
position: absolute;
|
||||
bottom: 2em;
|
||||
right: 0.5em;
|
||||
background-color: rgb(var(--background-primary-rgb),0.5);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal .modal-title
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
width: 90%;
|
||||
|
||||
}
|
||||
body.theme-dark .modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
/*tiny 样式*/
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic {
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
background-color: var(--background-secondary);
|
||||
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
|
||||
margin-left: 4px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar).cMenuToolbarTinyAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
|
||||
}
|
||||
button[class^=cMenuToolbarCommandsubItem]::after {
|
||||
|
||||
content: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
margin-left: 1px;
|
||||
margin-top:6px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
|
||||
position: absolute;
|
||||
z-index: var(--layer-menu);
|
||||
user-select: none;
|
||||
transform: translateY(90%) translateX(-40%);
|
||||
-webkit-transform: translateY(90%) translateX(-40%);
|
||||
display: flex;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem svg
|
||||
{
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button.menu-item
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
line-height:2em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button:hover
|
||||
{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem .menu-item {
|
||||
|
||||
margin-right: 4px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem {
|
||||
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
position: absolute;
|
||||
margin-left: 18px;
|
||||
bottom: 8%;
|
||||
background-size: 4px 4px;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
background-position: center;
|
||||
|
||||
background-repeat: no-repeat;
|
||||
min-width: unset;
|
||||
border-left: 2px solid transparent;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
margin-left: 16px;
|
||||
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .x-color-picker-wrapper
|
||||
{
|
||||
top:auto;
|
||||
bottom:calc(100% + 1em);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem
|
||||
{
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem]:hover >.subitem {
|
||||
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandsubItem-font-color button
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
.cMenuToolbarCommandsubItem-font-color button:hover
|
||||
{
|
||||
background-color: var(--interactive-normal);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandItem .setting-item-info {
|
||||
|
||||
flex:30%;
|
||||
margin: 0;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub
|
||||
{
|
||||
border-left: 1px solid var(--background-modifier-border);
|
||||
flex-flow: column;
|
||||
min-height: 45px;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin-left: 10px;
|
||||
flex: 70%;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty
|
||||
{
|
||||
border: 2px dashed rgba(var(--interactive-accent-rgb),0.5);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty::before {
|
||||
content: "✖️Drag it here";
|
||||
margin: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .cMenuToolbarCommandItem
|
||||
{
|
||||
flex: auto;
|
||||
margin-left: 2em;;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .setting-item-control
|
||||
{
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandSubItem>.setting-item-info
|
||||
{
|
||||
flex: 70px;
|
||||
}
|
||||
.cMenuToolbarCommandSubItem>.setting-item-control
|
||||
{
|
||||
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonaddsub {
|
||||
background-color: var(--background-secondary-alt);
|
||||
}
|
||||
|
||||
|
||||
.setting-item button.cMenuToolbarSettingsIcon{
|
||||
display: block;
|
||||
transform: translateX(-30%);
|
||||
-webkit-transform: translateX(-30%);
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon:empty::before{
|
||||
content: "❗";
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon svg{
|
||||
max-width: 1.5em;
|
||||
max-height: 1.5em;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon:hover{
|
||||
background-color: var(--interactive-accent-hover);
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon
|
||||
{
|
||||
background-color: transparent;
|
||||
box-shadow: 0 1px 1px 0px var(--background-modifier-border);
|
||||
}
|
||||
@media screen and (min-width: 781px){
|
||||
.cMenuToolbar-Modal .wideInputPromptInputEl {
|
||||
width: 40rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
background-color: rgb(var(--background-primary-rgb),0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.cMenuToolbarcustomIcon svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbarSettingsButton svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.cmdr-page-header
|
||||
{
|
||||
min-width: 1em;;
|
||||
}
|
||||
|
||||
|
||||
.x-color-picker-wrapper {
|
||||
right: 0px;
|
||||
top:1.8em;
|
||||
min-width: 1px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14);
|
||||
position: absolute;
|
||||
width: fit-content;
|
||||
font-weight: 400;
|
||||
font-family: Source Sans Pro,sans-serif;
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
.markdown-source-view.mod-cm6 .x-color-picker-wrapper table.x-color-picker-table#x-color-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper table.x-color-picker-table#x-backgroundcolor-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table th {
|
||||
border: 0;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
background: transparent !important;
|
||||
color: #718096;
|
||||
}
|
||||
.x-color-picker-wrapper #x-color-picker-table td {
|
||||
font-size: 1px;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper #x-backgroundcolor-picker-table td {
|
||||
font-size: 1px;
|
||||
border-radius: 50%;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table tr td:hover {
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
}
|
||||
.x-color-picker-wrapper tbody>tr:hover
|
||||
{
|
||||
background-color:transparent !important;
|
||||
}
|
||||
/**top**/
|
||||
#cMenuToolbarModalBar.top {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
height: 38px;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.top :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):not(.cMenuToolbar-Divider-Line)
|
||||
{
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar.top button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#cMenuToolbarPopoverBar{
|
||||
|
||||
padding: 0 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
z-index: var(--layer-status-bar);
|
||||
background-color: var(--background-secondary);
|
||||
background-clip: padding-box;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
box-shadow: 0 0 8px rgba(0,0,0,.15)\9;
|
||||
margin-left: auto;
|
||||
margin-right: 25px;
|
||||
transition: all 0.1s linear;
|
||||
-webkit-transition: all 0.1s linear;
|
||||
margin-top: 32px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]){
|
||||
|
||||
height: 26px;
|
||||
margin-left: 4px;
|
||||
font-size: 10px;
|
||||
margin-right: 4px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):hover{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar .more-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow:none;
|
||||
margin-left: 4px;
|
||||
border-left: 1px inset var( --background-modifier-form-field);
|
||||
height: 24px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
/*Divider-Line**/
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line
|
||||
{
|
||||
padding: 0;
|
||||
|
||||
line-height: 0px;
|
||||
border-left: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
border-right: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
text-align: center;
|
||||
background: rgba(var(--interactive-accent-rgb),0.2);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:not(:last-child)
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info
|
||||
{
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control
|
||||
{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info .setting-item-name
|
||||
{
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child
|
||||
{
|
||||
padding: 0;
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child svg
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child::before
|
||||
{
|
||||
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M511.674077 66.707284c-246.52265 0-446.347744 199.835328-446.347744 446.347744s199.825095 446.356954 446.347744 446.356954c246.50423 0 446.348768-199.844537 446.348768-446.356954S758.177284 66.707284 511.674077 66.707284zM744.967424 667.159826c21.8701 21.8701 21.8701 57.310264 0 79.199807-21.8701 21.851681-57.30924 21.851681-79.198783-0.019443L511.674077 592.264045 357.56007 746.359632c-21.8701 21.8701-57.30924 21.851681-79.17934-0.019443s-21.8701-57.290821 0-79.160921L432.493713 513.065262 278.379707 358.950232c-21.8701-21.86089-21.8701-57.328683 0-79.18855 21.8701-21.87931 57.30924-21.87931 79.17934 0l154.114007 154.104797 154.095587-154.104797c21.889543-21.87931 57.32766-21.87931 79.198783-0.010233 21.8701 21.8701 21.8701 57.348126 0 79.207993L590.89128 513.065262 744.967424 667.159826z' fill='%23666666'/%3E%3C/svg%3E");
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
min-width:unset;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
width: 0.6px;
|
||||
background-color: var(--background-modifier-border);
|
||||
height: 22px;
|
||||
opacity: 0.8;
|
||||
margin: 0;
|
||||
}
|
||||
.theme-dark :is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
|
||||
background-color: #4f4f5188;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line svg
|
||||
{
|
||||
display: none;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"src": ["src/*"]
|
||||
},
|
||||
"module": "ESNext",
|
||||
"target": "es6",
|
||||
"jsx": "react",
|
||||
"allowJs": true,
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"importHelpers": true,
|
||||
"inlineSourceMap": true,
|
||||
"inlineSources": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"types": ["node"],
|
||||
"lib": ["dom", "es5", "scripthost", "es2015"]
|
||||
},
|
||||
"include": ["**/*.ts", "main.js/*"],
|
||||
"exclude": ["node_modules/*"]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"1.1.2": "0.9.12"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user