Added logic for the new target input
This commit is contained in:
parent
ce2cdb98ff
commit
cb5cbace3d
8
main.js
8
main.js
|
@ -11,12 +11,15 @@ clipboard.on('success', function (e) {
|
|||
});
|
||||
});
|
||||
|
||||
chrome.tabs.query({ active: true, lastFocusedWindow: true }, tabs => {
|
||||
document.getElementById("target").value = tabs[0].url;
|
||||
});
|
||||
|
||||
// Calls the api to create a new short url
|
||||
document.getElementById("create").onclick = createUrl;
|
||||
function createUrl() {
|
||||
chrome.tabs.query({ active: true, lastFocusedWindow: true }, tabs => {
|
||||
let shorturl = {
|
||||
target: tabs[0].url,
|
||||
target: document.getElementById("target").value,
|
||||
shortcode: document.getElementById("shortcode").value
|
||||
};
|
||||
|
||||
|
@ -39,7 +42,6 @@ function createUrl() {
|
|||
document.getElementById("create").classList.add("hidden");
|
||||
document.getElementById("reset").classList.remove("hidden");
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue