Skip to content

Commit c5f97f4

Browse files
committed
Add current profile label and improve profile input prompts
1 parent a9bffdb commit c5f97f4

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

popup-page-scripts/popup-page-script.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let saveTimeoutId = null;
1616

1717
// DOM Elements
1818
const profileSelect = document.getElementById('profileSelect');
19+
const currentProfileLabel = document.getElementById('currentProfileLabel');
1920
const buttonCardsList = document.getElementById('buttonCardsList');
2021
const consoleOutput = document.getElementById('console');
2122
const saveStatus = document.getElementById('saveStatus');
@@ -193,6 +194,7 @@ document.addEventListener('DOMContentLoaded', () => {
193194
copyProfileContainer.style.display = 'none';
194195
deleteProfileButton.style.display = 'none'; // Hide delete button during add
195196
profileSelect.disabled = true; // Lock profile selector
197+
currentProfileLabel.style.display = 'inline-block';
196198
});
197199

198200
// Copy Profile Button Click
@@ -203,6 +205,7 @@ document.addEventListener('DOMContentLoaded', () => {
203205
addProfileContainer.style.display = 'none';
204206
deleteProfileButton.style.display = 'none'; // Hide delete button during copy
205207
profileSelect.disabled = true; // Lock profile selector
208+
currentProfileLabel.style.display = 'inline-block';
206209
});
207210

208211
// Save Add Profile Button Click
@@ -227,6 +230,7 @@ document.addEventListener('DOMContentLoaded', () => {
227230
copyProfileButton.style.display = 'inline-block';
228231
deleteProfileButton.style.display = 'inline-block'; // Show delete button after add
229232
profileSelect.disabled = false; // Unlock profile selector
233+
currentProfileLabel.style.display = 'none';
230234
});
231235

232236
// Save Copy Profile Button Click
@@ -251,6 +255,7 @@ document.addEventListener('DOMContentLoaded', () => {
251255
addProfileButton.style.display = 'inline-block';
252256
deleteProfileButton.style.display = 'inline-block'; // Show delete button after copy
253257
profileSelect.disabled = false; // Unlock profile selector
258+
currentProfileLabel.style.display = 'none';
254259
});
255260

256261
// Delete Profile Button Click
@@ -263,6 +268,7 @@ document.addEventListener('DOMContentLoaded', () => {
263268
copyProfileButton.style.display = 'inline-block';
264269
deleteProfileButton.style.display = 'inline-block'; // Show delete button
265270
profileSelect.disabled = false; // Unlock profile selector
271+
currentProfileLabel.style.display = 'none';
266272
});
267273

268274
// Cancel Copy Profile Button Click
@@ -272,6 +278,7 @@ document.addEventListener('DOMContentLoaded', () => {
272278
copyProfileButton.style.display = 'inline-block';
273279
deleteProfileButton.style.display = 'inline-block'; // Show delete button
274280
profileSelect.disabled = false; // Unlock profile selector
281+
currentProfileLabel.style.display = 'none';
275282
});
276283

277284
// Button management

popup-page-styles/popup-layout.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,10 @@ select:focus {
105105
background: #cccccc;
106106
cursor: not-allowed;
107107
}
108+
109+
/* Label for providing context to the profile selector when it's disabled */
110+
.profile-context-label {
111+
align-self: center;
112+
margin-right: 8px;
113+
font-weight: 500;
114+
}

popup.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<section class="section">
2525
<h2>Profile</h2>
2626
<div class="row">
27+
<label for="profileSelect" id="currentProfileLabel" class="profile-context-label" style="display: none;">Your current profile:</label>
2728
<select
2829
id="profileSelect"
2930
title="Select profile"
@@ -71,7 +72,7 @@ <h2>Profile</h2>
7172
class="profile-action-container"
7273
style="display: none"
7374
>
74-
<label for="addProfileInput">Enter profile name:</label>
75+
<label for="addProfileInput">Enter new profile name:</label>
7576
<input
7677
type="text"
7778
id="addProfileInput"
@@ -98,12 +99,12 @@ <h2>Profile</h2>
9899
class="profile-action-container"
99100
style="display: none"
100101
>
101-
<label for="copyProfileInput">Enter new profile name:</label>
102+
<label for="copyProfileInput">Enter duplicate profile name:</label>
102103
<input
103104
type="text"
104105
id="copyProfileInput"
105-
placeholder="Enter new profile name here"
106-
title="New profile name"
106+
placeholder="Enter duplicate profile name here"
107+
title="Name for the duplicated profile"
107108
/>
108109
<button id="saveCopyProfile">Save</button>
109110
<button id="cancelCopyProfile" class="danger">Cancel</button>
@@ -512,4 +513,4 @@ <h2>Theme</h2>
512513
<script src="/popup-page-scripts/popup-page-floating-window-handler.js"></script>
513514
</body>
514515
</html>
515-
</html>
516+
</html>

0 commit comments

Comments
 (0)