Skip to content

Commit 97025c1

Browse files
author
soycode
authored
Merge branch 'master' into soycode-simplesocksnode
2 parents 1a2d177 + 4595dd7 commit 97025c1

35 files changed

+416
-483
lines changed

src/chrome/extension/scripts/context.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ export var ui :user_interface.UserInterface =
1919

2020
export var model :ui_model.Model = ui.model;
2121

22-
ui.browser = 'chrome';
2322
console.log('Loaded dependencies for Chrome Extension.');

src/firefox/data/scripts/background.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ if (undefined === ui) {
3030
model = ui.model;
3131
}
3232

33-
ui.browser = 'firefox';
34-
3533
port.on('newlyInstalled', function() {
3634
firefoxBrowserApi.hasInstalledThenLoggedIn = false;
3735
});

src/generic_core/uproxy_core.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,22 @@ export class uProxyCore implements uproxy_core_api.CoreApi {
311311
return globals.loadSettings.then(() => {
312312
var copyPasteConnectionState = copyPasteConnection.getCurrentState();
313313

314+
let moveToFront = (array :string[], element :string) :void => {
315+
let i = array.indexOf(element);
316+
if (i < 1) return;
317+
array.splice(0, 0, array.splice(i, 1)[0] );
318+
};
319+
320+
let networkNames = Object.keys(social_network.networks);
321+
322+
for (let name of ['Quiver', 'Cloud']) {
323+
if (name in social_network.networks) {
324+
moveToFront(networkNames, name);
325+
}
326+
}
327+
314328
return {
315-
networkNames: Object.keys(social_network.networks),
329+
networkNames: networkNames,
316330
cloudProviderNames: getCloudProviderNames(),
317331
globalSettings: globals.settings,
318332
onlineNetworks: social_network.getOnlineNetworks(),

src/generic_ui/locales/en/messages.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,9 @@
819819
"description": "Invite instructions for the uProxy Network (aka Quiver)",
820820
"message": "Generate a link and send it to your friends so they can find you on uProxy. You can request access, offer access or both."
821821
},
822+
"NETWORK_LIST_CLOUD_LABEL": {
823+
"message": "Create a private cloud server"
824+
},
822825
"ADD_A_CLOUD_FRIEND": {
823826
"description": "Title for screen where user adds a Cloud instance (virtual machine) to use uProxy with",
824827
"message": "Add a Cloud friend"
@@ -1241,7 +1244,7 @@
12411244
},
12421245
"CREATE_A_NEW_ACCOUNT": {
12431246
"description": "Button text for creating a new account (e.g. for DigitalOcean)",
1244-
"message": "Create a new account"
1247+
"message": "Create a DigitalOcean account"
12451248
},
12461249
"SIGN_IN_AND_CONNECT": {
12471250
"description": "Button text for signing into DigitalOcean",
@@ -1301,15 +1304,19 @@
13011304
},
13021305
"CLOUD_INSTALL_GET_STARTED_TITLE": {
13031306
"description": "Message shown during DigitalOcean server deployment",
1304-
"message": "uProxy now allows you to create a private cloud server through DigitalOcean."
1307+
"message": "Create a private cloud server on DigitalOcean through uProxy."
13051308
},
13061309
"CLOUD_INSTALL_GET_STARTED_MESSAGE": {
13071310
"description": "Message shown during DigitalOcean server deployment",
1308-
"message": "For $10 per month you can get and share access with your friends and family. If you sign up with uProxy, your first month is free! Create a new account or sign in to connect and share access. <uproxy-faq-link anchor='whatAreCloudServers'>Learn more.</uproxy-faq-link>"
1311+
"message": "For $10 per month you can get and share access with your friends and family. If you sign up for DigitalOcean with uProxy, your first month is free! <uproxy-faq-link anchor='whatAreCloudServers'>Learn more.</uproxy-faq-link>"
1312+
},
1313+
"CLOUD_INSTALL_EXISTING_SERVER_TITLE": {
1314+
"description": "Title for 'already have a cloud server' section",
1315+
"message": "Already have a cloud server?"
13091316
},
13101317
"CLOUD_INSTALL_EXISTING_SERVER_MESSAGE": {
13111318
"description": "Instructions link for users who already have an existing cloud server.",
1312-
"message": "Already have a cloud server? <uproxy-faq-link anchor='howDoInstallUproxyOnServer'>Learn how</uproxy-faq-link> to use it with uProxy."
1319+
"message": "You can manually set up your own uProxy server. <uproxy-faq-link anchor='howDoInstallUproxyOnServer'>Learn how</uproxy-faq-link>"
13131320
},
13141321
"CLOUD_INSTALL_INVITE_SCREEN_TITLE": {
13151322
"description": "Message shown on invite screen for DigitalOcean server deployment",
@@ -1321,19 +1328,15 @@
13211328
},
13221329
"I_HAVE_AN_ACCOUNT": {
13231330
"description": "Button text shown during DigitalOcean server deployment",
1324-
"message": "I have an account"
1331+
"message": "I have a DigitalOcean account"
13251332
},
13261333
"SIGN_ME_IN": {
13271334
"description": "Button text shown during DigitalOcean server deployment",
13281335
"message": "Sign me in!"
13291336
},
1330-
"EMPTY_ROSTER_CLOUD_INSTRUCTIONS": {
1331-
"description": "Instructions shown for cloud when the user has an empty roster",
1332-
"message": "Create a private cloud server and share access with friends & family"
1333-
},
1334-
"EMPTY_ROSTER_PEER_TO_PEER_INSTRUCTIONS": {
1335-
"description": "Instructions shown for peer-to-peer when the user has an empty roster",
1336-
"message": "Get or share access with family & friends."
1337+
"EMPTY_ROSTER_INSTRUCTIONS": {
1338+
"description": "Instructions shown when the user has an empty roster",
1339+
"message": "Get and share access from a friend or a private cloud server."
13371340
},
13381341
"ASIA_SINGAPORE": {
13391342
"description": "Region option for deploying a DigitalOcean server",

src/generic_ui/polymer/button.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:host {
77
background: #12A391;
88
color: white;
9+
text-transform: none;
910
}
1011
</style>
1112
<shadow></shadow>

src/generic_ui/polymer/cloud-install.html

Lines changed: 15 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
width: 100%;
1818
background-color: white;
1919
}
20-
uproxy-button {
21-
margin: 15px 0px;
22-
}
2320
paper-progress {
2421
width: 100%;
2522
}
@@ -32,20 +29,25 @@
3229
}
3330
uproxy-button {
3431
background-color: #34AFCE; /* blue */
32+
margin: 4px 0;
3533
padding: 0.5em;
3634
width: 100%;
3735
font-size: 14px;
3836
}
37+
paper-checkbox {
38+
margin: 0 0 4px;
39+
}
40+
hr {
41+
margin: 20px 0;
42+
color: #eee;
43+
border-style: solid;
44+
}
3945
h1 {
40-
color: #34AFCE; /* blue */
46+
color: #003C48;
4147
font-weight: 400;
4248
font-size: 20px;
4349
line-height: 30px;
4450
}
45-
h2 {
46-
font-weight: 400;
47-
font-size: 23px;
48-
}
4951
p {
5052
line-height: 1.75em;
5153
}
@@ -73,12 +75,6 @@
7375
.warning {
7476
font-weight: bold;
7577
}
76-
#newAccount {
77-
margin: 15px 0 8px;
78-
}
79-
#haveAccount {
80-
margin: 0 0 15px;
81-
}
8278
</style>
8379

8480
<core-signals on-core-signal-open-cloud-install='{{ open }}'></core-signals>
@@ -90,44 +86,20 @@
9086

9187
<div class='content'>
9288
<div class='imgWrapper'>
93-
<img src='../../icons/cloud/create-circle-ic.svg'>
89+
<img src='../../icons/cloud/uproxy+digitalocean.svg'>
9490
</div>
9591
<h1>{{ 'CLOUD_INSTALL_GET_STARTED_TITLE' | $$ }}</h1>
9692
<p id='getStartedMessage'></p>
97-
<uproxy-button raised on-tap='{{ showDigitalOceanAccountHelpOverlay }}'
98-
id="newAccount">
99-
{{ 'CREATE_A_NEW_ACCOUNT' | $$ }}
100-
</uproxy-button>
101-
<uproxy-button raised on-tap='{{ showLoginOverlay }}' id="haveAccount">
102-
{{ 'I_HAVE_AN_ACCOUNT' | $$ }}
103-
</uproxy-button>
104-
<p id='existingServerMessage'></p>
105-
</div>
106-
</core-overlay>
107-
108-
<core-overlay id='digitalOceanAccountHelpOverlay'>
109-
<uproxy-app-bar on-go-back='{{ back }}' color='#34AFCE'>
110-
{{ 'CREATE_A_CLOUD_SERVER' | $$ }}
111-
</uproxy-app-bar>
112-
113-
<div class='content'>
114-
<div class='imgWrapper'>
115-
<img src='../../icons/cloud/getstarted-step1.svg'>
116-
<img src='../../icons/cloud/getstarted-step2.svg'>
117-
<img src='../../icons/cloud/getstarted-step3.svg'>
118-
</div>
119-
<h1>{{ 'CLOUD_INSTALL_CREATE_ACCOUNT_TITLE' | $$ }}</h1>
120-
<!-- TODO: some of this text needs to be bold - need to set the HTML element rather than use $$ to translate -->
121-
<p id='createAccountMessage'></p>
122-
12393
<paper-checkbox id='havePromoCode' label="{{ 'HAVE_PROMO_CODE' | $$ }}" on-change="{{havePromoChanged}}"></paper-checkbox>
124-
12594
<uproxy-button raised on-tap='{{ launchDigitalOceanSignup }}'>
12695
{{ 'CREATE_A_NEW_ACCOUNT' | $$ }}
12796
</uproxy-button>
12897
<uproxy-button raised on-tap='{{ showLoginOverlay }}'>
129-
{{ 'SIGN_ME_IN' | $$}}
98+
{{ 'I_HAVE_AN_ACCOUNT' | $$ }}
13099
</uproxy-button>
100+
<hr>
101+
<h1>{{ 'CLOUD_INSTALL_EXISTING_SERVER_TITLE' | $$ }}</h1>
102+
<p id='existingServerMessage'></p>
131103
</div>
132104
</core-overlay>
133105

src/generic_ui/polymer/cloud-install.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/// <reference path='../../../../third_party/typings/browser.d.ts' />
33
/// <reference path='../../../../third_party/polymer/polymer.d.ts' />
44

5+
import translator = require('../scripts/translator');
56
import uproxy_core_api = require('../../interfaces/uproxy_core_api');
67
import ui_constants = require('../../interfaces/ui');
78
import user = require('../scripts/user');
@@ -29,10 +30,6 @@ Polymer({
2930

3031
this.$.getStartedOverlay.open();
3132
},
32-
showDigitalOceanAccountHelpOverlay: function() {
33-
this.closeOverlays();
34-
this.$.digitalOceanAccountHelpOverlay.open();
35-
},
3633
showLoginOverlay: function() {
3734
this.closeOverlays();
3835
this.$.loginOverlay.open();
@@ -49,8 +46,7 @@ Polymer({
4946
ui.openTab('https://cloud.digitalocean.com/droplets');
5047
},
5148
back: function() {
52-
if (this.$.digitalOceanAccountHelpOverlay.opened ||
53-
this.$.loginOverlay.opened || this.$.failureOverlay.opened) {
49+
if (this.$.loginOverlay.opened || this.$.failureOverlay.opened) {
5450
this.closeOverlays();
5551
this.$.getStartedOverlay.open();
5652
} else {
@@ -59,7 +55,6 @@ Polymer({
5955
},
6056
closeOverlays: function() {
6157
this.$.getStartedOverlay.close();
62-
this.$.digitalOceanAccountHelpOverlay.close();
6358
this.$.loginOverlay.close();
6459
this.$.installingOverlay.close();
6560
this.$.successOverlay.close();
@@ -84,6 +79,7 @@ Polymer({
8479
this.closeOverlays();
8580
this.$.successOverlay.open();
8681
ui.model.globalSettings.shouldHijackDO = false;
82+
ui.core.updateGlobalSettings(ui.model.globalSettings);
8783
}).catch((e :any) => {
8884
// TODO: Figure out why e.message is not set
8985
if (e === 'Error: server already exists') {
@@ -134,10 +130,20 @@ Polymer({
134130
providerName: DEFAULT_PROVIDER
135131
}).then(() => {
136132
this.closeOverlays();
137-
ui.toastMessage = ui.i18n_t('CLOUD_INSTALL_CANCEL_SUCCESS');
133+
this.fire('core-signal', {
134+
name: 'show-toast',
135+
data: {
136+
toastMessage: translator.i18n_t('CLOUD_INSTALL_CANCEL_SUCCESS')
137+
}
138+
});
138139
}).catch((e: Error) => {
139140
this.$.cancelingOverlay.close();
140-
ui.toastMessage = ui.i18n_t('CLOUD_INSTALL_CANCEL_FAILURE');
141+
this.fire('core-signal', {
142+
name: 'show-toast',
143+
data: {
144+
toastMessage: translator.i18n_t('CLOUD_INSTALL_CANCEL_FAILURE')
145+
}
146+
});
141147
});
142148
},
143149
select: function(e: Event, d: Object, input: HTMLInputElement) {

src/generic_ui/polymer/contact.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,12 @@ Polymer({
138138
userId: this.contact.userId
139139
});
140140
}).then(() => {
141-
this.ui.toastMessage = translator.i18n_t('REMOVE_CLOUD_SERVER_SUCCESS');
141+
this.fire('core-signal', {
142+
name: 'show-toast',
143+
data: {
144+
toastMessage: translator.i18n_t('REMOVE_CLOUD_SERVER_SUCCESS')
145+
}
146+
});
142147
}).catch((e: Error) => {
143148
if (!e) {
144149
return;
@@ -174,7 +179,12 @@ Polymer({
174179
},
175180
destroyCloudServerIfNeeded: function() {
176181
if (this.contact.status === this.UserStatus.CLOUD_INSTANCE_CREATED_BY_LOCAL) {
177-
this.ui.toastMessage = translator.i18n_t('REMOVING_UPROXY_CLOUD_STATUS');
182+
this.fire('core-signal', {
183+
name: 'show-toast',
184+
data: {
185+
toastMessage: translator.i18n_t('REMOVING_UPROXY_CLOUD_STATUS')
186+
}
187+
});
178188
return ui_context.core.cloudUpdate({
179189
operation: uproxy_core_api.CloudOperationType.CLOUD_DESTROY,
180190
providerName: DEFAULT_PROVIDER

src/generic_ui/polymer/instance.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import social = require('../../interfaces/social');
55
import ui_constants = require('../../interfaces/ui');
66
import net = require('../../lib/net/net.types');
77
import uproxy_core_api = require('../../interfaces/uproxy_core_api');
8+
import translator = require('../scripts/translator');
89
import user_interface = require('../scripts/ui');
910

1011
// generic_ui/scripts/ui.ts: UserInterface
@@ -37,8 +38,13 @@ Polymer({
3738
},
3839
start: function() {
3940
if (!this.instance.isOnline) {
40-
this.ui.toastMessage = ui.i18n_t('FRIEND_OFFLINE',
41-
{ name: this.user.name });
41+
this.fire('core-signal', {
42+
name: 'show-toast',
43+
data: {
44+
toastMessage: translator.i18n_t('FRIEND_OFFLINE',
45+
{ name: this.user.name })
46+
}
47+
});
4248
return;
4349
}
4450

src/generic_ui/polymer/invite-user.html

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
cursor: pointer;
7777
vertical-align: top;
7878
padding: 1em 2em 1em 2em;
79-
border-bottom: 1px solid rgba(0, 0, 0, .10);
8079
}
8180
.networkLoginButton:last-child {
8281
border-bottom: none;
@@ -131,12 +130,7 @@
131130
}
132131
/* uproxy-faq-link is used in the translation for weWontPostLearnMore */
133132
uproxy-faq-link {
134-
font-weight: bold;
135-
}
136-
/* underline is not applied unless we do this hack. TODO: find out why */
137-
uproxy-faq-link::shadow span {
138-
text-decoration: underline;
139-
color: rgb(112, 112, 112);
133+
color: #12A391;
140134
}
141135
.paleText {
142136
color: #9e9e9e;
@@ -221,27 +215,15 @@
221215
</div>
222216

223217
<div id='allNetworkButtons'>
224-
225-
<div id='cloudInstall' hidden?='{{ model.cloudProviderNames.length < 1 }}' on-tap='{{ cloudInstall }}'>
226-
<div class='content'>
227-
<img src='../../icons/cloud/connect-cloud.png'>
228-
<h1>{{ 'CLOUD_INSTALL_INVITE_SCREEN_TITLE' | $$ }}</h1>
229-
<p>{{ 'CLOUD_INSTALL_INVITE_SCREEN_MESSAGE' | $$ }}</p>
230-
</div>
231-
<div class='chevronWrapper'>
232-
<core-icon icon="chevron-right"></core-icon>
233-
</div>
234-
</div> <!-- end of cloud -->
235-
236-
<div class='categoryHeader'>{{ "CHOOSE_A_SOCIAL_NETWORK" | $$ }}</div>
237-
238218
<template repeat='{{ n in model.networkNames }}' vertical layout>
239-
<div hidden?='{{ n == "Cloud" }}' on-tap='{{ networkTapped }}' class='networkLoginButton' data-network='{{n}}'>
219+
<div on-tap='{{networkTapped }}' class='networkLoginButton' data-network='{{n}}'>
240220
<core-icon icon='uproxy-icons:{{n}}'></core-icon>
241221
<div class='networkName'>{{getNetworkDisplayName(n)}}</div>
222+
<!--
242223
<span class='experimental paleText' hidden?='{{!isExperimentalNetwork(n)}}'>
243224
(Experimental)
244225
</span>
226+
-->
245227
<div class='chevronWrapper'>
246228
<core-icon icon="chevron-right"></core-icon>
247229
</div>

0 commit comments

Comments
 (0)