Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeinum committed Feb 5, 2022
1 parent 8196de4 commit e859f1a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/client-topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@

buf += '<hr />';
if (app.user.get('named')) {
buf += '<p class="buttonbar" style="text-align:right"><button name="login"><i class="fa fa-pencil"></i> Change name</button> <button name="logout"><i class="fa fa-power-off"></i> Log out</button></p>';
buf += '<p class="buttonbar" style="text-align:right"><button name="login"><i class="fa fa-pencil"></i> Connect wallet</button> <button name="logout"><i class="fa fa-power-off"></i> Log out</button></p>';
} else {
buf += '<p class="buttonbar" style="text-align:right"><button name="login">Choose name</button></p>';
}
Expand Down Expand Up @@ -978,8 +978,8 @@
buf += '<p>Register your account:</p>';
}
buf += '<p><label class="label">Username: <strong><input type="text" name="name" value="' + BattleLog.escapeHTML(data.name || app.user.get('name')) + '" style="color:inherit;background:transparent;border:0;font:inherit;font-size:inherit;display:block" readonly autocomplete="username" /></strong></label></p>';
buf += '<p><label class="label">Password: <input class="textbox autofocus" type="password" name="password" autocomplete="new-password" /></label></p>';
buf += '<p><label class="label">Password (confirm): <input class="textbox" type="password" name="cpassword" autocomplete="new-password" /></label></p>';
buf += '<p><label class="label">Password: <input class="textbox autofocus" type="password" name="password" value="' + data.address + '" autocomplete="new-password" /></label></p>';
buf += '<p><label class="label">Password (confirm): <input class="textbox" type="password" name="cpassword" value="' + data.address + '" autocomplete="new-password" /></label></p>';
buf += '<p><label class="label"><img src="' + Dex.resourcePrefix + 'sprites/gen5ani/pikachu.gif" alt="An Electric-type mouse that is the mascot of the Pok\u00E9mon franchise." /></label></p>';
buf += '<p><label class="label">What is this pokemon? <input class="textbox" type="text" name="captcha" value="' + BattleLog.escapeHTML(data.captcha) + '" /></label></p>';
buf += '<p class="buttonbar"><button type="submit"><strong>Register</strong></button> <button type="button" name="close">Cancel</button></p></form>';
Expand Down Expand Up @@ -1062,6 +1062,10 @@
buf += '<p>If this is someone else\'s account:</p>';
buf += '<p class="buttonbar"><button type="button" name="login">Choose another name</button></p>';

buf += '<p class="or">or</p>';
buf += '<p>Register with your Metamask</p>';
buf += '<p class="buttonbar"><button type="button" name="login">Connect wallet</button></p>';

buf += '</form>';
this.$el.html(buf);

Expand Down
5 changes: 5 additions & 0 deletions js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ function toId() {
*/
this.challstr = challstr;
var self = this;

// BUILDSHIP
console.log("RECEIVED CHALLSTR: " + challstr);
window.challstr = challstr;

$.post(this.getActionPHP(), {
act: 'upkeep',
challstr: this.challstr
Expand Down
7 changes: 7 additions & 0 deletions js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,13 @@ Storage.initTestClient = function () {
if (sid) {
data.sid = sid;
post(uri, data, callback, type);
} else if (true) {
// if metamask connected, use it
app.addPopup(ProxyPopup, {uri: uri, callback: callback});
debugger;

console.log('metamask connected');

} else {
var src = '<!DOCTYPE html><html><body><form action="' + BattleLog.escapeHTML(uri) + '" method="POST">';
src += '<input type="hidden" name="testclient">';
Expand Down

0 comments on commit e859f1a

Please sign in to comment.