From d0e905e5ef56d5ead4cbdfdb3fe8281964a8ba03 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Mon, 20 Jun 2016 18:07:11 +0200 Subject: [PATCH] style changes --- lib/boards-api.js | 44 ++++++++++---------- webapp/app.jsx | 54 ++++++++++++------------- webapp/components/clock.jsx | 4 +- webapp/components/comment.jsx | 32 +++++++-------- webapp/components/navbar.jsx | 26 ++++++------ webapp/components/post.jsx | 24 +++++------ webapp/components/postlist.jsx | 10 ++--- webapp/components/status-components.jsx | 26 ++++++------ webapp/components/userID.jsx | 10 ++--- webapp/pages/backup.jsx | 22 +++++----- webapp/pages/board-editor.jsx | 36 ++++++++--------- webapp/pages/board.jsx | 16 ++++---- webapp/pages/commentpage.jsx | 10 ++--- webapp/pages/getipfs.jsx | 26 ++++++------ webapp/pages/post-editor.jsx | 36 ++++++++--------- webapp/pages/postpage.jsx | 6 +-- webapp/pages/profile-editor.jsx | 32 +++++++-------- webapp/pages/profile.jsx | 16 ++++---- webapp/pages/settings.jsx | 36 ++++++++--------- webapp/pages/update.jsx | 12 +++--- webapp/pages/users.jsx | 2 +- 21 files changed, 240 insertions(+), 240 deletions(-) diff --git a/lib/boards-api.js b/lib/boards-api.js index a7f13e0..e019871 100644 --- a/lib/boards-api.js +++ b/lib/boards-api.js @@ -103,7 +103,7 @@ BoardsAPI.prototype.restoreProfileFromIPFS = function (hash, done) { BoardsAPI.prototype.createProfile = function (profile, done) { console.log('Generating profile:', profile) try { - var profile_str = JSON.stringify(profile) + var profileStr = JSON.stringify(profile) } catch (e) { console.log('Error, invalid profile:', e) return done(e) @@ -124,12 +124,12 @@ BoardsAPI.prototype.createProfile = function (profile, done) { cb => { // Add profile version file var path = '/ipfs-boards-profile/ipfs-boards-version.txt' - var version_hash = '/ipfs/' + this.version_hash - this.ipfs.files.cp([version_hash, path], cb) + var versionHash = '/ipfs/' + this.versionHash + this.ipfs.files.cp([versionHash, path], cb) }, (e, cb) => { // Serialize profile and add to IPFS - this.ipfs.add(new Buffer(profile_str), cb) + this.ipfs.add(new Buffer(profileStr), cb) }, (res, cb) => { // Move profile into mfs @@ -139,9 +139,9 @@ BoardsAPI.prototype.createProfile = function (profile, done) { }, (e, cb) => this.ipfs.files.stat('/', cb), (res, cb) => { - var profile_hash = res.Hash + var profileHash = res.Hash console.log('Publishing profile...') - this.ipfs.name.publish(profile_hash, cb) + this.ipfs.name.publish(profileHash, cb) } ], done) } @@ -149,7 +149,7 @@ BoardsAPI.prototype.createProfile = function (profile, done) { BoardsAPI.prototype.createBoard = function (board, done) { console.log('Generating board:', board) try { - var settings_str = JSON.stringify(board) + var settingsStr = JSON.stringify(board) } catch (e) { console.log('Error, invalid Board Settings:', e) return done(e) @@ -164,7 +164,7 @@ BoardsAPI.prototype.createBoard = function (board, done) { }, (cb) => { // Serialize Board Settings and add to IPFS - this.ipfs.add(new Buffer(settings_str), cb) + this.ipfs.add(new Buffer(settingsStr), cb) }, (res, cb) => { // Move Board into mfs @@ -174,9 +174,9 @@ BoardsAPI.prototype.createBoard = function (board, done) { }, (e, cb) => this.ipfs.files.stat('/', cb), (res, cb) => { - var profile_hash = res.Hash + var profileHash = res.Hash console.log('Publishing profile...') - this.ipfs.name.publish(profile_hash, cb) + this.ipfs.name.publish(profileHash, cb) } ], done) } @@ -185,7 +185,7 @@ BoardsAPI.prototype.createPost = function (post, board, done) { try { post.date = parseInt((new Date()).getTime() / 1000, 10) post.op = this.id - var post_str = JSON.stringify(post) + var postStr = JSON.stringify(post) } catch (e) { console.log('Error, invalid Post:', e) return done(e) @@ -203,7 +203,7 @@ BoardsAPI.prototype.createPost = function (post, board, done) { }, (cb) => { // Serialize post and add to IPFS - this.ipfs.add(new Buffer(post_str), cb) + this.ipfs.add(new Buffer(postStr), cb) }, (res, cb) => { // Move post into mfs @@ -214,9 +214,9 @@ BoardsAPI.prototype.createPost = function (post, board, done) { }, (e, cb) => this.ipfs.files.stat('/', cb), (res, cb) => { - var profile_hash = res.Hash + var profileHash = res.Hash console.log('Publishing profile...') - this.ipfs.name.publish(profile_hash, err => { + this.ipfs.name.publish(profileHash, err => { done(err, posthash) }) } @@ -227,7 +227,7 @@ BoardsAPI.prototype.createComment = function (comment, parent, done) { comment.date = parseInt((new Date()).getTime() / 1000, 10) comment.op = this.id comment.parent = parent - var comment_str = JSON.stringify(comment) + var commentStr = JSON.stringify(comment) } catch (e) { console.log('Error, invalid Post:', e) return done(e) @@ -245,7 +245,7 @@ BoardsAPI.prototype.createComment = function (comment, parent, done) { }, (cb) => { // Serialize comment and add to IPFS - this.ipfs.add(new Buffer(comment_str), cb) + this.ipfs.add(new Buffer(commentStr), cb) }, (res, cb) => { // Move post into mfs @@ -256,9 +256,9 @@ BoardsAPI.prototype.createComment = function (comment, parent, done) { }, (e, cb) => this.ipfs.files.stat('/', cb), (res, cb) => { - var profile_hash = res.Hash + var profileHash = res.Hash console.log('Publishing profile...') - this.ipfs.name.publish(profile_hash, err => { + this.ipfs.name.publish(profileHash, err => { done(err, commenthash) }) } @@ -461,7 +461,7 @@ BoardsAPI.prototype.searchUsers = function () { }) // Look for who has the correct version file, they probably have a profile /* - this.ipfs.dht.findprovs(this.version_hash, (err,res) => { + this.ipfs.dht.findprovs(this.versionHash, (err,res) => { if(err){ console.log('DHT FINDPROVS err',err) } else if(res.readable){ @@ -860,9 +860,9 @@ BoardsAPI.prototype.init = function (done) { this.ee.emit('init', err2, this.limited) if (done && done.apply) done(err2) } else { - if (r && r.Hash) this.version_hash = r.Hash - if (r && r[0] && r[0].Hash) this.version_hash = r[0].Hash - console.log('Version hash is', this.version_hash) + if (r && r.Hash) this.versionHash = r.Hash + if (r && r[0] && r[0].Hash) this.versionHash = r[0].Hash + console.log('Version hash is', this.versionHash) // DONE! this.ee.emit('init', undefined) this.isInit = true diff --git a/webapp/app.jsx b/webapp/app.jsx index 5debf6e..ac62d41 100644 --- a/webapp/app.jsx +++ b/webapp/app.jsx @@ -41,7 +41,7 @@ require.ensure('react', _ => { var Container = React.createClass({ render () { - return (
{this.props.children}
) + return (
{this.props.children}
) } }) @@ -68,14 +68,14 @@ require.ensure('react', _ => { var Homepage = React.createClass({ render () { - return + return } }) var NotFound = React.createClass({ render () { - return (
-

+ return (
+

Sorry, there's nothing here!

) } @@ -96,44 +96,44 @@ require.ensure('react', _ => { var IndexRoute = this.state.IndexRoute var Route = this.state.Route return - + - + - + - + - + - + - - - + + + - + - - - - - - - - - + + + + + + + + + } else { - return
-
- -

Downloading Components

+ return
+
+ +

Downloading Components

} diff --git a/webapp/components/clock.jsx b/webapp/components/clock.jsx index 6dfa93c..1f902e7 100644 --- a/webapp/components/clock.jsx +++ b/webapp/components/clock.jsx @@ -28,10 +28,10 @@ module.exports = React.createClass({ if (this.state.moment) { return this.state.text } else { - return + return } }, render: function () { - return
{this.getDate()}
+ return
{this.getDate()}
} }) diff --git a/webapp/components/comment.jsx b/webapp/components/comment.jsx index 675337c..ce55ed8 100644 --- a/webapp/components/comment.jsx +++ b/webapp/components/comment.jsx @@ -40,21 +40,21 @@ var CommentEditor = React.createClass({ if (this.state.error) { return } else if (this.state.loading) { - return
- + return
+

Publishing Comment

} else if (this.state.success) { var url = '/@' + this.props.adminID + '/' + this.props.board + '/' + (this.props.post || this.props.parent) + '/' + this.state.hash - return - View + return + View } else { return
-