-
Notifications
You must be signed in to change notification settings - Fork 62
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
1 parent
ce2e2a7
commit 318a036
Showing
8 changed files
with
70 additions
and
35 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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { $enum } from "ts-enum-util"; | ||
|
||
import { Oper } from "@/types/common"; | ||
import { StorageKeys } from "@/utils/constant"; | ||
import { get } from "@/utils/storage"; | ||
|
||
export const exportOper: Oper = { | ||
title: "Export notes to json", | ||
onClick: async () => { | ||
const exportObj = {}; | ||
const keys = $enum(StorageKeys).keys(); | ||
for (const key of keys) { | ||
const item = await get(key); | ||
(exportObj as Record<StorageKeys, any>)[key] = item; | ||
} | ||
const dataStr = | ||
"data:text/json;charset=utf-8," + | ||
encodeURIComponent(JSON.stringify(exportObj, null, 2)); | ||
const dom: HTMLElement | null = document.createElement("a"); | ||
dom?.setAttribute("href", dataStr); | ||
dom?.setAttribute("download", "context-note.json"); | ||
dom?.click(); | ||
}, | ||
isConfirm: false, | ||
}; |
This file was deleted.
Oops, something went wrong.
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,46 +1,56 @@ | ||
<template> | ||
<div class="settings"> | ||
<a href="https://github.com/betterRunner/context-note" target="_blank"> | ||
<div class="settings-container"> | ||
<div class="settings"> | ||
<a href="https://github.com/betterRunner/context-note" target="_blank"> | ||
<img class="settings-icon" :src="githubLogoSrc" height="30" /> | ||
</a> | ||
<More direction="row" size="4" color="#666" placement="top" :opers="[]" /> | ||
<More direction="row" size="4" color="#666" placement="top" :opers="opers" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import More from '../shared/more.vue'; | ||
import { ref } from "vue"; | ||
import { Oper } from "@/types/common"; | ||
import More from "../shared/more.vue"; | ||
import { exportOper } from './ex-import'; | ||
export default { | ||
components: { | ||
More, | ||
}, | ||
setup() { | ||
const githubLogoSrc = chrome.runtime.getURL("assets/github-logo.png"); | ||
const opers = ref<Oper[]>([exportOper]) | ||
return { | ||
githubLogoSrc, | ||
opers, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="less" scoped> | ||
.settings { | ||
position: absolute; | ||
width: 100%; | ||
.settings-container { | ||
position: fixed; | ||
min-width: 500px; | ||
width: 500px; | ||
height: 50px; | ||
bottom: 0px; | ||
border: 1px solid rgba(100, 108, 255, 0.8); | ||
box-shadow: rgba(100, 108, 255, 1.0) 0px 6px 18px 0px; | ||
box-shadow: rgba(100, 108, 255, 1) 0px 6px 18px 0px; | ||
background: #fff; | ||
border-bottom-left-radius: 10px; | ||
border-bottom-right-radius: 10px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
.settings-icon { | ||
margin-left: 20px; | ||
.settings { | ||
padding: 10px 20px; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
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,4 +1,6 @@ | ||
- [ ] export/import notes' data by json | ||
- [x] export | ||
- [ ] import | ||
- [ ] more precise rects selection rather than coor (select the real dom by text) | ||
- [ ] screenshot features | ||
- https://javascript.plainenglish.io/a-better-alternative-to-html2canvas-in-vuejs-3-e0686755d56e |
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