From 073393af311d36c8ca7570ff0d3f0a3117c0b544 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 16 Sep 2016 14:02:32 -0700 Subject: [pkg] rename www to ui --- www/app/app.js | 33 --- www/app/components/area.js | 65 ----- www/app/components/center.js | 39 --- www/app/components/debug_panel.js | 40 --- www/app/components/error_panel.js | 21 -- www/app/components/greeter_panel.js | 34 --- www/app/components/list_edit.js | 122 -------- www/app/components/login.js | 302 -------------------- www/app/components/main_panel/account_list.js | 113 -------- www/app/components/main_panel/email_section.js | 48 ---- www/app/components/main_panel/index.js | 80 ------ www/app/components/main_panel/main_panel.less | 212 -------------- www/app/components/main_panel/section_layout.js | 59 ---- www/app/components/main_panel/user_section.js | 71 ----- www/app/components/main_panel/vpn_section.js | 0 www/app/components/panel_switcher.js | 58 ---- www/app/components/spinner/index.js | 15 - www/app/components/spinner/spinner.css | 42 --- www/app/components/splash.js | 132 --------- www/app/components/wizard/add_provider_modal.js | 94 ------- www/app/components/wizard/index.js | 38 --- www/app/components/wizard/provider_select_stage.js | 86 ------ www/app/components/wizard/stage_layout.js | 37 --- www/app/components/wizard/wizard.less | 44 --- www/app/css/bootstrap.less | 5 - www/app/css/common.css | 80 ------ www/app/img/arrow-down.svg | 65 ----- www/app/img/arrow-up.svg | 65 ----- www/app/img/cloud.svg | 65 ----- www/app/img/disabled.svg | 72 ----- www/app/img/envelope.svg | 64 ----- www/app/img/gear.svg | 61 ---- www/app/img/mask.svg | 133 --------- www/app/img/off.svg | 88 ------ www/app/img/on.svg | 78 ------ www/app/img/planet.svg | 60 ---- www/app/img/unknown.svg | 82 ------ www/app/img/user.svg | 65 ----- www/app/img/wait.svg | 75 ----- www/app/index.html | 13 - www/app/lib/bitmask.js | 306 --------------------- www/app/lib/color.js | 65 ----- www/app/lib/colors.js | 289 ------------------- www/app/lib/common.js | 7 - www/app/lib/validate.js | 82 ------ www/app/main.js | 26 -- www/app/models/account.js | 143 ---------- www/app/models/dummy_account.js | 33 --- 48 files changed, 3807 deletions(-) delete mode 100644 www/app/app.js delete mode 100644 www/app/components/area.js delete mode 100644 www/app/components/center.js delete mode 100644 www/app/components/debug_panel.js delete mode 100644 www/app/components/error_panel.js delete mode 100644 www/app/components/greeter_panel.js delete mode 100644 www/app/components/list_edit.js delete mode 100644 www/app/components/login.js delete mode 100644 www/app/components/main_panel/account_list.js delete mode 100644 www/app/components/main_panel/email_section.js delete mode 100644 www/app/components/main_panel/index.js delete mode 100644 www/app/components/main_panel/main_panel.less delete mode 100644 www/app/components/main_panel/section_layout.js delete mode 100644 www/app/components/main_panel/user_section.js delete mode 100644 www/app/components/main_panel/vpn_section.js delete mode 100644 www/app/components/panel_switcher.js delete mode 100644 www/app/components/spinner/index.js delete mode 100644 www/app/components/spinner/spinner.css delete mode 100644 www/app/components/splash.js delete mode 100644 www/app/components/wizard/add_provider_modal.js delete mode 100644 www/app/components/wizard/index.js delete mode 100644 www/app/components/wizard/provider_select_stage.js delete mode 100644 www/app/components/wizard/stage_layout.js delete mode 100644 www/app/components/wizard/wizard.less delete mode 100644 www/app/css/bootstrap.less delete mode 100644 www/app/css/common.css delete mode 100644 www/app/img/arrow-down.svg delete mode 100644 www/app/img/arrow-up.svg delete mode 100644 www/app/img/cloud.svg delete mode 100644 www/app/img/disabled.svg delete mode 100644 www/app/img/envelope.svg delete mode 100644 www/app/img/gear.svg delete mode 100644 www/app/img/mask.svg delete mode 100644 www/app/img/off.svg delete mode 100644 www/app/img/on.svg delete mode 100644 www/app/img/planet.svg delete mode 100644 www/app/img/unknown.svg delete mode 100644 www/app/img/user.svg delete mode 100644 www/app/img/wait.svg delete mode 100644 www/app/index.html delete mode 100644 www/app/lib/bitmask.js delete mode 100644 www/app/lib/color.js delete mode 100644 www/app/lib/colors.js delete mode 100644 www/app/lib/common.js delete mode 100644 www/app/lib/validate.js delete mode 100644 www/app/main.js delete mode 100644 www/app/models/account.js delete mode 100644 www/app/models/dummy_account.js (limited to 'www/app') diff --git a/www/app/app.js b/www/app/app.js deleted file mode 100644 index 57120a4..0000000 --- a/www/app/app.js +++ /dev/null @@ -1,33 +0,0 @@ -import bitmask from 'lib/bitmask' -import Account from 'models/account' - -class Application { - constructor() { - } - - // - // main entry point for the application - // - start() { - Account.active().then(account => { - if (account == null) { - this.show('greeter', {onLogin: this.onLogin.bind(this)}) - } else { - this.show('main', {initialAccount: account}) - } - }, error => { - this.show('error', {error: error}) - }) - } - - onLogin(account) { - this.show('main', {initialAccount: account}) - } - - show(panel, properties) { - this.switcher.show(panel, properties) - } -} - -var App = new Application -export default App \ No newline at end of file diff --git a/www/app/components/area.js b/www/app/components/area.js deleted file mode 100644 index e903e5f..0000000 --- a/www/app/components/area.js +++ /dev/null @@ -1,65 +0,0 @@ -// -// A bootstrap panel, but with some extra options -// - -import React from 'react' -// import {Panel} from 'react-bootstrap' - -class Area extends React.Component { - - static get defaultProps() {return{ - position: null, // top or bottom - size: 'small', // small or big - type: null, // light or dark - className: null - }} - - constructor(props) { - super(props) - } - - render() { - let style = {} - let innerstyle = {} - if (this.props.position == 'top') { - style.borderBottomRightRadius = '0px' - style.borderBottomLeftRadius = '0px' - style.marginBottom = '0px' - style.borderBottom = '0px' - if (this.props.size == 'big') { - innerstyle.padding = '25px' - } - } else if (this.props.position == 'bottom') { - style.borderTopRightRadius = '0px' - style.borderTopLeftRadius = '0px' - style.borderTop = '0px' - if (this.props.size == 'big') { - innerstyle.padding = '15px 25px' - } - } - - let type = this.props.type ? "area-" + this.props.type : "" - let className = ['panel', 'panel-default', type, this.props.className].join(' ') - return( -
-
- {this.props.children} -
-
- ) - } - -} - -// Area.propTypes = { -// children: React.PropTypes.oneOfType([ -// React.PropTypes.element, -// React.PropTypes.arrayOf(React.PropTypes.element) -// ]) -// } - -//Area.propTypes = { -// children: React.PropTypes.element.isRequired -//} - -export default Area diff --git a/www/app/components/center.js b/www/app/components/center.js deleted file mode 100644 index 6fa6212..0000000 --- a/www/app/components/center.js +++ /dev/null @@ -1,39 +0,0 @@ -// -// puts a block right in the center of the window -// - -import React from 'react' - -class Center extends React.Component { - - static get defaultProps() {return{ - width: null - }} - - constructor(props) { - super(props) - } - - render() { - let style = null - if (this.props.width) { - style = {width: this.props.width + 'px'} - } - return ( -
-
- {this.props.children} -
-
- ) - } -} - -Center.propTypes = { - children: React.PropTypes.oneOfType([ - React.PropTypes.element, - React.PropTypes.arrayOf(React.PropTypes.element) - ]) -} - -export default Center diff --git a/www/app/components/debug_panel.js b/www/app/components/debug_panel.js deleted file mode 100644 index 7515ba8..0000000 --- a/www/app/components/debug_panel.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from 'react' -import App from '../app' - - -class DebugPanel extends React.Component { - - constructor(props) { - super(props) - this.click = this.click.bind(this) - } - - componentDidMount() { - this.click(window.location.hash.replace('#', '')) - } - - click(panel_name) { - window.location.hash = panel_name - App.show(panel_name) - } - - panel(panel_name) { - return elem( - 'a', - { onClick: () => this.click(panel_name), key: panel_name }, - panel_name - ) - } - - render() { - return elem('div', {className: 'debug-panel'}, - this.panel('splash'), - this.panel('greeter'), - this.panel('wizard'), - this.panel('main') - ) - } - -} - -export default DebugPanel \ No newline at end of file diff --git a/www/app/components/error_panel.js b/www/app/components/error_panel.js deleted file mode 100644 index fc88d45..0000000 --- a/www/app/components/error_panel.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react' -import Center from './center' -import Area from './area' - -export default class ErrorPanel extends React.Component { - - constructor(props) { - super(props) - } - - render () { - return ( -
- -

