added data
This commit is contained in:
parent
e7cd352538
commit
92cc5a4ec4
5 changed files with 49 additions and 16 deletions
Binary file not shown.
|
|
@ -7,11 +7,11 @@
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
|
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "images/icon-48.png",
|
"48": "Assets.xcassets/icon-48.imageset/icon-48.png",
|
||||||
"96": "images/icon-96.png",
|
"96": "Assets.xcassets/icon-96.imageset/icon-96.png",
|
||||||
"128": "images/icon-128.png",
|
"128": "Assets.xcassets/icon-128.imageset/icon-128.png",
|
||||||
"256": "images/icon-256.png",
|
"256": "Assets.xcassets/icon-256.imageset/icon-256.png",
|
||||||
"512": "images/icon-512.png"
|
"512": "Assets.xcassets/icon-512.imageset/icon-512.png"
|
||||||
},
|
},
|
||||||
|
|
||||||
"background": {
|
"background": {
|
||||||
|
|
@ -27,12 +27,12 @@
|
||||||
"action": {
|
"action": {
|
||||||
"default_popup": "popup.html",
|
"default_popup": "popup.html",
|
||||||
"default_icon": {
|
"default_icon": {
|
||||||
"16": "images/toolbar-icon-16.png",
|
"16": "Assets.xcassets/toolbar-icon-16.imageset/toolbar-icon-16.png",
|
||||||
"19": "images/toolbar-icon-19.png",
|
"19": "Assets.xcassets/toolbar-icon-19.imageset/toolbar-icon-19.png",
|
||||||
"32": "images/toolbar-icon-32.png",
|
"32": "Assets.xcassets/toolbar-icon-32.imageset/toolbar-icon-32.png",
|
||||||
"38": "images/toolbar-icon-38.png",
|
"38": "Assets.xcassets/toolbar-icon-38.imageset/toolbar-icon-38.png",
|
||||||
"48": "images/toolbar-icon-48.png",
|
"48": "Assets.xcassets/toolbar-icon-48.imageset/toolbar-icon-48.png",
|
||||||
"72": "images/toolbar-icon-72.png"
|
"72": "Assets.xcassets/toolbar-icon-72.imageset/toolbar-icon-72.png"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,29 @@ button:hover {
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#result.success {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result.success .status {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-color);
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
#result.success .url {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--url-color);
|
||||||
|
word-break: break-all;
|
||||||
|
padding: 8px;
|
||||||
|
background-color: var(--url-background);
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
.history-section {
|
.history-section {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
|
|
@ -86,6 +109,7 @@ button:hover {
|
||||||
--history-background: #2c2c2e;
|
--history-background: #2c2c2e;
|
||||||
--border-color: #3a3a3c;
|
--border-color: #3a3a3c;
|
||||||
--url-color: #8e8e93;
|
--url-color: #8e8e93;
|
||||||
|
--url-background: #2c2c2e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,6 +120,7 @@ button:hover {
|
||||||
--result-background: #f2f2f7;
|
--result-background: #f2f2f7;
|
||||||
--history-background: #f2f2f7;
|
--history-background: #f2f2f7;
|
||||||
--border-color: #c7c7cc;
|
--border-color: #c7c7cc;
|
||||||
--url-color: #8e8e93;
|
--url-color: #007AFF;
|
||||||
|
--url-background: #f2f2f7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,23 +25,31 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
if (response && !response.startsWith("Error:")) {
|
if (response && !response.startsWith("Error:")) {
|
||||||
navigator.clipboard.writeText(response)
|
navigator.clipboard.writeText(response)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
resultDiv.textContent = `URL acortada y copiada: ${response}`;
|
resultDiv.className = 'success';
|
||||||
resultDiv.style.color = 'green';
|
resultDiv.innerHTML = `
|
||||||
|
<div class="status">URL acortada y copiada al portapapeles</div>
|
||||||
|
<div class="url">${response}</div>
|
||||||
|
`;
|
||||||
saveToHistory(response);
|
saveToHistory(response);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error("Error al copiar al portapapeles:", err);
|
console.error("Error al copiar al portapapeles:", err);
|
||||||
resultDiv.textContent = `URL acortada: ${response} (No se pudo copiar)`;
|
resultDiv.className = 'success';
|
||||||
resultDiv.style.color = 'orange';
|
resultDiv.innerHTML = `
|
||||||
|
<div class="status">URL acortada (no se pudo copiar)</div>
|
||||||
|
<div class="url">${response}</div>
|
||||||
|
`;
|
||||||
saveToHistory(response);
|
saveToHistory(response);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
resultDiv.className = '';
|
||||||
resultDiv.textContent = `Error: ${response}`;
|
resultDiv.textContent = `Error: ${response}`;
|
||||||
resultDiv.style.color = 'red';
|
resultDiv.style.color = 'red';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error("Error en el proceso:", error);
|
console.error("Error en el proceso:", error);
|
||||||
|
resultDiv.className = '';
|
||||||
resultDiv.textContent = "Error al acortar la URL: " + error.message;
|
resultDiv.textContent = "Error al acortar la URL: " + error.message;
|
||||||
resultDiv.style.color = 'red';
|
resultDiv.style.color = 'red';
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Reference in a new issue