Browse Source

fixed all modals

master
Julian Steinwachs 9 years ago
parent
commit
beca543c04
  1. 147
      build/app-bundle.js
  2. 2
      jsx/common/Post.js
  3. 40
      jsx/common/ReplyModalButton.js
  4. 27
      jsx/common/RetwistModalButton.js
  5. 10
      jsx/home/NewPostModalButton.js
  6. 26
      jsx/other/ImportAccountModalButton.js
  7. 23
      jsx/profile/EditAvatarModalButton.js
  8. 23
      jsx/profile/EditProfileModalButton.js

147
build/app-bundle.js

@ -600,7 +600,7 @@ module.exports = Post = React.createClass({displayName: "Post",
fullname: "", fullname: "",
timeAgo: "", timeAgo: "",
retwistingUsername: this.props.post.username, retwistingUsername: this.props.post.username,
retwistingUserFullname: "", retwistingUserFullname: this.props.post.username,
retwistingUserAvatar: "img/genericPerson.png", retwistingUserAvatar: "img/genericPerson.png",
}; };
}, },
@ -869,7 +869,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
tagName: "div", tagName: "div",
html: this.state.html, html: this.state.html,
placeholder: this.state.placeholder, placeholder: this.state.placeholder,
placeholderText: "Compose Your Twist", placeholderText: "write",
onKeyPress: this.onKeyPress, onKeyPress: this.onKeyPress,
preventStyling: true, preventStyling: true,
noLinebreaks: true, noLinebreaks: true,
@ -890,12 +890,12 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
"Twist" "Twist"
) )
) )
),
React.createElement("div", null,
"Show autocomplete? ", this.state.queryMention ? 'Yes ' + this.state.queryMention : 'No'
) )
) )
); );
/*<div>
Show autocomplete? {this.state.queryMention ? 'Yes ' + this.state.queryMention : 'No'}
</div>*/
}, },
handleSubmit: function(){ handleSubmit: function(){
@ -925,7 +925,7 @@ module.exports = PostComposer = React.createClass({displayName: "PostComposer",
var parsedContent = PostContentHelper.parseContent(copy); var parsedContent = PostContentHelper.parseContent(copy);
console.log(copy,parsedContent); //console.log(copy,parsedContent);
var output = ""; var output = "";
@ -1397,7 +1397,6 @@ module.exports = ProfileMixin = {
},{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3}],13:[function(require,module,exports){ },{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3}],13:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -1411,7 +1410,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js"); var PostContent = require("../common/PostContent.js");
module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalButton", module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalButton",
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false isModalOpen: false
@ -1422,10 +1420,7 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
isModalOpen: !this.state.isModalOpen isModalOpen: !this.state.isModalOpen
}); });
}, },
handleReply: function (e) { handleReply: function (msg) {
e.preventDefault();
//console.log(e)
var msg = JSON.parse(JSON.stringify(e.target[0].value));
if (!msg) { if (!msg) {
console.log("empty post was passed as new post") console.log("empty post was passed as new post")
return; return;
@ -1443,9 +1438,6 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
}); });
e.target[0].value = "";
this.handleToggle(); this.handleToggle();
//React.findDOMNode(this.refs.msg).value = ''; //React.findDOMNode(this.refs.msg).value = '';
@ -1453,36 +1445,25 @@ module.exports = ReplyModalButton = React.createClass({displayName: "ReplyModalB
}, },
render: function() { render: function() {
return ( return (
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"}, React.createElement(Glyphicon, {glyph: "arrow-left"})) React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"},
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title:
React.createElement(Glyphicon, {glyph: "arrow-left"}), React.createElement(Glyphicon, {glyph: "arrow-left"}),
onRequestHide: this.handleToggle}, React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement("div", {className: "modal-body"}, React.createElement(Modal.Header, null,
React.createElement("form", {onSubmit: this.handleReply}, React.createElement(Glyphicon, {glyph: "arrow-left"})
React.createElement("strong", null, this.props.replyUserFullname), " ", ),
React.createElement(Modal.Body, null,
React.createElement("strong", null, this.props.replyUserFullname),
React.createElement(PostContent, {content: this.props.originalMsg}), React.createElement(PostContent, {content: this.props.originalMsg}),
React.createElement(Input, {type: "textarea", label: "", placeholder: "textarea"}), React.createElement(PostComposer, {onSubmit: this.handleReply})
React.createElement(Input, {type: "submit", value: "Reply", "data-dismiss": "modal"})
) )
) )
) )
); );
} }
}); });
},{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],14:[function(require,module,exports){ },{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],14:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -1496,7 +1477,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js"); var PostContent = require("../common/PostContent.js");
module.exports = RetwistModalButton = React.createClass({displayName: "RetwistModalButton", module.exports = RetwistModalButton = React.createClass({displayName: "RetwistModalButton",
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false isModalOpen: false
@ -1529,29 +1509,22 @@ module.exports = RetwistModalButton = React.createClass({displayName: "RetwistMo
}, },
render: function() { render: function() {
return ( return (
React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"}, React.createElement(Glyphicon, {glyph: "retweet"})) React.createElement("a", {onClick: this.handleToggle, className: "link-button-gray"},
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title:
React.createElement(Glyphicon, {glyph: "retweet"}), React.createElement(Glyphicon, {glyph: "retweet"}),
onRequestHide: this.handleToggle}, React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement("div", {className: "modal-body"}, React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "retweet"})
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleRetwist}, React.createElement("form", {onSubmit: this.handleRetwist},
React.createElement("strong", null, this.props.retwistUserFullname), " ", React.createElement("strong", null, this.props.retwistUserFullname, " "),
React.createElement(PostContent, {content: this.props.originalMsg}), React.createElement(PostContent, {content: this.props.originalMsg}),
React.createElement(Input, {type: "submit", value: "Retwist", "data-dismiss": "modal"}) React.createElement(Input, {type: "submit", value: "Retwist", "data-dismiss": "modal"})
) )
) )
) )
)
); );
} }
}); });
},{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],15:[function(require,module,exports){ },{"../common/PostContent.js":8,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],15:[function(require,module,exports){
@ -1871,6 +1844,7 @@ var ReactBootstrap = require('react-bootstrap')
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
, Modal = ReactBootstrap.Modal , Modal = ReactBootstrap.Modal
, Input = ReactBootstrap.Input , Input = ReactBootstrap.Input
, ListGroupItem = ReactBootstrap.ListGroupItem
var React = require('react'); var React = require('react');
@ -1915,8 +1889,11 @@ module.exports = NewPostModalButton = React.createClass({displayName: "NewPostMo
return ( return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"}, React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}), React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {title: React.createElement(Glyphicon, {glyph: "pencil"}), show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle}, React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement("div", {className: "modal-body"}, React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"})
),
React.createElement(Modal.Body, null,
React.createElement(PostComposer, {onSubmit: this.handleNewPost}) React.createElement(PostComposer, {onSubmit: this.handleNewPost})
) )
) )
@ -2215,7 +2192,6 @@ module.exports = Hashtag = React.createClass({displayName: "Hashtag",
},{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3,"../common/Postboard.js":10,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"../common/StreamMixin.js":17,"react":500,"react-bootstrap":107}],24:[function(require,module,exports){ },{"../common/AppSettingsMixin.js":2,"../common/EventListenerMixin.js":3,"../common/Postboard.js":10,"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"../common/StreamMixin.js":17,"react":500,"react-bootstrap":107}],24:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -2228,7 +2204,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = ImportAccountModalButton = React.createClass({displayName: "ImportAccountModalButton", module.exports = ImportAccountModalButton = React.createClass({displayName: "ImportAccountModalButton",
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -2270,20 +2245,14 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp
}, },
render: function() { render: function() {
return (
React.createElement(Button, {onClick: this.handleToggle}, "Import Account")
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return ( return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle}, React.createElement(Button, {onClick: this.handleToggle},
React.createElement("div", {className: "modal-body"}, "Import Account",
React.createElement(Modal, {show: this.state.isModalOpen, bsStyle: "primary", onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "import"})
),
React.createElement(Modal.Body, null,
React.createElement("form", {onSubmit: this.handleImportAccount}, React.createElement("form", {onSubmit: this.handleImportAccount},
React.createElement(Input, { React.createElement(Input, {
type: "text", type: "text",
@ -2301,8 +2270,8 @@ module.exports = ImportAccountModalButton = React.createClass({displayName: "Imp
) )
) )
) )
)
); );
} }
}); });
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],25:[function(require,module,exports){ },{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],25:[function(require,module,exports){
@ -2382,7 +2351,6 @@ module.exports = Settings = React.createClass({displayName: "Settings",
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -2395,7 +2363,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAvatarModalButton", module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAvatarModalButton",
mixins: [OverlayMixin,SafeStateChangeMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -2494,19 +2461,12 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv
return ( return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"}, React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"}) React.createElement(Glyphicon, {glyph: "pencil"})
) ),
); React.createElement(Modal.Body, null,
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement("form", {onSubmit: this.handleAvatarEdit}, React.createElement("form", {onSubmit: this.handleAvatarEdit},
React.createElement("img", {src: this.state.avatar}), React.createElement("img", {src: this.state.avatar}),
React.createElement(Input, { React.createElement(Input, {
@ -2518,14 +2478,13 @@ module.exports = EditAvatarModalButton = React.createClass({displayName: "EditAv
) )
) )
) )
)
); );
} }
}); });
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],27:[function(require,module,exports){ },{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],27:[function(require,module,exports){
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -2538,7 +2497,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditProfileModalButton = React.createClass({displayName: "EditProfileModalButton", module.exports = EditProfileModalButton = React.createClass({displayName: "EditProfileModalButton",
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -2601,19 +2559,12 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP
return ( return (
React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"}, React.createElement(Button, {onClick: this.handleToggle, className: "link-button-gray pull-right fullytight_all", bsStyle: "link"},
React.createElement(Glyphicon, {glyph: "pencil"}),
React.createElement(Modal, {bsStyle: "primary", show: this.state.isModalOpen, onHide: this.handleToggle},
React.createElement(Modal.Header, null,
React.createElement(Glyphicon, {glyph: "pencil"}) React.createElement(Glyphicon, {glyph: "pencil"})
) ),
); React.createElement(Modal.Body, null,
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return React.createElement("span", null);
}
return (
React.createElement(Modal, {bsStyle: "primary", title: React.createElement(Glyphicon, {glyph: "pencil"}), onRequestHide: this.handleToggle},
React.createElement("div", {className: "modal-body"},
React.createElement("form", {onSubmit: this.handleProfileEdit}, React.createElement("form", {onSubmit: this.handleProfileEdit},
React.createElement(Input, { React.createElement(Input, {
type: "text", type: "text",
@ -2643,8 +2594,8 @@ module.exports = EditProfileModalButton = React.createClass({displayName: "EditP
) )
) )
) )
)
); );
} }
}); });
},{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],28:[function(require,module,exports){ },{"../common/SafeStateChangeMixin.js":15,"../common/SetIntervalMixin.js":16,"react":500,"react-bootstrap":107}],28:[function(require,module,exports){

2
jsx/common/Post.js

@ -58,7 +58,7 @@ module.exports = Post = React.createClass({
fullname: "", fullname: "",
timeAgo: "", timeAgo: "",
retwistingUsername: this.props.post.username, retwistingUsername: this.props.post.username,
retwistingUserFullname: "", retwistingUserFullname: this.props.post.username,
retwistingUserAvatar: "img/genericPerson.png", retwistingUserAvatar: "img/genericPerson.png",
}; };
}, },

40
jsx/common/ReplyModalButton.js

@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js"); var PostContent = require("../common/PostContent.js");
module.exports = ReplyModalButton = React.createClass({ module.exports = ReplyModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false isModalOpen: false
@ -25,10 +23,7 @@ module.exports = ReplyModalButton = React.createClass({
isModalOpen: !this.state.isModalOpen isModalOpen: !this.state.isModalOpen
}); });
}, },
handleReply: function (e) { handleReply: function (msg) {
e.preventDefault();
//console.log(e)
var msg = JSON.parse(JSON.stringify(e.target[0].value));
if (!msg) { if (!msg) {
console.log("empty post was passed as new post") console.log("empty post was passed as new post")
return; return;
@ -46,9 +41,6 @@ module.exports = ReplyModalButton = React.createClass({
}); });
e.target[0].value = "";
this.handleToggle(); this.handleToggle();
//React.findDOMNode(this.refs.msg).value = ''; //React.findDOMNode(this.refs.msg).value = '';
@ -56,29 +48,19 @@ module.exports = ReplyModalButton = React.createClass({
}, },
render: function() { render: function() {
return ( return (
<a onClick={this.handleToggle} className="link-button-gray"><Glyphicon glyph='arrow-left' /></a> <a onClick={this.handleToggle} className="link-button-gray">
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={
<Glyphicon glyph='arrow-left' /> <Glyphicon glyph='arrow-left' />
} onRequestHide={this.handleToggle}> <Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
<div className='modal-body'> <Modal.Header>
<form onSubmit={this.handleReply}> <Glyphicon glyph='arrow-left'/>
<strong>{this.props.replyUserFullname}</strong>&nbsp; </Modal.Header>
<Modal.Body>
<strong>{this.props.replyUserFullname}</strong>
<PostContent content={this.props.originalMsg}/> <PostContent content={this.props.originalMsg}/>
<Input type='textarea' label='' placeholder='textarea'/> <PostComposer onSubmit={this.handleReply} />
<Input type='submit' value='Reply' data-dismiss="modal" /> </Modal.Body>
</form>
</div>
</Modal> </Modal>
</a>
); );
} }
}); });

