Skip to content

Commit

Permalink
fix: rename cls of bookmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Jambo2018 committed Sep 16, 2023
1 parent 7b0c503 commit c62e2d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "typing-assistant",
"name": "Typing Assistant",
"version": "0.1.8",
"version": "0.1.9",
"minAppVersion": "0.15.0",
"description": "Support multiple shortcut menus to improve input efficiency",
"author": "Jambo",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typing-assistant",
"version": "0.1.8",
"version": "0.1.9",
"description": "Notion Assistant is a plugin that improves input efficiency and provides a user experience similar to that of【Notion】",
"main": "main.js",
"scripts": {
Expand Down
16 changes: 8 additions & 8 deletions src/link-bookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ export const generateBookMark = (content: string): HTMLDivElement => {
obj[key] = value;
});
const linkDiv = createDiv();
linkDiv.setAttribute("class", "bookmark");
linkDiv.setAttribute("class", "ta-bookmark");
linkDiv.onclick = () => {
window.open(obj.url);
};
const contentDiv = createDiv({ parent: linkDiv, cls: "bookmark-content" });
const contentDiv = createDiv({ parent: linkDiv, cls: "ta-bookmark-content" });
if (obj.title) {
contentDiv.createDiv({ cls: "bookmark-title", text: obj.title });
contentDiv.createDiv({ cls: "ta-bookmark-title", text: obj.title });
}
if (obj.description) {
contentDiv.createDiv({
cls: "bookmark-description",
cls: "ta-bookmark-description",
text: obj.description,
});
}
const urlDiv = contentDiv.createDiv({ cls: "bookmark-url" });
const urlDiv = contentDiv.createDiv({ cls: "ta-bookmark-url" });
if (obj.logo) {
urlDiv.createDiv({
cls: "bookmark-url-logo",
cls: "ta-bookmark-url-logo",
attr: { style: `background-image: url('${obj.logo}')` },
});
}
urlDiv.createSpan({ cls: "bookmark-url-text", text: obj.url });
urlDiv.createSpan({ cls: "ta-bookmark-url-text", text: obj.url });
if(obj.coverImg){
linkDiv.createDiv({cls:"bookmark-cover",attr:{style:`background-image: url('${obj.coverImg}')`}})
linkDiv.createDiv({cls:"ta-bookmark-cover",attr:{style:`background-image: url('${obj.coverImg}')`}})
}
return linkDiv;
};
20 changes: 10 additions & 10 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
height: 18px;
}

.bookmark {
.ta-bookmark {
display: flex;
box-sizing: border-box;
width: 100%;
Expand All @@ -64,15 +64,15 @@
border-radius: 3px;
cursor: pointer;
}
.bookmark:hover {
.ta-bookmark:hover {
border: none;
}
.bookmark-content {
.ta-bookmark-content {
flex: 2;
padding: 16px;
overflow: hidden;
}
.bookmark-title {
.ta-bookmark-title {
min-height: 24px;
margin-bottom: 2px;
overflow: hidden;
Expand All @@ -81,42 +81,42 @@
white-space: nowrap;
text-overflow: ellipsis;
}
.bookmark-description {
.ta-bookmark-description {
height: 32px;
overflow: hidden;
color: var(--bookmark-subtitle);
font-size: 12px;
line-height: 16px;
opacity: 0.65;
}
.bookmark-url {
.ta-bookmark-url {
display: flex;
align-items: center;
margin-top: 6px;
}
.bookmark-url-logo {
.ta-bookmark-url-logo {
width: 16px;
height: 16px;
margin-right: 6px;
background-repeat: no-repeat;
background-position: center;
background-size: contain;
}
.bookmark-url-text {
.ta-bookmark-url-text {
overflow: hidden;
color: var(--bookmark-title);
font-size: 12px;
white-space: nowrap;
text-overflow: ellipsis;
}
.bookmark-cover {
.ta-bookmark-cover {
flex: 1;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
@media screen and (max-width: 400px) {
.bookmark-cover {
.ta-bookmark-cover {
display: none;
}
}
Expand Down

0 comments on commit c62e2d9

Please sign in to comment.