url specific values can be added by hitting enter in the input

This commit is contained in:
kkapsner 2018-10-15 08:53:07 +02:00
parent dae401acf8
commit 16b4bbcab3
2 changed files with 12 additions and 6 deletions

View File

@ -222,17 +222,23 @@
footCell.colSpan = 3;
let newInput = document.createElement("input");
newInput.title = browser.i18n.getMessage("inputURL");
footCell.appendChild(newInput);
let footPlus = document.createElement("span");
footPlus.classList.add("add");
footPlus.textContent = "+";
footPlus.addEventListener("click", function(){
const addURLSetting = function(){
var url = newInput.value.trim();
if (url){
setting.set(setting.get(url), url);
newInput.value = "";
}
};
newInput.addEventListener("keypress", function(event){
if ([10, 13].indexOf(event.keyCode) !== -1){
addURLSetting();
}
});
footCell.appendChild(newInput);
let footPlus = document.createElement("span");
footPlus.classList.add("add");
footPlus.textContent = "+";
footPlus.addEventListener("click", addURLSetting);
footCell.appendChild(footPlus);
footRow.appendChild(footCell);
foot.appendChild(footRow);

View File

@ -3,7 +3,7 @@ Version 0.5.6:
-
new features:
-
- url specific values can be added by hitting enter in the input
fixes:
-