Skip to content

Commit 8e743ab

Browse files
authored
Merge pull request #76 from vedansh-5/standalone
UI extension, standalone scrum report
2 parents f09ebdc + f11b51b commit 8e743ab

File tree

6 files changed

+249
-232
lines changed

6 files changed

+249
-232
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434
- Ensure the Scrum Helper settings are applied (follow step 6 above)
3535
- The extension will prefill scrum content for you to edit
3636

37+
### New Features
38+
1. **Standalone Popup Interface**
39+
- Generate reports directly from the extension popup
40+
- Live preview of the report before sending
41+
- Rich text formatting with clickable links
42+
- Copy report to clipboard with proper formatting
43+
44+
### Usage Standalone
45+
- Click on `GENERATE` button to generate the scrum preview.
46+
- Edit it in the window.
47+
- Copy the rich HTML using the `COPY` button.
48+
3749
## Setting up the code locally
3850

3951
```
@@ -48,6 +60,8 @@ $ npm install
4860

4961
![POPUP](/docs/images/popup.png)
5062

63+
![STANDALONE](docs/images/standalone.png)
64+
5165
## Using Scrum Helper with Your Own GitHub Organization
5266

5367
Scrum Helper is not limited to the [FOSSASIA](https://github.com/fossasia) organization. You can easily configure it to fetch and generate SCRUM reports for your own GitHub organization or repositories.
@@ -82,7 +96,6 @@ Scrum Helper is not limited to the [FOSSASIA](https://github.com/fossasia) organ
8296
4. **Get Customized SCRUM Reports**
8397
- The reports will now be generated using contributions from your organization.
8498

85-
---
8699

87100
## About contributing
88101

docs/images/standalone.png

68.4 KB
Loading

src/index.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,25 @@ li {
6464
transition: color 0.3s ease-in-out, font-weight 0.3s ease-in-out;
6565
}
6666

67+
#scrumReport {
68+
border: 1px solid #ccc;
69+
padding: 10px;
70+
min-height: 200px;
71+
max-height: 400px;
72+
overflow-y: auto;
73+
background-color: white;
74+
}
75+
76+
#scrumReport:focus {
77+
outline: none;
78+
border-color: #26a69a;
79+
}
80+
81+
#scrumReport a {
82+
color: #26a69a;
83+
text-decoration: none;
84+
}
85+
86+
#scrumReport a:hover {
87+
text-decoration: underline;
88+
}

src/popup.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ <h6 class="center">
7373
<input placeholder="Reason" id="userReason" type="text">
7474
<label for="userReason">What is stopping you from doing your work?</label>
7575
</div>
76+
<div>
77+
<h6>Scrum Report</h3>
78+
<div id="scrumReport" contenteditable="true"
79+
class="materialize-textarea border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2"
80+
style="min-height: 200px; overflow-y: auto; white-space: pre-wrap;">
81+
</div>
82+
</div>
83+
<div style="display: flex; justify-content: space-between; gap: 10px;">
84+
<button id="generateReport" class="btn waves-effect waves-light">
85+
<i class="fa fa-refresh"></i> Generate Report
86+
</button>
87+
<button id="copyReport" class="btn waves-effect waves-light">
88+
<i class="fa fa-copy"></i> Copy Report
89+
</button>
90+
91+
</div>
7692
<div class="col s12">
7793

7894
<h5>Note:</h5>
@@ -96,6 +112,8 @@ <h6>
96112
</div>
97113
<script src="scripts/jquery-3.2.1.min.js"></script>
98114
<script type="text/javascript" type="text/javascript" src="materialize/js/materialize.min.js"></script>
115+
<script src="scripts/scrumHelper.js"></script>
99116
<script src="scripts/main.js"></script>
117+
<script src="scripts/popup.js"></script>
100118
</body>
101119
</html>

src/scripts/popup.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
const generateBtn = document.getElementById('generateReport');
3+
const copyBtn = document.getElementById('copyReport');
4+
5+
generateBtn.addEventListener('click', function() {
6+
this.innerHTML = '<i class="fa fa-spinner fa-spin"></i> Generating...';
7+
this.disabled = true;
8+
9+
window.generateScrumReport();
10+
});
11+
12+
copyBtn.addEventListener('click', function() {
13+
const scrumReport = document.getElementById('scrumReport');
14+
15+
// Create container for HTML content
16+
const tempDiv = document.createElement('div');
17+
tempDiv.innerHTML = scrumReport.innerHTML;
18+
document.body.appendChild(tempDiv);
19+
tempDiv.style.position = 'absolute';
20+
tempDiv.style.left = '-9999px';
21+
22+
// Select the content
23+
const range = document.createRange();
24+
range.selectNode(tempDiv);
25+
const selection = window.getSelection();
26+
selection.removeAllRanges();
27+
selection.addRange(range);
28+
29+
try {
30+
// Copy HTML content
31+
const success = document.execCommand('copy');
32+
if (!success) {
33+
throw new Error('Copy command failed');
34+
}
35+
Materialize.toast('Report copied with formatting!', 3000, 'green');
36+
} catch (err) {
37+
console.error('Failed to copy:', err);
38+
Materialize.toast('Failed to copy report', 3000, 'red');
39+
} finally {
40+
// Cleanup
41+
selection.removeAllRanges();
42+
document.body.removeChild(tempDiv);
43+
}
44+
});
45+
});

0 commit comments

Comments
 (0)