-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
268 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"[html]": { | ||
"editor.defaultFormatter": "vscode.html-language-features" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-typescript", | ||
{ | ||
"optimizeConstEnums": true | ||
} | ||
], | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,112 @@ | ||
<html> | ||
<body> | ||
<ul> | ||
<li> | ||
<svg | ||
aria-hidden="true" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
class="icon" | ||
> | ||
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> | ||
<path | ||
d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z" | ||
></path> | ||
</svg> | ||
<a | ||
href="https://github.com/lujunji4113/cloud-document-converter" | ||
target="_blank" | ||
data-locale="help_and_feedback" | ||
>Help and Feedback</a | ||
> | ||
</li> | ||
<li> | ||
<svg | ||
aria-hidden="true" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
class="icon icon-heart" | ||
> | ||
<path | ||
d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z" | ||
></path> | ||
</svg> | ||
<a | ||
href="https://www.buymeacoffee.com/lujunji" | ||
target="_blank" | ||
data-locale="by_me_a_coffee" | ||
>By me a coffee</a | ||
> | ||
</li> | ||
</ul> | ||
<style> | ||
:root { | ||
--text-primary: #3a3c42; | ||
} | ||
|
||
.icon { | ||
margin-right: 8px; | ||
} | ||
<body> | ||
<ul> | ||
<li> | ||
<svg aria-hidden="true" focusable="false" role="img" class="octicon octicon-copy" viewBox="0 0 16 16" width="16" | ||
height="16" fill="currentColor"> | ||
<path | ||
d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"> | ||
</path> | ||
<path | ||
d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"> | ||
</path> | ||
</svg> | ||
<button id="copy_docx_as_markdown" data-locale="copy_docx_as_markdown">Copy as | ||
Markdown</button> | ||
</li> | ||
<li> | ||
<svg aria-hidden="true" focusable="false" role="img" class="octicon octicon-download" viewBox="0 0 16 16" | ||
width="16" height="16" fill="currentColor"> | ||
<path | ||
d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"> | ||
</path> | ||
<path | ||
d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"> | ||
</path> | ||
</svg> | ||
<button id="download_docx_as_markdown" data-locale="download_docx_as_markdown">Download as | ||
Markdown</button> | ||
</li> | ||
<li> | ||
<svg aria-hidden="true" focusable="false" role="img" class="octicon octicon-issue-opened" viewBox="0 0 16 16" | ||
width="16" height="16" fill="currentColor"> | ||
<path d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path> | ||
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path> | ||
</svg> | ||
<a href="https://github.com/lujunji4113/cloud-document-converter" target="_blank" | ||
data-locale="help_and_feedback">Help and Feedback</a> | ||
</li> | ||
<li> | ||
<svg aria-hidden="true" focusable="false" role="img" class="octicon octicon-heart" viewBox="0 0 16 16" width="16" | ||
height="16" fill="currentColor"> | ||
<path | ||
d="m8 14.25.345.666a.75.75 0 0 1-.69 0l-.008-.004-.018-.01a7.152 7.152 0 0 1-.31-.17 22.055 22.055 0 0 1-3.434-2.414C2.045 10.731 0 8.35 0 5.5 0 2.836 2.086 1 4.25 1 5.797 1 7.153 1.802 8 3.02 8.847 1.802 10.203 1 11.75 1 13.914 1 16 2.836 16 5.5c0 2.85-2.045 5.231-3.885 6.818a22.066 22.066 0 0 1-3.744 2.584l-.018.01-.006.003h-.002ZM4.25 2.5c-1.336 0-2.75 1.164-2.75 3 0 2.15 1.58 4.144 3.365 5.682A20.58 20.58 0 0 0 8 13.393a20.58 20.58 0 0 0 3.135-2.211C12.92 9.644 14.5 7.65 14.5 5.5c0-1.836-1.414-3-2.75-3-1.373 0-2.609.986-3.029 2.456a.749.749 0 0 1-1.442 0C6.859 3.486 5.623 2.5 4.25 2.5Z"> | ||
</path> | ||
</svg> | ||
<a href="https://www.buymeacoffee.com/lujunji" target="_blank" data-locale="by_me_a_coffee">By me a coffee</a> | ||
</li> | ||
</ul> | ||
<style> | ||
:root { | ||
--text-primary: #3a3c42; | ||
} | ||
|
||
.icon-heart { | ||
fill: rgb(219, 97, 162); | ||
} | ||
.octicon { | ||
margin-right: 8px; | ||
|
||
body { | ||
min-width: 200px; | ||
margin: 0px; | ||
font-size: 16px; | ||
} | ||
display: inline-block; | ||
user-select: none; | ||
vertical-align: text-bottom; | ||
overflow: visible | ||
} | ||
|
||
ul { | ||
list-style: none; | ||
padding: 0px; | ||
margin: 0px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: start; | ||
} | ||
.octicon-heart { | ||
fill: rgb(219, 97, 162); | ||
} | ||
|
||
li { | ||
padding: 8px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: center; | ||
} | ||
body { | ||
width: max-content; | ||
margin: 0px; | ||
font-size: 16px; | ||
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: var(--text-primary); | ||
} | ||
</style> | ||
<script src="popup.js"></script> | ||
</body> | ||
</html> | ||
ul { | ||
list-style: none; | ||
padding: 0px; | ||
margin: 0px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: start; | ||
} | ||
|
||
li { | ||
padding: 8px; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: flex-start; | ||
align-items: center; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
color: var(--text-primary); | ||
} | ||
|
||
button { | ||
padding: 0px; | ||
margin: 0px; | ||
border-width: 0px; | ||
|
||
background-color: transparent; | ||
color: var(--text-primary); | ||
font-size: inherit; | ||
cursor: pointer; | ||
} | ||
</style> | ||
<script src="popup.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
document.querySelectorAll('[data-locale]').forEach(elem => { | ||
elem.innerText = chrome.i18n.getMessage(elem.dataset.locale) | ||
}) | ||
|
||
const copyButton = document.getElementById('copy_docx_as_markdown') | ||
if (copyButton) { | ||
const handleCopy = async () => { | ||
await chrome.runtime.sendMessage({ flag: 'copy_docx_as_markdown' }) | ||
|
||
window.close() | ||
} | ||
|
||
copyButton.addEventListener('click', handleCopy) | ||
} | ||
|
||
const downloadButton = document.getElementById('download_docx_as_markdown') | ||
if (downloadButton) { | ||
const handleDownload = async () => { | ||
await chrome.runtime.sendMessage({ flag: 'download_docx_as_markdown' }) | ||
|
||
window.close() | ||
} | ||
|
||
downloadButton.addEventListener('click', handleDownload) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.