27
jsx/common/RetwistModalButton.js

@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var PostContent = require("../common/PostContent.js"); var PostContent = require("../common/PostContent.js");
module.exports = RetwistModalButton = React.createClass({ module.exports = RetwistModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false isModalOpen: false
@ -47,28 +45,21 @@ module.exports = RetwistModalButton = React.createClass({
}, },
render: function() { render: function() {
return ( return (
<a onClick={this.handleToggle} className="link-button-gray"><Glyphicon glyph='retweet' /></a> <a onClick={this.handleToggle} className="link-button-gray">
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={
<Glyphicon glyph='retweet' /> <Glyphicon glyph='retweet' />
} onRequestHide={this.handleToggle}> <Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<div className='modal-body'> <Modal.Header>
<Glyphicon glyph='retweet'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleRetwist}> <form onSubmit={this.handleRetwist}>
<strong>{this.props.retwistUserFullname}</strong>&nbsp; <strong>{this.props.retwistUserFullname} </strong>
<PostContent content={this.props.originalMsg}/> <PostContent content={this.props.originalMsg}/>
<Input type='submit' value='Retwist' data-dismiss="modal" /> <Input type='submit' value='Retwist' data-dismiss="modal" />
</form> </form>
</div> </Modal.Body>
</Modal> </Modal>
</a>
); );
} }
}); });

