Skip to content
This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Commit 25daf81

Browse files
author
WendelinPraktikum
authored
Merge pull request #3 from aboutsource/feature/5252
Feature/5252
2 parents 1415ad1 + 879e0b3 commit 25daf81

1 file changed

Lines changed: 28 additions & 1 deletion

File tree

content_script.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
//TODO: Code, der auf trello.com ausgeführt wird
1+
function addButton(){
2+
const sidebar = document.querySelector(".window-sidebar")
3+
const button = document.createElement('span');
4+
button.classList.add('button-link');
5+
button.addEventListener('click', onClick);
6+
sidebar.prepend(button);
7+
8+
const buttonIcon = document.createElement('span');
9+
buttonIcon.classList.add('icon-sm', 'plugin-icon');
10+
buttonIcon.innerText = '+';
11+
button.append(buttonIcon);
12+
13+
const buttonText = document.createElement('span');
14+
buttonText.innerText = 'Toggl Task';
15+
button.append(buttonText);
16+
17+
sidebar.querySelector(".js-sidebar-add-heading").classList.remove("mod-no-top-margin")
18+
}
19+
20+
function onClick(){
21+
alert("work in progress ;)")
22+
}
23+
24+
window.addEventListener("pushstate", function(){
25+
if(window.location.pathname.startsWith("/c/")){
26+
addButton()
27+
}
28+
})

0 commit comments

Comments
 (0)