Skip to content

Commit

Permalink
Fixing Issue with Saving
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekBoySupreme committed Nov 18, 2020
1 parent 3fad250 commit 57e7478
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 20 deletions.
33 changes: 21 additions & 12 deletions tabtrum/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
{
"manifest_version": 2,
"name": "TabTrum",
"version": "1.0.0",
"description": "Save & Launch your Browser Tab Combinations in a blink.",
"permissions": ["tabs", "storage", "<all_urls>"],

"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"128": "tabtrum_128.png"
}
"manifest_version": 2,
"name": "TabTrum",
"version": "1.1.1",
"description": "Save & Launch your Browser Tab Combinations in a blink.",
"permissions": [
"tabs",
"storage",
"<all_urls>"
],
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"128": "tabtrum_128.png"
},
"icons": {
"16": "tabtrum_16.png",
"32": "tabtrum_32.png",
"48": "tabtrum_48.png",
"128": "tabtrum_128.png"
}
}
}
}
36 changes: 28 additions & 8 deletions tabtrum/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ document.addEventListener(
else if (action == "launch") clickLaunch(snapshot_index);
else if (action == "edit") clickEdit(snapshot_index);
else if (action == "back") getBackHome();
else if (action == "tabedit") update_snapshot_name(event.target.id, snapshot_index);
else return;
},
false
Expand Down Expand Up @@ -252,16 +253,17 @@ function clickEdit(snapshot_edit) {

var input_field = document.createElement("input");
input_field.setAttribute("class", "tab_edit_title");
input_field.setAttribute("id", "tablist_tabedit_id_" + index);
input_field.setAttribute("value", tabs_to_expand.title);

input_field.addEventListener("input", function () {
var new_items = items;
console.log(items.data[index]);
new_items.data[index].title = input_field.value;
// input_field.addEventListener("input", function () {
// var new_items = items;
// console.log(items.data[index]);
// new_items.data[index].title = input_field.value;

setData(new_items.data);
loadData();
});
// setData(new_items.data);
// loadData();
// });

var para = document.createElement("p");
var text = document.createTextNode("☑️ changes are saved automatically.");
Expand All @@ -275,7 +277,7 @@ function clickEdit(snapshot_edit) {
tablistshowhtml += '<div class="tablist_tab_show"> \
<a target="_blank" href="'+ tabs_list_show[q].url + '"> \
<img class="favicon_image" src="' + tabs_list_show[q].favIconUrl + '"/> \
<span class="tab_title">' + (tabs_list_show[q].title).substring(0, 25) + '..</span> \
<span class="tab_title">' + (tabs_list_show[q].title).substring(0, 30) + '..</span> \
</a> \
\
</div > '
Expand Down Expand Up @@ -370,4 +372,22 @@ function getBackHome() {
document.getElementById("snapshot_profile_edit").style.display = "none";
document.getElementById("snapshot_list").style.display = "flex";
document.getElementById("footer").style.display = "block";
}

function update_snapshot_name(target_id, snapshot_index) {
var input_field = document.getElementById(target_id);
console.log(snapshot_index);

chrome.storage.local.get(["data"], function (items) {
var index = snapshot_index;
var new_items = items;
//console.log(items.data[index]);

input_field.addEventListener("input", function () {
new_items.data[snapshot_index].title = input_field.value;

setData(new_items.data);
loadData();
});
});
}
1 change: 1 addition & 0 deletions tabtrum/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ button:hover, button:active {
color: white;
position: relative;
top: -4px;
font-weight: 600;
transition: all 0.2s ease;
}

Expand Down
Binary file added tabtrum/tabtrum_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tabtrum/tabtrum_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tabtrum/tabtrum_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 57e7478

Please sign in to comment.