Skip to content

Commit

Permalink
yay
Browse files Browse the repository at this point in the history
  • Loading branch information
lectrician1 committed Aug 9, 2022
1 parent 133128b commit 83f898b
Show file tree
Hide file tree
Showing 11 changed files with 3,837 additions and 327 deletions.
File renamed without changes.
402 changes: 402 additions & 0 deletions complete/discographies.js

Large diffs are not rendered by default.

420 changes: 420 additions & 0 deletions complete/discographies.ts

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions idToLabelNotifications.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
jQuery(() => {
$('.mw-echo-ui-notificationBadgeButtonPopupWidget-notice a').on('click', () => {
var entities: string[] = [];

$('.mw-echo-ui-notificationBadgeButtonPopupWidget-popup strong').each((index, element) => {
if (element.innerText.includes('Q') || element.innerText.includes('L') || element.innerText.includes('P')) {
entities.push(element.innerText)
}
})

var api = new mw.Api();

const d = await api.get({
action: 'wbgetentities',
ids: entities,
format: 'json'
}).promise()

const userLanguages = OO.ui.getUserLanguages();

$.each(d.entities, function (entityID, entity) {
entityID = String(entityID)
for (let language of userLanguages) {
if (entity.labels[language]) {
$(`.mw-echo-ui-notificationBadgeButtonPopupWidget-popup strong:contains('${entityID}')`).val(`${entity.labels[language].value} (${entityID})`)
break;
}
}
});
})
})
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "easywikidev",
"version": "1.0.0",
"description": "Develop Wikipedia userscripts quickly with Visual Studio Code",
"main": "script.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lectrician1/EasyWikiDev.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/lectrician1/EasyWikiDev/issues"
},
"homepage": "https://github.com/lectrician1/EasyWikiDev#readme",
"dependencies": {
"@wikimedia/types-wikimedia": "^0.3.4"
}
}
Loading

0 comments on commit 83f898b

Please sign in to comment.