Skip to content

Commit

Permalink
Remove some unused functionality from splash
Browse files Browse the repository at this point in the history
There is some splash page functionality we have decided we will never be
using, this moves that functionality out of the splash page.  It also
moves the no-longer-duplicated functions out of the common page.
  • Loading branch information
jpevarnek committed Dec 18, 2015
1 parent 87d0d86 commit 1dabbe1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 63 deletions.
19 changes: 19 additions & 0 deletions src/generic_ui/polymer/invite-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ var inviteUser = {
this.$.loginToInviteFriendDialog.open();
}
},
login: function(networkName :string, userName ?:string ) {
return ui.login(networkName, userName).then(() => {
if (networkName != 'Quiver') {
this.$.loginToInviteFriendDialog.close();
if (this.closeInviteUserPanel) {
this.closeInviteUserPanel();
}
}
ui.bringUproxyToFront();
}).catch((e: Error) => {
console.warn('Did not log in ', e);
});
},
loginTapped: function() {
this.login(this.selectedNetworkName).then(() => {
this.initInviteForNetwork();
Expand Down Expand Up @@ -161,6 +174,12 @@ var inviteUser = {
// will be smaller than expected.
this.$.loginToInviteFriendDialog.resizeHandler();
},
getNetworkDisplayName: function(networkName :string) {
return ui.getNetworkDisplayName(networkName);
},
isExperimentalNetwork: function(networkName :string) {
return ui.isExperimentalNetwork(networkName);
},
closeLoginDialog: function() {
this.$.loginToInviteFriendDialog.close();
},
Expand Down
19 changes: 1 addition & 18 deletions src/generic_ui/polymer/login-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var ui = ui_context.ui;
var core = ui_context.core;
var model = ui_context.model;

//TODO: remove this when we get rid of the past splash state
//TODO: remove this when we switch to roster-as-default
var loginCommon = {
copypaste: function() {
// Logout of all other social networks before starting
Expand All @@ -34,22 +34,5 @@ var loginCommon = {
});
this.supportsQuiver = model.hasQuiverSupport();
},
isExperimentalNetwork: function(networkName :string) {
return ui.isExperimentalNetwork(networkName);
},
getNetworkDisplayName: ui.getNetworkDisplayName,
login: function(networkName :string, userName ?:string ) {
return ui.login(networkName, userName).then(() => {
if (networkName != 'Quiver') {
this.$.loginToInviteFriendDialog.close();
if (this.closeInviteUserPanel) {
this.closeInviteUserPanel();
}
}
ui.bringUproxyToFront();
}).catch((e: Error) => {
console.warn('Did not log in ', e);
});
},
};
export = loginCommon;
36 changes: 0 additions & 36 deletions src/generic_ui/polymer/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,42 +232,6 @@ <h1>{{ "WELCOME" | $$ }}</h1>

<div vertical layout id='networks' hidden?='{{SPLASH_STATES.NETWORKS!==model.globalSettings.splashState}}'>
<div class='view' flex>
<!-- TODO: translate before launch on webstore -->
<div hidden?='{{!supportsQuiver}}'>
<h1 id='QuiverTitle'>Sign in to the uProxy network</h1>

<paper-input-decorator label='Choose a user name' layout vertical>
<input is='core-input' value='{{ userName }}' />
</paper-input-decorator>
<uproxy-button id='QuiverLoginButton' raised on-tap='{{ loginToQuiver }}'>Sign In</uproxy-button>

<div class='orText'>- - - OR - - -</div>
<p>Sign in with a social network.</p>
<template repeat='{{ n in networkButtonNames }}' vertical layout>
<div on-tap='{{ loginTapped }}' class='networkLoginButton' data-network='{{n}}'>
<core-icon icon='uproxy-icons:{{n}}'></core-icon>
<div class='networkName'>{{getNetworkDisplayName(n)}}</div>
<div class='experimental' hidden?='{{!isExperimentalNetwork(n)}}'>
Experimental
</div>
</div>
</template>

<div class='orText'>- - - OR - - -</div>
<div class='networkLoginButton copypaste' on-tap='{{ copypaste }}'>
<core-icon icon='uproxy-icons:CopyAndPaste'></core-icon>
<div class='networkName'>{{ "SET_UP_ONE_TIME" | $$ }}</div>
</div>

<p>
{{ "WE_WONT_POST" | $$ }}
</p>

<span id='submitFeedback' on-tap='{{ openFeedbackForm }}'>
{{ "SUBMIT_FEEDBACK" | $$ }}
</span>
</div>

<!-- TODO: remove this and uproxy-network template once Quiver
support is on the webstore -->
<div hidden?='{{supportsQuiver}}'>
Expand Down
9 changes: 0 additions & 9 deletions src/generic_ui/polymer/splash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ var splash = {
window.location.reload();
}
},
loginToQuiver: function() {
model.globalSettings.quiverUserName = this.userName;
core.updateGlobalSettings(model.globalSettings);
this.login('Quiver', this.userName);
},
loginTapped: function(event: Event, detail: Object, target: HTMLElement) {
var networkName = target.getAttribute('data-network');
this.login(networkName);
},
enableStats: function() {
model.globalSettings.statsReportingEnabled = true;
core.updateGlobalSettings(model.globalSettings);
Expand Down

0 comments on commit 1dabbe1

Please sign in to comment.