Upload files to "js"
This commit is contained in:
74
js/content.js
Normal file
74
js/content.js
Normal file
@@ -0,0 +1,74 @@
|
||||
let data = sessionStorage.getItem("PDSEtoken");
|
||||
|
||||
let currentLine = "";
|
||||
let dropdownState = 0;
|
||||
|
||||
var port = chrome.runtime.connect({ name: "port" });
|
||||
let stacjaReq = 0;
|
||||
|
||||
let MapOn = false;
|
||||
let MapData;
|
||||
const geoButton = document.createElement("button");
|
||||
const googleButton = document.createElement("button");
|
||||
const isokButton = document.createElement("button");
|
||||
const sopoButton = document.createElement("button");
|
||||
const gdosButton = document.createElement("button");
|
||||
const drogiButton = document.createElement("button");
|
||||
const dzialkiButton = document.createElement("button");
|
||||
const dzialki2Button = document.createElement("button");
|
||||
const osuwiskaButton = document.createElement("button");
|
||||
const mpzpButton = document.createElement("button");
|
||||
|
||||
const dropdownButton = document.createElement("div");
|
||||
|
||||
const sectionDraw = document.createElement("button");
|
||||
const sectionDownload = document.createElement("button");
|
||||
|
||||
const posButton = document.createElement("button");
|
||||
const lineButton = document.createElement("button");
|
||||
|
||||
port.onMessage.addListener(function (msg) {
|
||||
handleMessage(msg);
|
||||
});
|
||||
|
||||
function purgeTable(attr) {
|
||||
while (attr.childNodes[1].childNodes.length > 18) {
|
||||
attr.childNodes[1].childNodes[
|
||||
attr.childNodes[1].childNodes.length - 1
|
||||
].remove();
|
||||
}
|
||||
}
|
||||
|
||||
function drawButton(attr) {
|
||||
const row = attr.insertRow(-1);
|
||||
const cell1 = row.insertCell(0);
|
||||
const cell2 = row.insertCell(1);
|
||||
|
||||
const button = document.createElement("button");
|
||||
button.appendChild(document.createTextNode("Więcej"));
|
||||
cell1.appendChild(button);
|
||||
button.onclick = buttonClick;
|
||||
|
||||
function buttonClick() {
|
||||
stacjaReq = 1;
|
||||
row.remove();
|
||||
port.postMessage({ response: "fetchStacja" });
|
||||
}
|
||||
}
|
||||
|
||||
function insertRow(parent, txt1, txt2) {
|
||||
const row = parent.insertRow(-1);
|
||||
const cell1 = row.insertCell(0);
|
||||
const cell2 = row.insertCell(1);
|
||||
|
||||
cell1.innerHTML = txt1;
|
||||
cell2.innerHTML = txt2;
|
||||
}
|
||||
|
||||
function insertRows(parent, txts1, txts2) {
|
||||
if (txts1.length == txts2.length) {
|
||||
for (const txt in txts1) {
|
||||
insertRow(parent, txts1[txt], txts2[txt]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user