Browse Source

import user key

master
Julian Steinwachs 9 years ago
parent
commit
ce025b1b47
  1. 737
      build/app-bundle.js
  2. 2
      build/twister-lib.js
  3. 1
      index.html
  4. 40
      jsx/App.js
  5. 4
      jsx/common/Post.js
  6. 5
      jsx/home/Home.js
  7. 2
      jsx/other/Settings.js
  8. 2
      jsx/profile/Profile.js

737
build/app-bundle.js

File diff suppressed because it is too large Load Diff

2
build/twister-lib.js

@ -32531,7 +32531,7 @@ Twister.importClientSideAccount = function (name,key,cbfunc) { @@ -32531,7 +32531,7 @@ Twister.importClientSideAccount = function (name,key,cbfunc) {
Twister._wallet[name]._privkey.setKey(key)
Twister._wallet[name]._privkey.verifyKey(function(){
cbfunc(Twister._wallet[name])
if(cbfunc) cbfunc(Twister._wallet[name])
})

1
index.html

@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="css/paper-theme.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<meta name="viewport" content="width=548" />
</head>
<body>

40
jsx/App.js

@ -42,7 +42,11 @@ var AppSettingsMixin = require('./common/AppSettingsMixin.js'); @@ -42,7 +42,11 @@ var AppSettingsMixin = require('./common/AppSettingsMixin.js');
App = React.createClass({
mixins: [AppSettingsMixin,SetIntervalMixin,SafeStateChangeMixin],
mixins: [
AppSettingsMixin,
SetIntervalMixin,
SafeStateChangeMixin,
EventListenerMixin('newaccountbyuser')],
contextTypes: {
router: React.PropTypes.func
@ -86,6 +90,18 @@ App = React.createClass({ @@ -86,6 +90,18 @@ App = React.createClass({
},
onnewaccountbyuser: function(event) {
this.saveCache();
if(!this.activeAccount){
this.switchAccount(event.detail.getUsername());
}
},
getInitialState: function () {
var state={};
@ -212,10 +228,14 @@ if (accounts.length==0) { @@ -212,10 +228,14 @@ if (accounts.length==0) {
pollInterval:60,
pollIntervalProfile: 3600,
ignoredUsers: "nobody",
host: "http://user:pwd@localhost:28332"
host: "http://tschaul.com:8080"
};
console.log(appSettings)
localStorage.setItem("twister-react-settings",JSON.stringify(appSettings));
} else {
var appSettings = JSON.parse(localStorage.getItem("twister-react-settings"));
@ -240,7 +260,9 @@ if (accounts.length==0) { @@ -240,7 +260,9 @@ if (accounts.length==0) {
}
});
Twister.importClientSideAccount("pampalulu","L12kz6tabDN6VmPes1rfEpiznztPF6vgkHp8UZVBgZadxzebHhAp",function(){
initializeApp();
/*Twister.importClientSideAccount("pampalulu","L12kz6tabDN6VmPes1rfEpiznztPF6vgkHp8UZVBgZadxzebHhAp",function(){
var activeAccount = localStorage.getItem("twister-react-activeAccount");
@ -264,7 +286,7 @@ if (accounts.length==0) { @@ -264,7 +286,7 @@ if (accounts.length==0) {
});
});
*/
} else {
var activeAccount = localStorage.getItem("twister-react-activeAccount");
@ -298,3 +320,13 @@ window.onscroll = function(ev) { @@ -298,3 +320,13 @@ window.onscroll = function(ev) {
window.dispatchEvent(event);
}
};
setInterval(function(){
if($("#content").height()<window.innerHeight){
var event = new Event('scrolledtobottom');
//alert("scrolled to bottom")
window.dispatchEvent(event);
}
},1000);

4
jsx/common/Post.js

@ -165,14 +165,14 @@ module.exports = Post = React.createClass({ @@ -165,14 +165,14 @@ module.exports = Post = React.createClass({
</a>
</Col>
<Col xs={9} md={9}>
<strong>{this.state.fullname}</strong>&nbsp;
<strong>{this.state.fullname}</strong>
<PostContent content={post.getContent()}/>
</Col>
<Col xs={1} md={1} className="fullytight text-align-right">{this.state.timeAgo}</Col>
</Row>
<Row className="nomargin">
<Col xs={6} md={6} className="fullytight">
{retwist && <small><em> &nbsp;retwisted by {this.state.retwistingUserFullname}</em></small>
{retwist && <small><em>retwisted by {this.state.retwistingUserFullname}</em></small>
}
</Col>
<Col xs={4} md={4} className="fullytight text-align-right">

5
jsx/home/Home.js

@ -151,7 +151,10 @@ module.exports = Home = React.createClass({ @@ -151,7 +151,10 @@ module.exports = Home = React.createClass({
this.setInterval(this.updatePosts, this.state.appSettings.pollInterval*1000);
} else {console.log("active account is null")}
} else {
window.location.hash="#/settings";
console.log("active account is null")
}
},
onscrolledtobottom: function () {

2
jsx/other/Settings.js

@ -4,6 +4,7 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js'); @@ -4,6 +4,7 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var EventListenerMixin = require('../common/EventListenerMixin.js');
var AppSettingsMixin = require('../common/AppSettingsMixin.js');
var ImportAccountModalButton = require('../other/ImportAccountModalButton.js');
var ReactBootstrap = require('react-bootstrap')
, NavItem = ReactBootstrap.NavItem
@ -65,6 +66,7 @@ module.exports = Home = React.createClass({ @@ -65,6 +66,7 @@ module.exports = Home = React.createClass({
wrapperClassName='col-xs-8' className="settings-host"/>
<Input type='submit' value='Save' wrapperClassName='col-xs-offset-10 col-xs-2'/>
</form>
<ImportAccountModalButton/>
</ListGroupItem>
</ListGroup>
);

2
jsx/profile/Profile.js

@ -68,7 +68,7 @@ module.exports = Post = React.createClass({ @@ -68,7 +68,7 @@ module.exports = Post = React.createClass({
<FollowButton activeAccount={this.props.activeAccount} username={this.state.username}/>
</Col>
<Col xs={8} md={8}>
<h4 className="nomargin-top">{this.state.fullname}<small> &nbsp; {'@'+this.state.username}</small></h4>
<h4 className="nomargin-top">{this.state.fullname}<small> {'@'+this.state.username}</small></h4>
<p className="text-center">{this.state.location}</p>
<p className="text-center">{this.state.bio}</p>
<p className="text-center"><a href={this.state.url}>{this.state.url}</a></p>

Loading…
Cancel
Save