10
jsx/home/NewPostModalButton.js

@ -5,6 +5,7 @@ var ReactBootstrap = require('react-bootstrap')
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
, Modal = ReactBootstrap.Modal , Modal = ReactBootstrap.Modal
, Input = ReactBootstrap.Input , Input = ReactBootstrap.Input
, ListGroupItem = ReactBootstrap.ListGroupItem
var React = require('react'); var React = require('react');
@ -49,10 +50,13 @@ module.exports = NewPostModalButton = React.createClass({
return ( return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link"> <Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' /> <Glyphicon glyph='pencil' />
<Modal title={<Glyphicon glyph='pencil'/>} show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}> <Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<div className='modal-body'> <Modal.Header>
<Glyphicon glyph='pencil'/>
</Modal.Header>
<Modal.Body>
<PostComposer onSubmit={this.handleNewPost} /> <PostComposer onSubmit={this.handleNewPost} />
</div> </Modal.Body>
</Modal> </Modal>
</Button> </Button>
); );

26
jsx/other/ImportAccountModalButton.js

@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = ImportAccountModalButton = React.createClass({ module.exports = ImportAccountModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -55,20 +53,14 @@ module.exports = ImportAccountModalButton = React.createClass({
}, },
render: function() { render: function() {
return (
<Button onClick={this.handleToggle}>Import Account</Button>
);
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
return ( return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}> <Button onClick={this.handleToggle}>
<div className='modal-body'> Import Account
<Modal show={this.state.isModalOpen} bsStyle='primary' onHide={this.handleToggle}>
<Modal.Header>
<Glyphicon glyph='import'/>
</Modal.Header>
<Modal.Body>
<form onSubmit={this.handleImportAccount}> <form onSubmit={this.handleImportAccount}>
<Input <Input
type='text' type='text'
@ -84,9 +76,9 @@ module.exports = ImportAccountModalButton = React.createClass({
/> />
<Input type='submit' value='Import Account' data-dismiss="modal" /> <Input type='submit' value='Import Account' data-dismiss="modal" />
</form> </form>
</div> </Modal.Body>
</Modal> </Modal>
</Button>
); );
} }
}); });

