tangled
alpha
login
or
join now
dunkirk.sh
/
bunplayground
1
fork
atom
random bun scripts that dont fit anywhere else
1
fork
atom
overview
issues
pulls
pipelines
chore: remove pills
dunkirk.sh
11 months ago
01aa2d42
61b52d3d
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+1
-139
1 changed file
expand all
collapse all
unified
split
bluesky-community-verifications.user.js
+1
-139
bluesky-community-verifications.user.js
···
201
201
202
202
console.log(`${profileDid} is not verified by any trusted users`);
203
203
204
204
-
// Add recheck button even when no verifications are found
205
205
-
createPillButtons();
206
206
-
207
204
return false;
208
205
};
209
206
210
210
-
// Function to create a pill with recheck and settings buttons
211
211
-
const createPillButtons = () => {
212
212
-
// Remove existing buttons if any
213
213
-
const existingPill = document.getElementById(
214
214
-
"trusted-users-pill-container",
215
215
-
);
216
216
-
if (existingPill) {
217
217
-
existingPill.remove();
218
218
-
}
219
219
-
220
220
-
// Create pill container
221
221
-
const pillContainer = document.createElement("div");
222
222
-
pillContainer.id = "trusted-users-pill-container";
223
223
-
pillContainer.style.cssText = `
224
224
-
position: fixed;
225
225
-
bottom: 20px;
226
226
-
right: 20px;
227
227
-
z-index: 10000;
228
228
-
display: flex;
229
229
-
border-radius: 20px;
230
230
-
overflow: hidden;
231
231
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
232
232
-
`;
233
233
-
234
234
-
// Create recheck button (left half of pill)
235
235
-
const recheckButton = document.createElement("button");
236
236
-
recheckButton.id = "trusted-users-recheck-button";
237
237
-
recheckButton.innerHTML = "↻ Recheck";
238
238
-
recheckButton.style.cssText = `
239
239
-
padding: 10px 15px;
240
240
-
background-color: #2D578D;
241
241
-
color: white;
242
242
-
border: none;
243
243
-
cursor: pointer;
244
244
-
font-weight: bold;
245
245
-
border-top-left-radius: 20px;
246
246
-
border-bottom-left-radius: 20px;
247
247
-
`;
248
248
-
249
249
-
// Add click event to recheck
250
250
-
recheckButton.addEventListener("click", async () => {
251
251
-
if (currentProfileDid) {
252
252
-
// Remove any existing badges when rechecking
253
253
-
const existingBadge = document.getElementById(
254
254
-
"user-trusted-verification-badge",
255
255
-
);
256
256
-
if (existingBadge) {
257
257
-
existingBadge.remove();
258
258
-
}
259
259
-
260
260
-
// Show loading state
261
261
-
recheckButton.innerHTML = "⟳ Checking...";
262
262
-
recheckButton.disabled = true;
263
263
-
264
264
-
// Recheck verifications
265
265
-
await checkTrustedUserVerifications(currentProfileDid);
266
266
-
267
267
-
// Reset button
268
268
-
recheckButton.innerHTML = "↻ Recheck";
269
269
-
recheckButton.disabled = false;
270
270
-
}
271
271
-
});
272
272
-
273
273
-
// Create vertical divider
274
274
-
const divider = document.createElement("div");
275
275
-
divider.style.cssText = `
276
276
-
width: 1px;
277
277
-
background-color: rgba(255, 255, 255, 0.3);
278
278
-
`;
279
279
-
280
280
-
// Create settings button (right half of pill)
281
281
-
const settingsButton = document.createElement("button");
282
282
-
settingsButton.id = "bsky-trusted-settings-button";
283
283
-
settingsButton.textContent = "Settings";
284
284
-
settingsButton.style.cssText = `
285
285
-
padding: 10px 15px;
286
286
-
background-color: #2D578D;
287
287
-
color: white;
288
288
-
border: none;
289
289
-
cursor: pointer;
290
290
-
font-weight: bold;
291
291
-
border-top-right-radius: 20px;
292
292
-
border-bottom-right-radius: 20px;
293
293
-
`;
294
294
-
295
295
-
// Add elements to pill
296
296
-
pillContainer.appendChild(recheckButton);
297
297
-
pillContainer.appendChild(divider);
298
298
-
pillContainer.appendChild(settingsButton);
299
299
-
300
300
-
// Add pill to page
301
301
-
document.body.appendChild(pillContainer);
302
302
-
303
303
-
// Add event listener to settings button
304
304
-
settingsButton.addEventListener("click", () => {
305
305
-
if (settingsModal) {
306
306
-
settingsModal.style.display = "flex";
307
307
-
updateTrustedUsersList();
308
308
-
} else {
309
309
-
createSettingsModal();
310
310
-
}
311
311
-
});
312
312
-
};
313
313
-
314
207
// Function to display verification badge on the profile
315
208
const displayVerificationBadge = (verifierHandles) => {
316
209
// Find the profile header or name element to add the badge to
···
364
257
365
258
nameElement.appendChild(badge);
366
259
}
367
367
-
368
368
-
// Also add pill buttons when verification is found
369
369
-
createPillButtons();
370
260
};
371
261
372
262
// Function to show a popup with all verifiers
···
983
873
updateTrustedUsersList();
984
874
};
985
875
986
986
-
// Function to create the settings UI if it doesn't exist yet
987
987
-
const createSettingsUI = () => {
988
988
-
// Create pill with buttons
989
989
-
createPillButtons();
990
990
-
991
991
-
// Create the settings modal if it doesn't exist yet
992
992
-
if (!settingsModal) {
993
993
-
createSettingsModal();
994
994
-
}
995
995
-
};
996
996
-
997
876
// Function to check the current profile
998
877
const checkCurrentProfile = () => {
999
878
const currentUrl = window.location.href;
···
1005
884
) {
1006
885
const handle = currentUrl.split("/profile/")[1].split("/")[0];
1007
886
console.log("Detected profile page for:", handle);
1008
1008
-
1009
1009
-
// Create and add the settings UI (only once)
1010
1010
-
createSettingsUI();
1011
887
1012
888
// Fetch user profile data
1013
889
fetch(
···
1040
916
);
1041
917
if (existingBadge) {
1042
918
existingBadge.remove();
1043
1043
-
}
1044
1044
-
1045
1045
-
const existingPill = document.getElementById(
1046
1046
-
"trusted-users-pill-container",
1047
1047
-
);
1048
1048
-
if (existingPill) {
1049
1049
-
existingPill.remove();
1050
919
}
1051
920
}
1052
921
};
···
1278
1147
existingBadge.remove();
1279
1148
}
1280
1149
1281
1281
-
const existingPill = document.getElementById(
1282
1282
-
"trusted-users-pill-container",
1283
1283
-
);
1284
1284
-
if (existingPill) {
1285
1285
-
existingPill.remove();
1286
1286
-
}
1287
1287
-
1288
1150
// Check if we're on a profile page now
1289
1151
setTimeout(checkCurrentProfile, 500); // Small delay to ensure DOM has updated
1290
1152
1291
1153
if (window.location.href.includes("bsky.app/settings")) {
1292
1154
// Give the page a moment to fully load
1293
1293
-
setTimeout(addSettingsButton, 500);
1155
1155
+
setTimeout(addSettingsButton, 200);
1294
1156
}
1295
1157
}
1296
1158
});