Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) No edit summary |
||
(11 intermediate revisions by the same user not shown) | |||
Line 60:
new OO.ui.LabelWidget({ label: 'Input usernames:' }),
inputField,
new OO.ui.Widget({ content: [new OO.ui.LabelWidget({ label: 'Status:' })] }),
statusMessage,
new OO.ui.Widget({ content: [new OO.ui.LabelWidget({ label: 'Progress:' })] }),
progressBar,
new OO.ui.Widget({ content: [new OO.ui.LabelWidget({ label: 'Results:' })] }),
outputField,
new OO.ui.Widget({ content: [new OO.ui.LabelWidget({ label: 'Actions:' })] }),
new OO.ui.HorizontalLayout({
items: [checkButton, clearButton, copyButton]
Line 73:
});
// Create a proper dialog class
function EditCountDialog(config) {
const dialog = new OO.ui.Dialog({▼
EditCountDialog.parent.call(this, config);
size: 'large',▼
classes: ['editcount-dialog']▼
OO.inheritClass(EditCountDialog, OO.ui.Dialog);
▲ });
EditCountDialog.static.name = 'editCountDialog';
EditCountDialog.static.title = 'User Edit Count Checker';
EditCountDialog.static.size = 'large';
this.content = new OO.ui.PanelLayout({
padded: true,
Line 89 ⟶ 92:
};
return
.next(function() {
inputField.focus();
});
};
EditCountDialog.prototype.getActionProcess = function(action) {
if (action === 'close') {
return new OO.ui.Process(function() {
this.close({ action: action });
}, this);
}
return EditCountDialog.parent.prototype.getActionProcess.call(this, action);
};
EditCountDialog.static.actions = [
{
action: 'close',
flags: ['safe', 'close']
}
];
▲ classes: ['editcount-dialog']
});
// Button event handlers
Line 129 ⟶ 153:
const windowManager = new OO.ui.WindowManager();
$(document.body).append(windowManager.$element);
windowManager.addWindows(
// Open dialog
windowManager.openWindow(
}
Line 159 ⟶ 183:
checkButton.setLabel('Checking...');
const
const errors = [];
Line 175 ⟶ 199:
try {
const editCount = await getUserEditCount(userInfo.username);
original: userInfo.original,
username: userInfo.username,
editCount: editCount
});
console.log(`✓ ${userInfo.username}: ${editCount.toLocaleString()} edits`);
} catch (error) {
console.error(`Failed to get edit count for ${userInfo.username}:`, error);
original: userInfo.original,
username: userInfo.username,
editCount: 0,
error: true
});
errors.push(userInfo.username);
}
Line 188 ⟶ 221:
}
}
// Sort by edit count (highest first)
userResults.sort((a, b) => b.editCount - a.editCount);
// Update UI with completion
Line 196 ⟶ 232:
copyButton.setDisabled(false);
// Display results (just usernames, but ordered by edit count)
const sortedUsernames = userResults.map(result => result.original);
outputField.setValue(
console.log("\n=== EDIT COUNT RESULTS (sorted by edit count) ===");
if (result.error) {
console.log(`${result.original}: ERROR`);
} else {
console.log(`${result.original}: ${result.editCount.toLocaleString()} edits`);
}
});
if (errors.length > 0) {
Line 383 ⟶ 426:
.editcount-dialog .oo-ui-window-body {
font-family: sans-serif;
height: 680px !important;
}
.editcount-dialog .oo-ui-window-frame {
height: 680px !important;
}
.editcount-input textarea,
|