제작자 추가
This commit is contained in:
parent
1be3c1cd98
commit
b787faec0c
Binary file not shown.
31
content.js
31
content.js
|
|
@ -23,7 +23,7 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
tooltipEl.style.color = "#333";
|
||||
tooltipEl.style.maxWidth = "600px";
|
||||
tooltipEl.style.maxHeight = "500px";
|
||||
// 전체 툴팁 컨테이너에 flex 컬럼 레이아웃
|
||||
// flex 컬럼 레이아웃으로 구성
|
||||
tooltipEl.style.display = "flex";
|
||||
tooltipEl.style.flexDirection = "column";
|
||||
|
||||
|
|
@ -35,9 +35,10 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
headerDiv.style.background = "#fff";
|
||||
headerDiv.style.padding = "12px 16px";
|
||||
headerDiv.style.borderBottom = "1px solid #ccc";
|
||||
headerDiv.style.display = "flex";
|
||||
headerDiv.style.justifyContent = "space-between";
|
||||
headerDiv.style.alignItems = "center";
|
||||
// 헤더 내부: 검색 키워드와 제작자 정보를 수직 정렬
|
||||
const headerContent = document.createElement("div");
|
||||
headerContent.style.display = "flex";
|
||||
headerContent.style.flexDirection = "column";
|
||||
|
||||
// 검색 키워드 제목
|
||||
const titleElem = document.createElement("h2");
|
||||
|
|
@ -45,9 +46,19 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
titleElem.style.margin = "0";
|
||||
titleElem.style.fontSize = "20px";
|
||||
titleElem.style.color = "#2c3e50";
|
||||
headerDiv.appendChild(titleElem);
|
||||
headerContent.appendChild(titleElem);
|
||||
|
||||
// 내부 닫기 버튼 (헤더 내)
|
||||
// 제작자 정보 (작은 글씨)
|
||||
const creatorElem = document.createElement("span");
|
||||
creatorElem.id = "tooltip-creator";
|
||||
creatorElem.textContent = "내차는언제타냐: 지재권 검색기";
|
||||
creatorElem.style.fontSize = "12px";
|
||||
creatorElem.style.color = "#7f8c8d";
|
||||
headerContent.appendChild(creatorElem);
|
||||
|
||||
headerDiv.appendChild(headerContent);
|
||||
|
||||
// 내부 닫기 버튼 (헤더 우측)
|
||||
const headerCloseBtn = document.createElement("button");
|
||||
headerCloseBtn.textContent = "닫기";
|
||||
headerCloseBtn.style.padding = "6px 10px";
|
||||
|
|
@ -59,16 +70,16 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||
headerCloseBtn.onclick = removeTooltip;
|
||||
headerDiv.appendChild(headerCloseBtn);
|
||||
|
||||
// 스크롤되는 본문 영역
|
||||
// 본문 영역 (스크롤 가능)
|
||||
const bodyDiv = document.createElement("div");
|
||||
bodyDiv.id = "markinfo-tooltip-body";
|
||||
bodyDiv.style.padding = "16px";
|
||||
bodyDiv.style.overflowY = "auto";
|
||||
// 본문 영역은 전체 높이에서 헤더 높이를 뺀 만큼 사용
|
||||
bodyDiv.style.flex = "1 1 auto";
|
||||
|
||||
tooltipEl.appendChild(headerDiv);
|
||||
tooltipEl.appendChild(bodyDiv);
|
||||
|
||||
document.body.appendChild(tooltipEl);
|
||||
|
||||
// 글로벌 닫기 버튼 (항상 보이는 우측 상단)
|
||||
|
|
@ -105,7 +116,6 @@ function removeTooltip() {
|
|||
tooltipEl.parentNode.removeChild(tooltipEl);
|
||||
}
|
||||
tooltipEl = null;
|
||||
// 글로벌 닫기 버튼 제거
|
||||
const globalClose = document.getElementById("tooltip-global-close");
|
||||
if (globalClose && globalClose.parentNode) {
|
||||
globalClose.parentNode.removeChild(globalClose);
|
||||
|
|
@ -136,10 +146,11 @@ function renderDetailInfo(results, keyword) {
|
|||
const bodyDiv = document.getElementById("markinfo-tooltip-body");
|
||||
if (!bodyDiv) return;
|
||||
let html = `<div style="line-height: 1.6;">`;
|
||||
// 결과가 없을 경우 안전한 단어 표시
|
||||
if (results.error) {
|
||||
html += `<p style="color: red; font-weight: bold;">오류: ${results.error}</p>`;
|
||||
} else if (!Array.isArray(results) || results.length === 0) {
|
||||
html += `<p style="color: #7f8c8d;">검색 결과가 없습니다.</p>`;
|
||||
html += `<p style="color: #7f8c8d; font-style: italic;">지식재산권이 없는 안전한 단어</p>`;
|
||||
} else {
|
||||
results.forEach((result, idx) => {
|
||||
html += `<div style="margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #ecf0f1;">`;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"manifest_version": 3,
|
||||
"name": "지재권 검색 확장 (컨텍스트 메뉴)",
|
||||
"name": "내차는언제타냐 - 지재권 검색 확장 (컨텍스트 메뉴)",
|
||||
"version": "1.0",
|
||||
"description": "드래그한 텍스트를 우클릭 → '지재권 검색'으로 MarkInfo 검색을 수행하고 결과를 툴팁으로 표시합니다.",
|
||||
"permissions": [
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Loading…
Reference in New Issue