23
jsx/profile/EditAvatarModalButton.js

@ -3,7 +3,6 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -16,7 +15,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditAvatarModalButton = React.createClass({ module.exports = EditAvatarModalButton = React.createClass({
mixins: [OverlayMixin,SafeStateChangeMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -116,18 +114,11 @@ module.exports = EditAvatarModalButton = React.createClass({
return ( return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link"> <Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' /> <Glyphicon glyph='pencil' />
</Button> <Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
); <Modal.Header>
}, <Glyphicon glyph='pencil'/>
renderOverlay: function() { </Modal.Header>
<Modal.Body>
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<form onSubmit={this.handleAvatarEdit}> <form onSubmit={this.handleAvatarEdit}>
<img src={this.state.avatar}/> <img src={this.state.avatar}/>
<Input <Input
@ -137,9 +128,9 @@ module.exports = EditAvatarModalButton = React.createClass({
/> />
<Input type='submit' value='Update Avatar' data-dismiss="modal" /> <Input type='submit' value='Update Avatar' data-dismiss="modal" />
</form> </form>
</div> </Modal.Body>
</Modal> </Modal>
</Button>
); );
} }
}); });

23
jsx/profile/EditProfileModalButton.js

@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -13,7 +12,6 @@ var SafeStateChangeMixin = require('../common/SafeStateChangeMixin.js');
var SetIntervalMixin = require("../common/SetIntervalMixin.js"); var SetIntervalMixin = require("../common/SetIntervalMixin.js");
module.exports = EditProfileModalButton = React.createClass({ module.exports = EditProfileModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false, isModalOpen: false,
@ -77,18 +75,11 @@ module.exports = EditProfileModalButton = React.createClass({
return ( return (
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link"> <Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' /> <Glyphicon glyph='pencil' />
</Button> <Modal bsStyle='primary' show={this.state.isModalOpen} onHide={this.handleToggle}>
); <Modal.Header>
}, <Glyphicon glyph='pencil'/>
renderOverlay: function() { </Modal.Header>
<Modal.Body>
if (!this.state.isModalOpen) {
return <span/>;
}
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<form onSubmit={this.handleProfileEdit}> <form onSubmit={this.handleProfileEdit}>
<Input <Input
type='text' type='text'
@ -116,9 +107,9 @@ module.exports = EditProfileModalButton = React.createClass({
/> />
<Input type='submit' value='Update Profile' data-dismiss="modal" /> <Input type='submit' value='Update Profile' data-dismiss="modal" />
</form> </form>
</div> </Modal.Body>
</Modal> </Modal>
</Button>
); );
} }
}); });
Loading…
Cancel
Save