Error

- {this.props.error} - -
- ) - } -} diff --git a/www/app/components/greeter_panel.js b/www/app/components/greeter_panel.js deleted file mode 100644 index 4552db1..0000000 --- a/www/app/components/greeter_panel.js +++ /dev/null @@ -1,34 +0,0 @@ -import React from 'react' -import Login from './login' -import Center from './center' -import Splash from './splash' -import Area from './area' -import { Glyphicon } from 'react-bootstrap' -import App from 'app' - -export default class GreeterPanel extends React.Component { - - constructor(props) { - super(props) - } - - newAccount() { - App.show('wizard') - } - - render () { - return
- -
- - - - - -   - Create a new account... - -
-
- } -} diff --git a/www/app/components/list_edit.js b/www/app/components/list_edit.js deleted file mode 100644 index 0d557d2..0000000 --- a/www/app/components/list_edit.js +++ /dev/null @@ -1,122 +0,0 @@ -// -// A simple list of items, with minus and plus buttons to add and remove -// items. -// - -import React from 'react' -import {Button, ButtonGroup, ButtonToolbar, Glyphicon, FormControl} from 'react-bootstrap' - -const CONTAINER_CSS = { - display: "flex", - flexDirection: "column" -} -const SELECT_CSS = { - padding: "0px", - flex: "1 1 1000px", - overflowY: "scroll" -} -const OPTION_CSS = { - padding: "10px" -} -const TOOLBAR_CSS = { - paddingTop: "10px", - flex: "0 0 auto" -} - -class ListEdit extends React.Component { - - static get defaultProps() {return{ - width: null, - items: [ - 'aaaaaaa', - 'bbbbbbb', - 'ccccccc' - ], - selected: null, - onRemove: null, - onAdd: null, - }} - - constructor(props) { - super(props) - let index = 0 - if (props.selected) { - index = props.items.indexOf(props.selected) - } - this.state = { - selected: index - } - this.click = this.click.bind(this) - this.add = this.add.bind(this) - this.remove = this.remove.bind(this) - } - - setSelected(index) { - this.setState({ - selected: index - }) - } - - click(e) { - let row = parseInt(e.target.value) - if (row >= 0) { - this.setState({selected: row}) - } - } - - add() { - if (this.props.onAdd) { - this.props.onAdd() - } - } - - remove() { - if (this.state.selected >= 0 && this.props.onRemove) { - if (this.props.items.length == this.state.selected + 1) { - // if we remove the last item, set the selected item - // to the one right before it. - this.setState({selected: (this.state.selected - 1)}) - } - this.props.onRemove(this.props.items[this.state.selected]) - } - } - - render() { - let options = null - if (this.props.items) { - options = this.props.items.map((item, i) => { - return - }, this) - } - return( -
- - {options} - - - - - - - -
- ) - } - -} - -ListEdit.propTypes = { - children: React.PropTypes.oneOfType([ - React.PropTypes.element, - React.PropTypes.arrayOf(React.PropTypes.element) - ]) -} - -export default ListEdit diff --git a/www/app/components/login.js b/www/app/components/login.js deleted file mode 100644 index fe4ef5b..0000000 --- a/www/app/components/login.js +++ /dev/null @@ -1,302 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' - -import { FormGroup, ControlLabel, FormControl, HelpBlock, Button, - Checkbox, Glyphicon, Overlay, Tooltip, Alert } from 'react-bootstrap' -import Spinner from './spinner' - -import Validate from 'lib/validate' -import App from 'app' -import Account from 'models/account' - -class Login extends React.Component { - - static get defaultProps() {return{ - rememberAllowed: false, // if set, show remember password checkbox - domain: null, // if set, only allow this domain - onLogin: null - }} - - constructor(props) { - super(props) - - // validation states can be null, 'success', 'warning', or 'error' - - this.state = { - loading: false, - - authError: false, // authentication error message - - username: "etest1@riseup.net", - usernameState: null, // username validation state - usernameError: false, // username help message - - password: "whatever", - passwordState: null, // password validation state - passwordError: false, // password help message - - disabled: false, - remember: false // remember is checked? - } - - // prebind: - this.onUsernameChange = this.onUsernameChange.bind(this) - this.onUsernameBlur = this.onUsernameBlur.bind(this) - this.onPassword = this.onPassword.bind(this) - this.onSubmit = this.onSubmit.bind(this) - this.onRemember = this.onRemember.bind(this) - } - - componentDidMount() { - Validate.loadPasswdLib() - } - - render () { - let rememberCheck = "" - let submitButton = "" - let usernameHelp = null - let passwordHelp = null - let message = null - - if (this.props.rememberAllowed) { - let props = { - style: {marginTop: "0px"}, - onChange: this.onRemember - } - - if (this.state.remember) { - rememberCheck = - Remember username and password - - } else { - rememberCheck = - Remember username and password - - } - } - - if (this.state.authError) { - // style may be: success, warning, danger, info - message = ( - {this.state.authError} - ) - } - - if (this.state.usernameError) { - usernameHelp = {this.state.usernameError} - // let props = {shouldUpdatePosition: true, show:true, placement:"right", - // target:this.refs.username} - // usernameHelp = ( - // - // {this.state.usernameError} - // - // ) - } else { - //usernameHelp =   - } - - if (this.state.passwordError) { - passwordHelp = {this.state.passwordError} - // let props = {shouldUpdatePosition: true, show:true, placement:"right", - // target:this.refs.password, component: {this}} - // passwordHelp = ( - // - // {this.state.passwordError} - // - // ) - } else { - //passwordHelp =   - } - - let buttonProps = { - type: "button", - onClick: this.onSubmit, - disabled: !this.maySubmit() - } - if (this.state.loading) { - submitButton = - } else { - submitButton = - } - - let usernameref = null - if (this.props.domain) { - usernameref = function(c) { - if (c != null) { - let textarea = ReactDOM.findDOMNode(c) - let start = textarea.value.indexOf('@') - if (textarea.selectionStart > start) { - textarea.setSelectionRange(start, start) - } - } - } - } - - let form =
- {message} - - Username - - {this.state.usernameState == 'success' ? null : } - {usernameHelp} - - - - Password - - {this.state.passwordState == 'success' ? null : } - {passwordHelp} - - - {submitButton} - {rememberCheck} -
- - return form - } - - // - // Here we do a partial validation, because the user has not stopped typing. - // - onUsernameChange(e) { - let username = e.target.value.toLowerCase().replace("\n", "") - if (this.props.domain) { - let [userpart, domainpart] = username.split( - new RegExp('@|' + this.props.domain.replace(".", "\\.") + '$') - ) - username = [userpart, this.props.domain].join('@') - } - let error = Validate.usernameInteractive(username, this.props.domain) - let state = null - if (error) { - state = 'error' - } else { - if (username && username.length > 0) { - let finalError = Validate.username(username) - state = finalError ? null : 'success' - } - } - this.setState({ - username: username, - usernameState: state, - usernameError: error ? error : null - }) - } - - // - // Here we do a more complete validation, since the user have left the field. - // - onUsernameBlur(e) { - let username = e.target.value.toLowerCase() - this.setState({ - username: username - }) - if (username.length > 0) { - this.validateUsername(username) - } else { - this.setState({ - usernameState: null, - usernameError: null - }) - } - } - - onPassword(e) { - let password = e.target.value - this.setState({password: password}) - if (password.length > 0) { - this.validatePassword(password) - } else { - this.setState({ - passwordState: null, - passwordError: null - }) - } - } - - onRemember(e) { - let currentValue = e.target.value == 'on' ? true : false - let value = !currentValue - this.setState({remember: value}) - } - - validateUsername(username) { - let error = Validate.username(username, this.props.domain) - this.setState({ - usernameState: error ? 'error' : 'success', - usernameError: error ? error : null - }) - } - - validatePassword(password) { - let state = null - let message = null - let result = Validate.passwordStrength(password) - if (result) { - message = "Time to crack: " + result.crack_times_display.offline_slow_hashing_1e4_per_second - if (result.score == 0) { - state = 'error' - } else if (result.score == 1 || result.score == 2) { - state = 'warning' - } else { - state = 'success' - } - } - this.setState({ - passwordState: state, - passwordError: message - }) - } - - maySubmit() { - return( - !this.stateLoading && - !this.state.usernameError && - this.state.username != "" && - this.state.password != "" - ) - } - - onSubmit(e) { - e.preventDefault() // don't reload the page please! - if (!this.maySubmit()) { return } - this.setState({loading: true}) - - let account = Account.find(this.state.username) - account.login(this.state.password).then( - account => { - this.setState({loading: false}) - if (this.props.onLogin) { - this.props.onLogin(account) - } - }, - error => { - console.log(error) - if (error == "") { - error = 'Something failed, but we did not get a message' - } - this.setState({ - loading: false, - usernameState: 'error', - passwordState: 'error', - authError: error - }) - } - ) - } - -} - -export default Login \ No newline at end of file diff --git a/www/app/components/main_panel/account_list.js b/www/app/components/main_panel/account_list.js deleted file mode 100644 index d0ef092..0000000 --- a/www/app/components/main_panel/account_list.js +++ /dev/null @@ -1,113 +0,0 @@ -import React from 'react' -import {Button, ButtonGroup, ButtonToolbar, Glyphicon} from 'react-bootstrap' - -import App from 'app' -import Account from 'models/account' - -export default class AccountList extends React.Component { - - static get defaultProps() {return{ - account: null, - accounts: [], - onAdd: null, - onRemove: null, - onSelect: null - }} - - constructor(props) { - super(props) - - this.state = { - mode: 'expanded' - } - - // prebind: - this.select = this.select.bind(this) - this.add = this.add.bind(this) - this.remove = this.remove.bind(this) - this.expand = this.expand.bind(this) - this.collapse = this.collapse.bind(this) - } - - select(e) { - let account = this.props.accounts.find( - account => account.id == e.currentTarget.dataset.id - ) - if (this.props.onSelect) { - this.props.onSelect(account) - } - } - - add() { - App.show('wizard') - } - - remove() { - } - - expand() { - this.setState({mode: 'expanded'}) - } - - collapse() { - this.setState({mode: 'collapsed'}) - } - - render() { - let style = {} - let expandButton = null - let plusminusButtons = null - - if (this.state.mode == 'expanded') { - expandButton = ( - - ) - plusminusButtons = ( - - - - - ) - } else { - style.width = '60px' - expandButton = ( - - ) - } - - let items = this.props.accounts.map((account, i) => { - let className = account == this.props.account ? 'active' : 'inactive' - return ( -
  • - {account.userpart} - {account.domain} - - -
  • - ) - }) - - - return ( -
    - - - {plusminusButtons} - {expandButton} - -
    - ) - } - - -} diff --git a/www/app/components/main_panel/email_section.js b/www/app/components/main_panel/email_section.js deleted file mode 100644 index a6525d9..0000000 --- a/www/app/components/main_panel/email_section.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react' -//import { Button, Glyphicon, Alert } from 'react-bootstrap' -import SectionLayout from './section_layout' -import Account from 'models/account' -import Spinner from 'components/spinner' -import bitmask from 'lib/bitmask' - -export default class EmailSection extends React.Component { - - static get defaultProps() {return{ - account: null - }} - - constructor(props) { - super(props) - this.state = { - status: null - } - this.openKeys = this.openKeys.bind(this) - this.openApp = this.openApp.bind(this) - this.openPrefs = this.openPrefs.bind(this) - - console.log('email constructor') - } - - openKeys() {} - openApp() {} - openPrefs() {} - - render () { - //let message = null - //if (this.state.error) { - // // style may be: success, warning, danger, info - // message = ( - // {this.state.error} - // ) - //} - let button = null - if (this.state.status == 'ready') { - button = - } - return ( - -

    inbox:

    -
    - ) - } -} diff --git a/www/app/components/main_panel/index.js b/www/app/components/main_panel/index.js deleted file mode 100644 index 3cc6c11..0000000 --- a/www/app/components/main_panel/index.js +++ /dev/null @@ -1,80 +0,0 @@ -// -// The main panel manages the current account and the list of available accounts -// -// It displays multiple sections, one for each service. -// - -import React from 'react' -import App from 'app' -import Login from 'components/login' -import Account from 'models/account' -import DummyAccount from 'models/dummy_account' - -import './main_panel.less' -import AccountList from './account_list' -import UserSection from './user_section' -import EmailSection from './email_section' - -export default class MainPanel extends React.Component { - - static get defaultProps() {return{ - initialAccount: null - }} - - constructor(props) { - super(props) - this.state = { - account: null, - accounts: [] - } - this.activateAccount = this.activateAccount.bind(this) - } - - componentWillMount() { - if (this.props.initialAccount) { - console.log(Account.list) - Account.add(this.props.initialAccount) - Account.add(new DummyAccount(this.props.initialAccount)) - this.setState({ - account: this.props.initialAccount, - accounts: Account.list - }) - } - } - - activateAccount(account) { - this.setState({ - account: account, - accounts: Account.list - }) - } - - //setAccounts(accounts) { - // this.setState({ - // accounts: accounts - // }) - //} - - render() { - let emailSection = null - let vpnSection = null - - if (this.state.account.authenticated) { - if (this.state.account.hasEmail) { - emailSection = - } - } - - return ( -
    - -
    - - {vpnSection} - {emailSection} -
    -
    - ) - } - -} diff --git a/www/app/components/main_panel/main_panel.less b/www/app/components/main_panel/main_panel.less deleted file mode 100644 index 4e0ecb0..0000000 --- a/www/app/components/main_panel/main_panel.less +++ /dev/null @@ -1,212 +0,0 @@ -// The space around account entries: -@accounts-padding: 8px; -@accounts-corner: 6px; -@accounts-width: 200px; - -// -// LAYOUT -// - -.main-panel { - position: absolute; - height: 100%; - width: 100%; - display: -webkit-flex; - -webkit-flex-direction: row; - - > .body { - -webkit-flex: 1 1 auto; - overflow: auto; - } - - .accounts { - -webkit-flex: 0 0 auto; - overflow-y: auto; - overflow-x: hidden; - - display: -webkit-flex; - -webkit-flex-direction: column; - ul { - -webkit-flex: 1 1 1000px; - } - .btn-toolbar { - -webkit-flex: 0 0 auto; - } - - } - -} - -// -// Style -// - - -.main-panel > .body { - padding: 20px; -} - -.main-panel .accounts { - background-color: #333; - width: @accounts-width; - padding: @accounts-padding; - padding-right: 0px; -} - -.main-panel .accounts ul { - list-style: none; - margin: 0; - padding: 0; -} - -.main-panel .accounts li { - position: relative; - cursor: pointer; - color: white; - padding: 15px; - background-color: #444; - margin-bottom: @accounts-padding; - border-top-left-radius: @accounts-corner - 1; - border-bottom-left-radius: @accounts-corner - 1; - z-index: 100; -} - -.main-panel .accounts li span.domain { - display: block; - font-weight: bold; - //margin-left: 40px; -} - -.main-panel .accounts li span.username { - display: block; - //margin-left: 40px; - //line-height: 7px; - //margin-bottom: 4px; -} - -/*.main-panel .accounts li span.icon { - display: block; - height: 32px; - width: 32px; - background-color: #999; - float: left; -} -*/ - -.main-panel .accounts li.active { - background-color: white; - color: #333; -} - -.main-panel .accounts li.active span.arc { - display: block; - height: @accounts-corner; - width: @accounts-corner; - background-color: white; - position: absolute; - right: 0; -} - -.main-panel .accounts li.active span.arc.top { - top: 0; - margin-top: -@accounts-corner; -} -.main-panel .accounts li.active span.arc.bottom { - bottom: 0; - margin-bottom: -@accounts-corner; -} -.main-panel .accounts li.active span.arc:after { - display: block; - content: ""; - border-radius: 100%; - height: 0px; - width: 0px; - margin-left: -@accounts-corner; -} -.main-panel .accounts li.active span.arc.top:after { - border: @accounts-corner solid transparent; - border-right: @accounts-corner solid #333; - margin-top: -@accounts-corner; - -webkit-transform: rotate(45deg); - transform: rotate(45deg); -} -.main-panel .accounts li.active span.arc.bottom:after { - border: @accounts-corner solid #333; -} - -.main-panel .accounts .btn.expander { - margin-right: @accounts-padding; -} - -// -// SECTIONS -// - -@icon-size: 32px; -@status-size: 24px; -@section-padding: 10px; - -// service sections layout - -.main-panel .service-section { - display: -webkit-flex; - -webkit-flex-direction: row; - > .icon { - -webkit-flex: 0 0 auto; - } - > .body { - -webkit-flex: 1 1 auto; - } - > .buttons { - -webkit-flex: 0 0 auto; - } - > .status { - -webkit-flex: 0 0 auto; - display: -webkit-flex; - -webkit-align-items: center; - } - -} - -.main-panel .service-section div { - //outline: 1px solid rgba(0,0,0,0.1); -} - -// service sections style - -.main-panel .service-section { - background: #f6f6f6; - border-radius: 4px; - padding: 10px; - margin-bottom: 10px; - &.wide-margin { - padding: 20px 20px 20px 10px; // arbitrary, looks nice - } - > .icon { - padding-right: @section-padding; - img { - width: @icon-size; - height: @icon-size; - } - } - > .body { - h1 { - margin: 0; - padding: 0; - font-size: @icon-size - 10; - line-height: @icon-size; - } - } - > .buttons { - padding-left: 10px; - } - > .status { - padding-left: @section-padding; - width: @section-padding + @status-size; - img { - width: @status-size; - height: @status-size; - } - } -} - diff --git a/www/app/components/main_panel/section_layout.js b/www/app/components/main_panel/section_layout.js deleted file mode 100644 index e7c6f2a..0000000 --- a/www/app/components/main_panel/section_layout.js +++ /dev/null @@ -1,59 +0,0 @@ -// -// This is the layout for a service section in the main window. -// It does not do anything except for arrange items using css and html. -// - -import React from 'react' - -export default class SectionLayout extends React.Component { - - static get defaultProps() {return{ - icon: null, - buttons: null, - status: null, - className: "", - style: {} - }} - - constructor(props) { - super(props) - } - - render() { - let className = ["service-section", this.props.className].join(' ') - let status = null - let icon = null - let buttons = null - - if (this.props.status) { - status = ( -
    - -
    - ) - } - if (this.props.icon) { - icon = ( -
    - -
    - ) - } - if (this.props.buttons) - buttons = ( -
    - {this.props.buttons} -
    - ) - return( -
    - {icon} -
    - {this.props.children} -
    - {buttons} - {status} -
    - ) - } -} diff --git a/www/app/components/main_panel/user_section.js b/www/app/components/main_panel/user_section.js deleted file mode 100644 index 0b4ba13..0000000 --- a/www/app/components/main_panel/user_section.js +++ /dev/null @@ -1,71 +0,0 @@ -import React from 'react' -import { Button, Glyphicon, Alert } from 'react-bootstrap' -import SectionLayout from './section_layout' -import Login from 'components/login' -import Spinner from 'components/spinner' -import Account from 'models/account' - -import bitmask from 'lib/bitmask' - -export default class UserSection extends React.Component { - - static get defaultProps() {return{ - account: null, - onLogout: null, - onLogin: null - }} - - constructor(props) { - super(props) - this.state = { - error: null, - loading: false - } - this.logout = this.logout.bind(this) - } - - logout() { - this.setState({loading: true}) - this.props.account.logout().then( - account => { - this.setState({error: null, loading: false}) - if (this.props.onLogout) { - this.props.onLogout(account) - } - }, error => { - this.setState({error: error, loading: false}) - } - ) - } - - render () { - let message = null - if (this.state.error) { - // style may be: success, warning, danger, info - message = ( - {this.state.error} - ) - } - - if (this.props.account.authenticated) { - let button = null - if (this.state.loading) { - button = - } else { - button = - } - return ( - -

    {this.props.account.address}

    - {message} -
    - ) - } else { - return ( - - - - ) - } - } -} diff --git a/www/app/components/main_panel/vpn_section.js b/www/app/components/main_panel/vpn_section.js deleted file mode 100644 index e69de29..0000000 diff --git a/www/app/components/panel_switcher.js b/www/app/components/panel_switcher.js deleted file mode 100644 index aaf2dc5..0000000 --- a/www/app/components/panel_switcher.js +++ /dev/null @@ -1,58 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' - -import DebugPanel from './debug_panel' -import Splash from './splash' -import GreeterPanel from './greeter_panel' -import MainPanel from './main_panel' -import Wizard from './wizard' - -import App from 'app' -import 'lib/common' - -export default class PanelSwitcher extends React.Component { - - constructor(props) { - super(props) - this.state = { - panel: null, - panel_properties: null, - debug: false - } - App.switcher = this - } - - show(component_name, properties={}) { - this.setState({panel: component_name, panel_properties: properties}) - } - - render() { - let elems = [] - if (this.panelExist(this.state.panel)) { - elems.push( - this.panelRender(this.state.panel, this.state.panel_properties) - ) - } - if (this.state.debug) { - elems.push( - elem(DebugPanel, {key: 'debug'}) - ) - } - return
    {elems}
    - } - - panelExist(panel) { - return panel && this['render_'+panel] - } - - panelRender(panel_name, props) { - let panel = this['render_'+panel_name](props) - return elem('div', {key: 'panel'}, panel) - } - - render_splash(props) {return elem(Splash, props)} - render_wizard(props) {return elem(Wizard, props)} - render_greeter(props) {return elem(GreeterPanel, props)} - render_main(props) {return elem(MainPanel, props)} - -} diff --git a/www/app/components/spinner/index.js b/www/app/components/spinner/index.js deleted file mode 100644 index ffc3285..0000000 --- a/www/app/components/spinner/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react'; -import './spinner.css'; - -class Spinner extends React.Component { - render() { - let props = {} - return
    -
    -
    -
    -
    - } -} - -export default Spinner \ No newline at end of file diff --git a/www/app/components/spinner/spinner.css b/www/app/components/spinner/spinner.css deleted file mode 100644 index 5e8535c..0000000 --- a/www/app/components/spinner/spinner.css +++ /dev/null @@ -1,42 +0,0 @@ -.spinner { - height: 18px; - display: inline-block; -} - -.spinner > div { - width: 18px; - height: 18px; - background-color: #000; - vertical-align: middle; - border-radius: 100%; - display: inline-block; - -webkit-animation: bouncedelay 1.5s infinite ease-in-out; - animation: bouncedelay 1.5s infinite ease-in-out; - -webkit-animation-fill-mode: both; - animation-fill-mode: both; -} - -.spinner .spin1 { - -webkit-animation-delay: -.46s; - animation-delay: -.46s; -} -.spinner .spin2 { - -webkit-animation-delay: -.24s; - animation-delay: -.24s; -} - -@-webkit-keyframes bouncedelay { - 0%, 80%, 100% { - -webkit-transform: scale(0.5); - } 40% { - -webkit-transform: scale(0.9); - } -} - -@keyframes bouncedelay { - 0%, 80%, 100% { - transform: scale(0.5); - } 40% { - transform: scale(0.9); - } -} diff --git a/www/app/components/splash.js b/www/app/components/splash.js deleted file mode 100644 index 46170d2..0000000 --- a/www/app/components/splash.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * A simple animated splash screen - */ - -import React from 'react' -import * as COLOR from '../lib/colors' - -const colorList = [ - COLOR.red200, COLOR.pink200, COLOR.purple200, COLOR.deepPurple200, - COLOR.indigo200, COLOR.blue200, COLOR.lightBlue200, COLOR.cyan200, - COLOR.teal200, COLOR.green200, COLOR.lightGreen200, COLOR.lime200, - COLOR.yellow200, COLOR.amber200, COLOR.orange200, COLOR.deepOrange200 -] - -export default class Splash extends React.Component { - - static get defaultProps() {return{ - speed: "fast", - mask: true, - onClick: null - }} - - constructor(props) { - super(props) - this.counter = 0 - this.interval = null - this.ctx = null - this.stepAngle = 0 - this.resize = this.resize.bind(this) - this.click = this.click.bind(this) - if (this.props.speed == "fast") { - this.fps = 30 - this.stepAngle = 0.005 - } else { - this.fps = 30 - this.stepAngle = 0.0005 - } - } - - componentDidMount() { - this.interval = setInterval(this.tick.bind(this), 1000/this.fps) - this.canvas = this.refs.canvas - this.ctx = this.canvas.getContext('2d') - window.addEventListener('resize', this.resize) - } - - componentWillUnmount() { - clearInterval(this.interval) - window.removeEventListener('resize', this.resize) - } - - click() { - if (this.props.onClick) { - this.props.onClick() - } - } - - tick() { - this.counter++ - this.updateCanvas() - } - - resize() { - this.canvas.width = window.innerWidth - this.canvas.height = window.innerHeight - this.updateCanvas() - } - - updateCanvas() { - const arcCount = 16 - const arcAngle = 1 / arcCount - const x = this.canvas.width / 2 - const y = this.canvas.height / 2 - const radius = screen.height + screen.width - - for (let i = 0; i < arcCount; i++) { - let startAngle = Math.PI * 2 * i/arcCount + this.stepAngle*this.counter - let endAngle = Math.PI * 2 * (i+1)/arcCount + this.stepAngle*this.counter - - this.ctx.fillStyle = colorList[i % colorList.length] - this.ctx.strokeStyle = colorList[i % colorList.length] - this.ctx.beginPath() - this.ctx.moveTo(x, y) - this.ctx.arc(x, y, radius, startAngle, endAngle) - this.ctx.lineTo(x, y) - this.ctx.fill() - this.ctx.stroke() - } - - } - - render () { - let overlay = null - let mask = null - if (this.props.onClick) { - overlay = React.DOM.div({ - style: { - position: 'absolute', - height: '100%', - width: '100%', - backgroundColor: 'transparent' - }, - onClick: this.click - }) - } - if (this.props.mask) { - mask = React.DOM.img({ - src: 'img/mask.svg', - style: { - position: 'absolute', - left: '50%', - top: '50%', - marginLeft: -330/2 + 'px', - marginTop: -174/2 + 'px', - } - }) - } - return React.DOM.div( - {style: {overflow: 'hidden'}}, - React.DOM.canvas({ - ref: 'canvas', - style: {position: 'absolute'}, - width: window.innerWidth, - height: window.innerHeight, - }), - mask, - overlay - ) - } - -} - diff --git a/www/app/components/wizard/add_provider_modal.js b/www/app/components/wizard/add_provider_modal.js deleted file mode 100644 index bc5e023..0000000 --- a/www/app/components/wizard/add_provider_modal.js +++ /dev/null @@ -1,94 +0,0 @@ -// -// A modal popup to add a new provider. -// - -import React from 'react' -import { FormGroup, ControlLabel, FormControl, HelpBlock, Button, Modal } from 'react-bootstrap' -import Spinner from '../spinner' -import Validate from '../../lib/validate' -import App from '../../app' - -class AddProviderModal extends React.Component { - - static get defaultProps() {return{ - title: 'Add a provider', - onClose: null - }} - - constructor(props) { - super(props) - this.state = { - validationState: null, - errorMsg: null, - domain: "" - } - this.accept = this.accept.bind(this) - this.cancel = this.cancel.bind(this) - this.changed = this.changed.bind(this) - } - - accept() { - if (this.state.domain) { - App.providers.add(this.state.domain) - } - this.props.onClose() - } - - cancel() { - this.props.onClose() - } - - changed(e) { - let domain = e.target.value - let newState = null - let newMsg = null - - if (domain.length > 0) { - let error = Validate.domain(domain) - newState = error ? 'error' : 'success' - newMsg = error - } - this.setState({ - domain: domain, - validationState: newState, - errorMsg: newMsg - }) - } - - render() { - let help = null - if (this.state.errorMsg) { - help = {this.state.errorMsg} - } else { - help =   - } - let form =
    - - Domain - - - {help} - - -
    - - return( - - - {this.props.title} - - - {form} - - - ) - } -} - -export default AddProviderModal \ No newline at end of file diff --git a/www/app/components/wizard/index.js b/www/app/components/wizard/index.js deleted file mode 100644 index 613b88f..0000000 --- a/www/app/components/wizard/index.js +++ /dev/null @@ -1,38 +0,0 @@ -// -// The provider setup wizard -// - -import React from 'react' -import App from 'app' - -import ProviderSelectStage from './provider_select_stage' -import './wizard.less' - -export default class Wizard extends React.Component { - - constructor(props) { - super(props) - this.state = { - stage: 'provider' - } - } - - setStage(stage) { - this.setState({stage: stage}) - } - - render() { - let stage = null - switch(this.state.stage) { - case 'provider': - stage = - break - } - return( -
    - {stage} -
    - ) - } - -} diff --git a/www/app/components/wizard/provider_select_stage.js b/www/app/components/wizard/provider_select_stage.js deleted file mode 100644 index 20674be..0000000 --- a/www/app/components/wizard/provider_select_stage.js +++ /dev/null @@ -1,86 +0,0 @@ -import React from 'react' -import {Button, ButtonGroup, ButtonToolbar, Glyphicon} from 'react-bootstrap' - -import App from 'app' -import ListEdit from 'components/list_edit' -import StageLayout from './stage_layout' -import AddProviderModal from './add_provider_modal' - -export default class ProviderSelectStage extends React.Component { - - static get defaultProps() {return{ - title: "Choose a provider", - subtitle: "This doesn't work yet" - }} - - constructor(props) { - super(props) - let domains = this.currentDomains() - this.state = { - domains: domains, - showModal: false - } - this.add = this.add.bind(this) - this.remove = this.remove.bind(this) - this.close = this.close.bind(this) - this.previous = this.previous.bind(this) - } - - currentDomains() { - // return(App.providers.domains().slice() || []) - return ['domain1', 'domain2', 'domain3'] - } - - add() { - this.setState({showModal: true}) - } - - remove(provider) { - // App.providers.remove(provider) - this.setState({domains: this.currentDomains()}) - } - - close() { - let domains = this.currentDomains() - if (domains.length != this.state.domains.length) { - // this is ugly, but i could not get selection working - // by passing it as a property - this.refs.list.setSelected(0) - } - this.setState({ - domains: domains, - showModal: false - }) - } - - previous() { - App.start() - } - - render() { - let modal = null - if (this.state.showModal) { - modal = - } - let buttons = ( - - - - - ) - let select = - return( - - {select} - {modal} - - ) - } -} diff --git a/www/app/components/wizard/stage_layout.js b/www/app/components/wizard/stage_layout.js deleted file mode 100644 index 3154022..0000000 --- a/www/app/components/wizard/stage_layout.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react' - -class StageLayout extends React.Component { - - static get defaultProps() {return{ - title: 'untitled', - subtitle: null, - buttons: null - }} - - constructor(props) { - super(props) - } - - render() { - let subtitle = null - if (this.props.subtitle) { - subtitle = {this.props.subtitle} - } - return( -
    -
    - {this.props.title} - {subtitle} -
    -
    - {this.props.children} -
    -
    - {this.props.buttons} -
    -
    - ) - } -} - -export default StageLayout \ No newline at end of file diff --git a/www/app/components/wizard/wizard.less b/www/app/components/wizard/wizard.less deleted file mode 100644 index 29efc20..0000000 --- a/www/app/components/wizard/wizard.less +++ /dev/null @@ -1,44 +0,0 @@ -.wizard .stage { - position: absolute; - height: 100%; - width: 100%; - - display: -webkit-flex; - display: flex; - -webkit-flex-direction: column; - flex-direction: column; - -webkit-flex: 1; - flex: 1; -} - -.wizard .stage .footer { - -webkit-flex: 0 0 auto; - flex: 0 0 auto; - background-color: #ddd; - padding: 20px; - text-align: right; -} - -.wizard .stage .header { - -webkit-flex: 0 0 auto; - flex: 0 0 auto; - padding: 20px; - background-color: #333; - color: white; - font-size: 2em; - span { - margin-left: 10px; - font-size: 0.5em; - } -} - -.wizard .stage .body { - -webkit-flex: 1 1 auto; - flex: 1 1 auto; - padding: 20px; - overflow: auto; - display: -webkit-flex; - display: flex; - -webkit-flex-direction: column; - flex-direction: column; -} \ No newline at end of file diff --git a/www/app/css/bootstrap.less b/www/app/css/bootstrap.less deleted file mode 100644 index 3b77228..0000000 --- a/www/app/css/bootstrap.less +++ /dev/null @@ -1,5 +0,0 @@ -// -// require npm modules 'bootstrap' -// -@import "~bootstrap/less/bootstrap"; - diff --git a/www/app/css/common.css b/www/app/css/common.css deleted file mode 100644 index acf164e..0000000 --- a/www/app/css/common.css +++ /dev/null @@ -1,80 +0,0 @@ -body { - padding: 0; - margin: 0; -} - -.debug-panel { - background-color: rgba(0,0,0,0.1); - position: absolute; - bottom: 0; - left: 50%; - z-index: 1000; - padding: 20px; -} -.debug-panel a { - cursor: pointer; - margin: 10px; -} - - -.area-light { - background-color: #f7f7f7; -} -.area-dark { - background-color: #e7e7e7; -} -.area-clear { - background-color: #fff; -} - -/* - * Greeter - */ -.greeter { - border-color: #555; - border-width: 8px; -} - -/* - * bootstrap - */ - -.help-block { - margin: 2px 0 0 0; - font-size: small; - opacity: 0.7; -} -.btn.btn-inverse { - color: white; - background-color: #333; -} -.btn.btn-flat { - border-color: transparent; - background-color: transparent; -} - -/*.btn.btn-default { - background-color: #eee !important; -} -*/ - -/* - * center component - */ - -.center-container { - position: absolute; - display: -webkit-flex; - -webkit-flex-flow: row nowrap; - -webkit-justify-content: center; - -webkit-align-content: center; - -webkit-align-items: center; - top: 0px; - left: 0px; - height: 100%; - width: 100%; -} - -.center-container .center-item { - -webkit-flex: 0 1 auto; -} diff --git a/www/app/img/arrow-down.svg b/www/app/img/arrow-down.svg deleted file mode 100644 index 14c4b5d..0000000 --- a/www/app/img/arrow-down.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/www/app/img/arrow-up.svg b/www/app/img/arrow-up.svg deleted file mode 100644 index 30ea8fd..0000000 --- a/www/app/img/arrow-up.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/www/app/img/cloud.svg b/www/app/img/cloud.svg deleted file mode 100644 index bf7a94a..0000000 --- a/www/app/img/cloud.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/www/app/img/disabled.svg b/www/app/img/disabled.svg deleted file mode 100644 index 90804d8..0000000 --- a/www/app/img/disabled.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - diff --git a/www/app/img/envelope.svg b/www/app/img/envelope.svg deleted file mode 100644 index 5775e09..0000000 --- a/www/app/img/envelope.svg +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/www/app/img/gear.svg b/www/app/img/gear.svg deleted file mode 100644 index be5a5b3..0000000 --- a/www/app/img/gear.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/www/app/img/mask.svg b/www/app/img/mask.svg deleted file mode 100644 index f254c5e..0000000 --- a/www/app/img/mask.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - diff --git a/www/app/img/off.svg b/www/app/img/off.svg deleted file mode 100644 index 35c49a5..0000000 --- a/www/app/img/off.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/www/app/img/on.svg b/www/app/img/on.svg deleted file mode 100644 index 36938e0..0000000 --- a/www/app/img/on.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/www/app/img/planet.svg b/www/app/img/planet.svg deleted file mode 100644 index 5697d5d..0000000 --- a/www/app/img/planet.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/www/app/img/unknown.svg b/www/app/img/unknown.svg deleted file mode 100644 index 6003863..0000000 --- a/www/app/img/unknown.svg +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/www/app/img/user.svg b/www/app/img/user.svg deleted file mode 100644 index ad86a75..0000000 --- a/www/app/img/user.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/www/app/img/wait.svg b/www/app/img/wait.svg deleted file mode 100644 index 2ae0113..0000000 --- a/www/app/img/wait.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/www/app/index.html b/www/app/index.html deleted file mode 100644 index 440e0b6..0000000 --- a/www/app/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Bitmask - - - - -
    - - - \ No newline at end of file diff --git a/www/app/lib/bitmask.js b/www/app/lib/bitmask.js deleted file mode 100644 index fedd5fc..0000000 --- a/www/app/lib/bitmask.js +++ /dev/null @@ -1,306 +0,0 @@ -// bitmask.js -// Copyright (C) 2016 LEAP -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -/** - * bitmask object - * - * Contains all the bitmask API mapped by sections - * - user. User management like login, creation, ... - * - mail. Email service control. - * - keys. Keyring operations. - * - events. For registering to events. - * - * Every function returns a Promise that will be triggered once the request is - * finished or will fail if there was any error. Errors are always user readable - * strings. - */ - -try { - // Use Promises in non-ES6 compliant engines. - eval('import "babel-polyfill";') -} -catch (err) {} - -var bitmask = function(){ - var event_handlers = {}; - - var api_url = '/API/'; - if (window.location.protocol === "file:") { - api_url = 'http://localhost:7070/API/'; - } - - function call(command) { - var url = api_url + command.slice(0, 2).join('/'); - var data = JSON.stringify(command.slice(2)); - - return new Promise(function(resolve, reject) { - var req = new XMLHttpRequest(); - req.open('POST', url); - - req.onload = function() { - if (req.status == 200) { - parseResponse(req.response, resolve, reject); - } - else { - reject(Error(req.statusText)); - } - }; - - req.onerror = function() { - reject(Error("Network Error")); - }; - - req.send(data); - }); - }; - - function parseResponse(raw_response, resolve, reject) { - var response = JSON.parse(raw_response); - if (response.error === null) { - resolve(response.result); - } else { - reject(response.error); - } - }; - - function event_polling() { - call(['events', 'poll']).then(function(response) { - if (response !== null) { - evnt = response[0]; - content = response[1]; - if (evnt in event_handlers) { - event_handlers[evnt](evnt, content); - } - } - event_polling(); - }, function(error) { - setTimeout(event_polling, 5000); - }); - }; - event_polling(); - - function private_str(priv) { - if (priv) { - return 'private' - } - return 'public' - }; - - return { - bonafide: { - provider: { - create: function(domain) { - return call(['bonafide', 'provider', 'create', domain]); - }, - - read: function(domain) { - return call(['bonafide', 'provider', 'read', domain]); - }, - - delete: function(domain) { - return call(['bonafide', 'provider', 'delete', domain]); - }, - - list: function(seeded) { - if (typeof seeded !== 'boolean') { - seeded = false; - } - return call(['bonafide', 'provider', 'list', seeded]); - } - }, - - /** - * uids are of the form user@provider.net - */ - user: { - /** - * Check wich user is active - * - * @return {Promise} The uid of the active user - */ - active: function() { - return call(['bonafide', 'user', 'active']); - }, - - /** - * Register a new user - * - * @param {string} uid The uid to be created - * @param {string} password The user password - * @param {boolean} autoconf If the provider should be autoconfigured if it's not allready known - * If it's not provided it will default to false - */ - create: function(uid, password, autoconf) { - if (typeof autoconf !== 'boolean') { - autoconf = false; - } - return call(['bonafide', 'user', 'create', uid, password, autoconf]); - }, - - /** - * Login - * - * @param {string} uid The uid to log in - * @param {string} password The user password - * @param {boolean} autoconf If the provider should be autoconfigured if it's not allready known - * If it's not provided it will default to false - */ - auth: function(uid, password, autoconf) { - if (typeof autoconf !== 'boolean') { - autoconf = false; - } - return call(['bonafide', 'user', 'authenticate', uid, password, autoconf]); - }, - - /** - * Logout - * - * @param {string} uid The uid to log out. - * If no uid is provided the active user will be used - */ - logout: function(uid) { - if (typeof uid !== 'string') { - uid = ""; - } - return call(['bonafide', 'user', 'logout', uid]); - } - } - }, - - mail: { - /** - * Check the status of the email service - * - * @return {Promise} User readable status - */ - status: function() { - return call(['mail', 'status']); - }, - - /** - * Get the token of the active user. - * - * This token is used as password to authenticate in the IMAP and SMTP services. - * - * @return {Promise} The token - */ - get_token: function() { - return call(['mail', 'get_token']); - } - }, - - /** - * A KeyObject have the following attributes: - * - address {string} the email address for wich this key is active - * - fingerprint {string} the fingerprint of the key - * - length {number} the size of the key bits - * - private {bool} if the key is private - * - uids {[string]} the uids in the key - * - key_data {string} the key content - * - validation {string} the validation level which this key was found - * - expiry_date {string} date when the key expires - * - refreshed_at {string} date of the last refresh of the key - * - audited_at {string} date of the last audit (unused for now) - * - sign_used {bool} if has being used to checking signatures - * - enc_used {bool} if has being used to encrypt - */ - keys: { - /** - * List all the keys in the keyring - * - * @param {boolean} priv Should list private keys? - * If it's not provided the public ones will be listed. - * - * @return {Promise<[KeyObject]>} List of keys in the keyring - */ - list: function(priv) { - return call(['keys', 'list', private_str(priv)]); - }, - - /** - * Export key - * - * @param {string} address The email address of the key - * @param {boolean} priv Should get the private key? - * If it's not provided the public one will be fetched. - * - * @return {Promise} The key - */ - exprt: function(address, priv) { - return call(['keys', 'export', address, private_str(priv)]); - }, - - /** - * Insert key - * - * @param {string} address The email address of the key - * @param {string} rawkey The key material - * @param {string} validation The validation level of the key - * If it's not provided 'Fingerprint' level will be used. - * - * @return {Promise} The key - */ - insert: function(address, rawkey, validation) { - if (typeof validation !== 'string') { - validation = 'Fingerprint'; - } - return call(['keys', 'insert', address, validation, rawkey]); - }, - - /** - * Delete a key - * - * @param {string} address The email address of the key - * @param {boolean} priv Should get the private key? - * If it's not provided the public one will be deleted. - * - * @return {Promise} The key - */ - del: function(address, priv) { - return call(['keys', 'delete', address, private_str(priv)]); - } - }, - - events: { - /** - * Register func for an event - * - * @param {string} evnt The event to register - * @param {function} func The function that will be called on each event. - * It has to be like: function(event, content) {} - * Where content will be a list of strings. - */ - register: function(evnt, func) { - event_handlers[evnt] = func; - return call(['events', 'register', evnt]) - }, - - /** - * Unregister from an event - * - * @param {string} evnt The event to unregister - */ - unregister: function(evnt) { - delete event_handlers[evnt]; - return call(['events', 'unregister', evnt]) - } - } - }; -}(); - -try { - module.exports = bitmask -} catch(err) {} diff --git a/www/app/lib/color.js b/www/app/lib/color.js deleted file mode 100644 index 5b1dfee..0000000 --- a/www/app/lib/color.js +++ /dev/null @@ -1,65 +0,0 @@ -// -// Color.hsv().css -// -// RGB values are 0..255 -// HSV values are 0..1 -// - -function compose(value) - return [ - Math.round(value * 255), - Math.round(value * 255), - Math.round(value * 255) - } -} - -class Color { - - constructor(r, g, b, a) { - this.r = r - this.g = g - this.b = b - this.a = a - } - - // - // alternate hsv factory - // - static hsv(h,s,v) { - let out = null - h = h % 360; - s = Math.max(0, Math.min(1, s)) - v = Math.max(0, Math.min(1, v)) - - if (s == 0) { - let grey = Math.ceil(v*255) - out = [grey, grey, grey] - } - - let b = ((1 - s) * v); - let vb = v - b; - let hm = h % 60; - switch((h/60)|0) { - case 0: - out = compose(v, vb * h / 60 + b, b); break - case 1: - out = compose(vb * (60 - hm) / 60 + b, v, b); break - case 2: - out = compose(b, v, vb * hm / 60 + b); break - case 3: - out = compose(b, vb * (60 - hm) / 60 + b, v); break - case 4: - out = compose(vb * hm / 60 + b, b, v); break - case 5: - out = compose(v, b, vb * (60 - hm) / 60 + b); break - } - - return new Color(...out) - } - - css() { - return `rgba(${this.r}, ${this.g}, ${this.b}, ${this.a})` - } -} - -export default Color \ No newline at end of file diff --git a/www/app/lib/colors.js b/www/app/lib/colors.js deleted file mode 100644 index d86ca0a..0000000 --- a/www/app/lib/colors.js +++ /dev/null @@ -1,289 +0,0 @@ -// -// a palette from google's material design -// - -export const red50 = '#ffebee'; -export const red100 = '#ffcdd2'; -export const red200 = '#ef9a9a'; -export const red300 = '#e57373'; -export const red400 = '#ef5350'; -export const red500 = '#f44336'; -export const red600 = '#e53935'; -export const red700 = '#d32f2f'; -export const red800 = '#c62828'; -export const red900 = '#b71c1c'; -export const redA100 = '#ff8a80'; -export const redA200 = '#ff5252'; -export const redA400 = '#ff1744'; -export const redA700 = '#d50000'; - -export const pink50 = '#fce4ec'; -export const pink100 = '#f8bbd0'; -export const pink200 = '#f48fb1'; -export const pink300 = '#f06292'; -export const pink400 = '#ec407a'; -export const pink500 = '#e91e63'; -export const pink600 = '#d81b60'; -export const pink700 = '#c2185b'; -export const pink800 = '#ad1457'; -export const pink900 = '#880e4f'; -export const pinkA100 = '#ff80ab'; -export const pinkA200 = '#ff4081'; -export const pinkA400 = '#f50057'; -export const pinkA700 = '#c51162'; - -export const purple50 = '#f3e5f5'; -export const purple100 = '#e1bee7'; -export const purple200 = '#ce93d8'; -export const purple300 = '#ba68c8'; -export const purple400 = '#ab47bc'; -export const purple500 = '#9c27b0'; -export const purple600 = '#8e24aa'; -export const purple700 = '#7b1fa2'; -export const purple800 = '#6a1b9a'; -export const purple900 = '#4a148c'; -export const purpleA100 = '#ea80fc'; -export const purpleA200 = '#e040fb'; -export const purpleA400 = '#d500f9'; -export const purpleA700 = '#aa00ff'; - -export const deepPurple50 = '#ede7f6'; -export const deepPurple100 = '#d1c4e9'; -export const deepPurple200 = '#b39ddb'; -export const deepPurple300 = '#9575cd'; -export const deepPurple400 = '#7e57c2'; -export const deepPurple500 = '#673ab7'; -export const deepPurple600 = '#5e35b1'; -export const deepPurple700 = '#512da8'; -export const deepPurple800 = '#4527a0'; -export const deepPurple900 = '#311b92'; -export const deepPurpleA100 = '#b388ff'; -export const deepPurpleA200 = '#7c4dff'; -export const deepPurpleA400 = '#651fff'; -export const deepPurpleA700 = '#6200ea'; - -export const indigo50 = '#e8eaf6'; -export const indigo100 = '#c5cae9'; -export const indigo200 = '#9fa8da'; -export const indigo300 = '#7986cb'; -export const indigo400 = '#5c6bc0'; -export const indigo500 = '#3f51b5'; -export const indigo600 = '#3949ab'; -export const indigo700 = '#303f9f'; -export const indigo800 = '#283593'; -export const indigo900 = '#1a237e'; -export const indigoA100 = '#8c9eff'; -export const indigoA200 = '#536dfe'; -export const indigoA400 = '#3d5afe'; -export const indigoA700 = '#304ffe'; - -export const blue50 = '#e3f2fd'; -export const blue100 = '#bbdefb'; -export const blue200 = '#90caf9'; -export const blue300 = '#64b5f6'; -export const blue400 = '#42a5f5'; -export const blue500 = '#2196f3'; -export const blue600 = '#1e88e5'; -export const blue700 = '#1976d2'; -export const blue800 = '#1565c0'; -export const blue900 = '#0d47a1'; -export const blueA100 = '#82b1ff'; -export const blueA200 = '#448aff'; -export const blueA400 = '#2979ff'; -export const blueA700 = '#2962ff'; - -export const lightBlue50 = '#e1f5fe'; -export const lightBlue100 = '#b3e5fc'; -export const lightBlue200 = '#81d4fa'; -export const lightBlue300 = '#4fc3f7'; -export const lightBlue400 = '#29b6f6'; -export const lightBlue500 = '#03a9f4'; -export const lightBlue600 = '#039be5'; -export const lightBlue700 = '#0288d1'; -export const lightBlue800 = '#0277bd'; -export const lightBlue900 = '#01579b'; -export const lightBlueA100 = '#80d8ff'; -export const lightBlueA200 = '#40c4ff'; -export const lightBlueA400 = '#00b0ff'; -export const lightBlueA700 = '#0091ea'; - -export const cyan50 = '#e0f7fa'; -export const cyan100 = '#b2ebf2'; -export const cyan200 = '#80deea'; -export const cyan300 = '#4dd0e1'; -export const cyan400 = '#26c6da'; -export const cyan500 = '#00bcd4'; -export const cyan600 = '#00acc1'; -export const cyan700 = '#0097a7'; -export const cyan800 = '#00838f'; -export const cyan900 = '#006064'; -export const cyanA100 = '#84ffff'; -export const cyanA200 = '#18ffff'; -export const cyanA400 = '#00e5ff'; -export const cyanA700 = '#00b8d4'; - -export const teal50 = '#e0f2f1'; -export const teal100 = '#b2dfdb'; -export const teal200 = '#80cbc4'; -export const teal300 = '#4db6ac'; -export const teal400 = '#26a69a'; -export const teal500 = '#009688'; -export const teal600 = '#00897b'; -export const teal700 = '#00796b'; -export const teal800 = '#00695c'; -export const teal900 = '#004d40'; -export const tealA100 = '#a7ffeb'; -export const tealA200 = '#64ffda'; -export const tealA400 = '#1de9b6'; -export const tealA700 = '#00bfa5'; - -export const green50 = '#e8f5e9'; -export const green100 = '#c8e6c9'; -export const green200 = '#a5d6a7'; -export const green300 = '#81c784'; -export const green400 = '#66bb6a'; -export const green500 = '#4caf50'; -export const green600 = '#43a047'; -export const green700 = '#388e3c'; -export const green800 = '#2e7d32'; -export const green900 = '#1b5e20'; -export const greenA100 = '#b9f6ca'; -export const greenA200 = '#69f0ae'; -export const greenA400 = '#00e676'; -export const greenA700 = '#00c853'; - -export const lightGreen50 = '#f1f8e9'; -export const lightGreen100 = '#dcedc8'; -export const lightGreen200 = '#c5e1a5'; -export const lightGreen300 = '#aed581'; -export const lightGreen400 = '#9ccc65'; -export const lightGreen500 = '#8bc34a'; -export const lightGreen600 = '#7cb342'; -export const lightGreen700 = '#689f38'; -export const lightGreen800 = '#558b2f'; -export const lightGreen900 = '#33691e'; -export const lightGreenA100 = '#ccff90'; -export const lightGreenA200 = '#b2ff59'; -export const lightGreenA400 = '#76ff03'; -export const lightGreenA700 = '#64dd17'; - -export const lime50 = '#f9fbe7'; -export const lime100 = '#f0f4c3'; -export const lime200 = '#e6ee9c'; -export const lime300 = '#dce775'; -export const lime400 = '#d4e157'; -export const lime500 = '#cddc39'; -export const lime600 = '#c0ca33'; -export const lime700 = '#afb42b'; -export const lime800 = '#9e9d24'; -export const lime900 = '#827717'; -export const limeA100 = '#f4ff81'; -export const limeA200 = '#eeff41'; -export const limeA400 = '#c6ff00'; -export const limeA700 = '#aeea00'; - -export const yellow50 = '#fffde7'; -export const yellow100 = '#fff9c4'; -export const yellow200 = '#fff59d'; -export const yellow300 = '#fff176'; -export const yellow400 = '#ffee58'; -export const yellow500 = '#ffeb3b'; -export const yellow600 = '#fdd835'; -export const yellow700 = '#fbc02d'; -export const yellow800 = '#f9a825'; -export const yellow900 = '#f57f17'; -export const yellowA100 = '#ffff8d'; -export const yellowA200 = '#ffff00'; -export const yellowA400 = '#ffea00'; -export const yellowA700 = '#ffd600'; - -export const amber50 = '#fff8e1'; -export const amber100 = '#ffecb3'; -export const amber200 = '#ffe082'; -export const amber300 = '#ffd54f'; -export const amber400 = '#ffca28'; -export const amber500 = '#ffc107'; -export const amber600 = '#ffb300'; -export const amber700 = '#ffa000'; -export const amber800 = '#ff8f00'; -export const amber900 = '#ff6f00'; -export const amberA100 = '#ffe57f'; -export const amberA200 = '#ffd740'; -export const amberA400 = '#ffc400'; -export const amberA700 = '#ffab00'; - -export const orange50 = '#fff3e0'; -export const orange100 = '#ffe0b2'; -export const orange200 = '#ffcc80'; -export const orange300 = '#ffb74d'; -export const orange400 = '#ffa726'; -export const orange500 = '#ff9800'; -export const orange600 = '#fb8c00'; -export const orange700 = '#f57c00'; -export const orange800 = '#ef6c00'; -export const orange900 = '#e65100'; -export const orangeA100 = '#ffd180'; -export const orangeA200 = '#ffab40'; -export const orangeA400 = '#ff9100'; -export const orangeA700 = '#ff6d00'; - -export const deepOrange50 = '#fbe9e7'; -export const deepOrange100 = '#ffccbc'; -export const deepOrange200 = '#ffab91'; -export const deepOrange300 = '#ff8a65'; -export const deepOrange400 = '#ff7043'; -export const deepOrange500 = '#ff5722'; -export const deepOrange600 = '#f4511e'; -export const deepOrange700 = '#e64a19'; -export const deepOrange800 = '#d84315'; -export const deepOrange900 = '#bf360c'; -export const deepOrangeA100 = '#ff9e80'; -export const deepOrangeA200 = '#ff6e40'; -export const deepOrangeA400 = '#ff3d00'; -export const deepOrangeA700 = '#dd2c00'; - -export const brown50 = '#efebe9'; -export const brown100 = '#d7ccc8'; -export const brown200 = '#bcaaa4'; -export const brown300 = '#a1887f'; -export const brown400 = '#8d6e63'; -export const brown500 = '#795548'; -export const brown600 = '#6d4c41'; -export const brown700 = '#5d4037'; -export const brown800 = '#4e342e'; -export const brown900 = '#3e2723'; - -export const blueGrey50 = '#eceff1'; -export const blueGrey100 = '#cfd8dc'; -export const blueGrey200 = '#b0bec5'; -export const blueGrey300 = '#90a4ae'; -export const blueGrey400 = '#78909c'; -export const blueGrey500 = '#607d8b'; -export const blueGrey600 = '#546e7a'; -export const blueGrey700 = '#455a64'; -export const blueGrey800 = '#37474f'; -export const blueGrey900 = '#263238'; - -export const grey50 = '#fafafa'; -export const grey100 = '#f5f5f5'; -export const grey200 = '#eeeeee'; -export const grey300 = '#e0e0e0'; -export const grey400 = '#bdbdbd'; -export const grey500 = '#9e9e9e'; -export const grey600 = '#757575'; -export const grey700 = '#616161'; -export const grey800 = '#424242'; -export const grey900 = '#212121'; - -export const black = '#000000'; -export const white = '#ffffff'; - -export const transparent = 'rgba(0, 0, 0, 0)'; -export const fullBlack = 'rgba(0, 0, 0, 1)'; -export const darkBlack = 'rgba(0, 0, 0, 0.87)'; -export const lightBlack = 'rgba(0, 0, 0, 0.54)'; -export const minBlack = 'rgba(0, 0, 0, 0.26)'; -export const faintBlack = 'rgba(0, 0, 0, 0.12)'; -export const fullWhite = 'rgba(255, 255, 255, 1)'; -export const darkWhite = 'rgba(255, 255, 255, 0.87)'; -export const lightWhite = 'rgba(255, 255, 255, 0.54)'; \ No newline at end of file diff --git a/www/app/lib/common.js b/www/app/lib/common.js deleted file mode 100644 index 14a30c3..0000000 --- a/www/app/lib/common.js +++ /dev/null @@ -1,7 +0,0 @@ -/* - * pollute the global namespace with some useful utils - */ - -import React from 'react' - -window.elem = React.createElement \ No newline at end of file diff --git a/www/app/lib/validate.js b/www/app/lib/validate.js deleted file mode 100644 index 4e672e8..0000000 --- a/www/app/lib/validate.js +++ /dev/null @@ -1,82 +0,0 @@ -// https://github.com/dropbox/zxcvbn - -var DOMAIN_RE = /^((?:(?:(?:\w[\.\-\+]?)*)\w)+)((?:(?:(?:\w[\.\-\+]?){0,62})\w)+)\.(\w{2,6})$/ -var USER_RE = /^[a-z0-9_-]{1,200}$/ -var USER_INT_RE = /^[\.@a-z0-9_-]*$/ - -// -// Validations returns an error message or false if no errors -// - -class Validations { - - domain(input) { - if (!input.match(DOMAIN_RE)) { - return "Not a domain name" - } else { - return null - } - } - - usernameInteractive(input) { - if (!input.match(USER_INT_RE)) { - return "Username contains an invalid character" - } - return false - } - - username(input) { - if (!input.match(USER_INT_RE)) { - return "Username contains an invalid character" - } - if (!input.match('@')) { - return "Username must be in the form username@domain" - } - let parts = input.split('@') - let userpart = parts[0] - let domainpart = parts[1] - if (!userpart.match(USER_RE)) { - return "Username contains an invalid character" - } else if (!domainpart.match(DOMAIN_RE)) { - return "Username must include a valid domain name." - } - return false - } - - passwordStrength(passwd) { - if (typeof(zxcvbn) == 'function') { - // zxcvbn performs very slow on long strings, so we cap - // the calculation at 30 characters - return zxcvbn(passwd.substring(0,30)) - } else { - return null - } - } - - // - // loads the zxcvbn library. because this library is big, we don't load it - // every time, just when needed. - // - // this is the webpack way to do this: - // - // require.ensure([], function () { - // var zxcvbn = require('zxcvbn'); - // }); - // - // that works, but requires that we also process the original coffeescript - // source if we want to avoid warning messages. - // - loadPasswdLib(onload) { - var id = "zxcvbn-script" - if (!document.getElementById(id)) { - var script = document.createElement('script') - script.id = id - script.onload = onload - script.src = './js/zxcvbn.js' - document.getElementsByTagName('script')[0].appendChild(script) - } - } -} - -var Validate = new Validations() -export default Validate diff --git a/www/app/main.js b/www/app/main.js deleted file mode 100644 index b162895..0000000 --- a/www/app/main.js +++ /dev/null @@ -1,26 +0,0 @@ -// -// main entry point for app execution -// -// This is determined by the 'entry' option in webpack.config.js -// - -import React from 'react' -import ReactDOM from 'react-dom' - -import PanelSwitcher from 'components/panel_switcher' -import App from 'app' - -class Main extends React.Component { - render() { - return React.createElement(PanelSwitcher) - } - - componentDidMount() { - App.start() - } -} - -ReactDOM.render( - React.createElement(Main), - document.getElementById('app') -) diff --git a/www/app/models/account.js b/www/app/models/account.js deleted file mode 100644 index 52fea93..0000000 --- a/www/app/models/account.js +++ /dev/null @@ -1,143 +0,0 @@ -// -// An account is an abstraction of a user and a provider. -// The user part is optional, so an Account might just represent a provider. -// - -import bitmask from 'lib/bitmask' - -export default class Account { - - constructor(address, props={}) { - this.address = address - this._authenticated = props.authenticated - } - - // - // currently, bitmask.js uses address for id, so we return address here too. - // also, we don't know uuid until after authentication. - // - // TODO: change to uuid when possible. - // - get id() { - return this._address - } - - get domain() { - return this._address.split('@')[1] - } - - get address() { - return this._address - } - - set address(address) { - if (!address.match('@')) { - this._address = '@' + address - } else { - this._address = address - } - } - - get userpart() { - return this._address.split('@')[0] - } - - get authenticated() { - return this._authenticated - } - - get hasEmail() { - return true - } - - // - // returns a promise, fulfill is passed account object - // - login(password) { - return bitmask.bonafide.user.auth(this.address, password).then( - response => { - if (response.uuid) { - this._uuid = response.uuid - this._authenticated = true - } - return this - } - ) - } - - // - // returns a promise, fulfill is passed account object - // - logout() { - return bitmask.bonafide.user.logout(this.id).then( - response => { - this._authenticated = false - this._address = '@' + this.domain - return this - } - ) - } - - // - // returns the matching account in the list of accounts, or adds it - // if it is not already present. - // - static find(address) { - // search by full address - let account = Account.list.find(i => { - return i.address == address - }) - // failing that, search by domain - if (!account) { - let domain = '@' + address.split('@')[1] - account = Account.list.find(i => { - return i.address == domain - }) - if (account) { - account.address = address - } - } - // failing that, create new account - if (!account) { - account = new Account(address) - Account.list.push(account) - } - return account - } - - // - // returns a promise, fullfill is passed account object - // - static active() { - return bitmask.bonafide.user.active().then( - response => { - if (response.user == '') { - return null - } else { - return new Account(response.user, {authenticated: true}) - } - } - ) - } - - static add(account) { - if (!Account.list.find(i => {return i.id == account.id})) { - Account.list.push(account) - } - } - - static remove(account) { - Account.list = Account.list.filter(i => { - return i.id != account.id - }) - } - // return Account.list - // return new Promise(function(resolve, reject) { - // window.setTimeout(function() { - // resolve(['@blah', '@lala']) - // }, 1000) - // }) - // } -} - -Account.list = [] diff --git a/www/app/models/dummy_account.js b/www/app/models/dummy_account.js deleted file mode 100644 index 99fb662..0000000 --- a/www/app/models/dummy_account.js +++ /dev/null @@ -1,33 +0,0 @@ -// -// A proxy of an account, but with a different ID. For testing. -// - -import bitmask from 'lib/bitmask' - -export default class DummyAccount { - - constructor(account) { - this.account = account - } - - get id() { - return 'dummy--' + this.account.address - } - - get domain() {return this.account.domain} - get address() {return this.account.address} - get userpart() {return this.account.userpart} - get authenticated() {return this.account.authenticated} - get hasEmail() {return this.account.hasEmail} - login(password) {return this.account.login(password)} - - logout() { - return bitmask.bonafide.user.logout(this.address).then( - response => { - this._authenticated = false - this._address = '@' + this.domain - return this - } - ) - } -} -- cgit v1.2.3