|
|
@ -107,12 +107,14 @@ App = React.createClass({displayName: "App", |
|
|
|
|
|
|
|
|
|
|
|
checkAccounts: function() { |
|
|
|
checkAccounts: function() { |
|
|
|
|
|
|
|
|
|
|
|
this.state.accounts.map(function(acc){ |
|
|
|
var thisComponent = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thisComponent.state.accounts.map(function(acc){ |
|
|
|
|
|
|
|
|
|
|
|
Twister.getAccount(newaccoutname).verifyKey(function(key){ |
|
|
|
Twister.getAccount(acc.name).verifyKey(function(key){ |
|
|
|
thisComponent.setState(function(oldstate,props){ |
|
|
|
thisComponent.setState(function(oldstate,props){ |
|
|
|
|
|
|
|
|
|
|
|
oldstate.accounts[acc].status = key.getStatus(); |
|
|
|
oldstate.accounts[acc.name].status = key.getStatus(); |
|
|
|
|
|
|
|
|
|
|
|
return oldstate; |
|
|
|
return oldstate; |
|
|
|
|
|
|
|
|
|
|
@ -139,9 +141,11 @@ App = React.createClass({displayName: "App", |
|
|
|
|
|
|
|
|
|
|
|
onnewaccountbyuser: function(event) { |
|
|
|
onnewaccountbyuser: function(event) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("catched onnewaccountbyuser event !!!!! ",event,this.state) |
|
|
|
|
|
|
|
|
|
|
|
this.saveCache(); |
|
|
|
this.saveCache(); |
|
|
|
|
|
|
|
|
|
|
|
if(!this.activeAccount){ |
|
|
|
if(!this.state.activeAccount){ |
|
|
|
|
|
|
|
|
|
|
|
this.switchAccount(event.detail.getUsername()); |
|
|
|
this.switchAccount(event.detail.getUsername()); |
|
|
|
|
|
|
|
|
|
|
@ -163,8 +167,23 @@ App = React.createClass({displayName: "App", |
|
|
|
|
|
|
|
|
|
|
|
//console.log(firstroute);
|
|
|
|
//console.log(firstroute);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var guestMode = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.state.accounts.filter(function(acc){ |
|
|
|
|
|
|
|
return acc.status=="confirmed"; |
|
|
|
|
|
|
|
}).length){ |
|
|
|
|
|
|
|
guestMode = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(guestMode){ |
|
|
|
|
|
|
|
var accountSelector = ( |
|
|
|
|
|
|
|
React.createElement(Button, {href: "#/accounts", disabled: true}, "guest") |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}else{ |
|
|
|
var userbuttons = []; |
|
|
|
var userbuttons = []; |
|
|
|
for (var i in this.state.accounts) { |
|
|
|
for (var i in this.state.accounts.filter(function(acc){ |
|
|
|
|
|
|
|
return acc.status=="confirmed"; |
|
|
|
|
|
|
|
})) { |
|
|
|
userbuttons.push( |
|
|
|
userbuttons.push( |
|
|
|
React.createElement(MenuItem, { |
|
|
|
React.createElement(MenuItem, { |
|
|
|
key: this.state.accounts[i].name, |
|
|
|
key: this.state.accounts[i].name, |
|
|
@ -174,6 +193,15 @@ App = React.createClass({displayName: "App", |
|
|
|
}, this.state.accounts[i].name) |
|
|
|
}, this.state.accounts[i].name) |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var accountSelector = ( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
React.createElement(DropdownButton, {title: this.state.activeAccount}, |
|
|
|
|
|
|
|
userbuttons |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
React.createElement(Grid, null, |
|
|
|
React.createElement(Grid, null, |
|
|
@ -182,20 +210,19 @@ App = React.createClass({displayName: "App", |
|
|
|
React.createElement(ButtonGroup, {justified: true}, |
|
|
|
React.createElement(ButtonGroup, {justified: true}, |
|
|
|
React.createElement(Button, { |
|
|
|
React.createElement(Button, { |
|
|
|
href: "#", |
|
|
|
href: "#", |
|
|
|
bsStyle: firstroute=="home" ? 'primary' : 'default' |
|
|
|
bsStyle: firstroute=="home" ? 'primary' : 'default', |
|
|
|
|
|
|
|
disabled: guestMode |
|
|
|
}, React.createElement(Glyphicon, {glyph: "home"})), |
|
|
|
}, React.createElement(Glyphicon, {glyph: "home"})), |
|
|
|
React.createElement(Button, { |
|
|
|
React.createElement(Button, { |
|
|
|
href: "#/profile", |
|
|
|
href: "#/profile", |
|
|
|
bsStyle: firstroute=="profile-active" ? 'primary' : 'default' |
|
|
|
bsStyle: firstroute=="profile-active" ? 'primary' : 'default', |
|
|
|
|
|
|
|
disabled: guestMode |
|
|
|
}, React.createElement(Glyphicon, {glyph: "user"})), |
|
|
|
}, React.createElement(Glyphicon, {glyph: "user"})), |
|
|
|
React.createElement(Button, {href: "#/directmessages"}, React.createElement(Glyphicon, {glyph: "transfer"})), |
|
|
|
React.createElement(Button, {href: "#/directmessages", disabled: true}, React.createElement(Glyphicon, {glyph: "transfer"})), |
|
|
|
React.createElement(DropdownButton, {title: this.state.activeAccount}, |
|
|
|
accountSelector, |
|
|
|
userbuttons |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
React.createElement(DropdownButton, {title: React.createElement(Glyphicon, {glyph: "menu-hamburger"})}, |
|
|
|
React.createElement(DropdownButton, {title: React.createElement(Glyphicon, {glyph: "menu-hamburger"})}, |
|
|
|
React.createElement(MenuItem, { |
|
|
|
React.createElement(MenuItem, { |
|
|
|
onClick: this.clearCache, |
|
|
|
onClick: this.clearCache |
|
|
|
href: "javascript:void(0);" |
|
|
|
|
|
|
|
}, "Clear Cache"), |
|
|
|
}, "Clear Cache"), |
|
|
|
React.createElement(MenuItem, {href: "#/search"}, "Search"), |
|
|
|
React.createElement(MenuItem, {href: "#/search"}, "Search"), |
|
|
|
React.createElement(MenuItem, {href: "#/settings"}, "Settings"), |
|
|
|
React.createElement(MenuItem, {href: "#/settings"}, "Settings"), |
|
|
@ -1034,7 +1061,7 @@ var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup; |
|
|
|
|
|
|
|
|
|
|
|
var Post = require("../common/Post.js"); |
|
|
|
var Post = require("../common/Post.js"); |
|
|
|
|
|
|
|
|
|
|
|
module.exports = Postboard = React.createClass({displayName: "Postboard", |
|
|
|
module.exports = ProfileBoard = React.createClass({displayName: "ProfileBoard", |
|
|
|
render: function() { |
|
|
|
render: function() { |
|
|
|
|
|
|
|
|
|
|
|
var thisComponent = this; |
|
|
|
var thisComponent = this; |
|
|
@ -1748,19 +1775,24 @@ module.exports = Accounts = React.createClass({displayName: "Accounts", |
|
|
|
router: React.PropTypes.func |
|
|
|
router: React.PropTypes.func |
|
|
|
}, |
|
|
|
}, |
|
|
|
render: function() { |
|
|
|
render: function() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var thisComponent = this; |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
React.createElement(ListGroup, null, |
|
|
|
React.createElement(ListGroup, null, |
|
|
|
React.createElement(ListGroupItem, null, "Settings"), |
|
|
|
React.createElement(ListGroupItem, null, "Accounts"), |
|
|
|
React.createElement(ListGroupItem, null, |
|
|
|
React.createElement(ListGroupItem, null, |
|
|
|
React.createElement("ul", null, |
|
|
|
React.createElement(ImportAccountModalButton, null), |
|
|
|
|
|
|
|
React.createElement("hr", null), |
|
|
|
this.props.accounts.map(function(acc,index) { |
|
|
|
this.props.accounts.map(function(acc,index) { |
|
|
|
//console.log(acc,index)
|
|
|
|
//console.log(acc,index)
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
React.createElement("li", null, acc.name, " - ", acc.status) |
|
|
|
React.createElement("div", null, |
|
|
|
|
|
|
|
React.createElement(MiniProfile, {username: acc.name, key: "miniprofile:"+acc.name, pollIntervalProfile: thisComponent.props.pollIntervalProfile}), |
|
|
|
|
|
|
|
React.createElement("p", null, acc.status) |
|
|
|
|
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
}) |
|
|
|
}) |
|
|
|
), |
|
|
|
|
|
|
|
React.createElement(ImportAccountModalButton, null) |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
@ -1816,11 +1848,21 @@ module.exports = Conversation = React.createClass({displayName: "Conversation", |
|
|
|
|
|
|
|
|
|
|
|
var goUpConversation = function (post) { |
|
|
|
var goUpConversation = function (post) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!post) return; |
|
|
|
|
|
|
|
|
|
|
|
if (post.isReply()) { |
|
|
|
if (post.isReply()) { |
|
|
|
|
|
|
|
|
|
|
|
post.doPostRepliedTo(goUpConversation); |
|
|
|
post.doPostRepliedTo(function(otherpost){ |
|
|
|
|
|
|
|
if(otherpost){ |
|
|
|
|
|
|
|
goUpConversation(otherpost); |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
thisComponent.addPost(post); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
thisComponent.setStateSafe({loading: false}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
post.doReplies(doRepliesRecursive); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|