Content deleted Content added
Polygnotus (talk | contribs) v5 but with OOUI buttons |
Polygnotus (talk | contribs) OOUI ProcessDialog needs a static name property |
||
Line 421:
setApiKey() {
// Create OOUI dialog for API key input
}
this.
this.content.$element.append(▼
$('<p>').text('Enter your Claude API Key to enable proofreading:'),▼
textInput.$element▼
);▼
this.$body.append(this.content.$element);▼
};▼
if (action === 'save') {▼
return new OO.ui.Process(() => {▼
const key = textInput.getValue().trim();▼
if (key) {▼
this.apiKey = key;▼
localStorage.setItem('claude_api_key', this.apiKey);▼
this.updateButtonVisibility();▼
this.updateStatus('API key set successfully!');▼
windowManager.closeWindow(dialog);▼
} else {▼
textInput.setValidityFlag(false);▼
return OO.ui.Process.static.createRejectProcess('Please enter a valid API key');▼
}▼
});
this.content = new OO.ui.PanelLayout({
padded: true,
expanded: false
});
▲ this.content.$element.append(
▲ $('<p>').text('Enter your Claude API Key to enable proofreading:'),
▲ this.textInput.$element
);
▲ this.$body.append(this.content.$element);
}
return OO.ui.ProcessDialog.prototype.getActionProcess.call(this, action);▼
if (action === 'save') {
▲ const key = this.textInput.getValue().trim();
return OO.ui.ProcessDialog.prototype.getSetupProcess.call(this, data)▼
this.
▲ this.proofreader.updateButtonVisibility();
};▼
▲ this.proofreader.updateStatus('API key set successfully!');
▲ this.textInput.setValidityFlag(false);
▲ return OO.ui.Process.static.createRejectProcess('Please enter a valid API key');
▲ }
}
getSetupProcess(data) {
}
const dialog = new ApiKeyDialog(this);
const windowManager = new OO.ui.WindowManager();
$('body').append(windowManager.$element);
|