Skip to content

Commit

Permalink
Merge pull request #7 from vegarab/colors
Browse files Browse the repository at this point in the history
Terminal base16 colors
  • Loading branch information
bkanber committed Feb 24, 2018
2 parents bbdb0b4 + 3a1bd4e commit bc833f3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 33 deletions.
5 changes: 2 additions & 3 deletions dist/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ var ChannelBox = function () {
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
}
}
});
Expand Down Expand Up @@ -65,4 +64,4 @@ var ChannelBox = function () {
exports.default = ChannelBox;


module.exports = ChannelBox;
module.exports = ChannelBox;
5 changes: 2 additions & 3 deletions dist/ChannelsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ var ChannelsList = function (_EventEmitter) {
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
},
hover: {
bg: 'green'
Expand Down Expand Up @@ -326,4 +325,4 @@ var ChannelsList = function (_EventEmitter) {
exports.default = ChannelsList;


module.exports = ChannelsList;
module.exports = ChannelsList;
7 changes: 2 additions & 5 deletions dist/MessageForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var MessageForm = function () {
bottom: 0,
width: '100%-2',
height: 4,
bg: 'black'
// border: {type: 'line'}
});

Expand All @@ -37,14 +36,12 @@ var MessageForm = function () {
top: 0,
width: '100%',
height: 4,
bg: 'black',
fg: 'white',
input: true,
mouse: true,
keys: true,
inputOnFocus: true,
label: 'Write Message (Ctrl-o)',
border: { type: 'line' }
border: { type: 'line', fg: 'yellow' },
});

this.textbox.key('enter', function (ch, key) {
Expand Down Expand Up @@ -77,4 +74,4 @@ var MessageForm = function () {
exports.default = MessageForm;


module.exports = MessageForm;
module.exports = MessageForm;
12 changes: 7 additions & 5 deletions dist/MessagesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ var MessagesList = function () {
inverse: true
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
}
}
});
Expand Down Expand Up @@ -110,7 +108,11 @@ var MessagesList = function () {
var userName = typeof m.user !== 'undefined' ? _this2.api.getUserName(m.user) : m.username ? m.username : 'Unknown User';
var time = moment.unix(m.ts);
var formattedTime = time.format('h:mma');
var content = '{bold}' + userName + '{/bold} ' + '{grey-fg}' + formattedTime + "{/grey-fg}: \n" + (m.text ? m.text : JSON.stringify(m));
var text = (m.text ? m.text : JSON.stringify(m));
var content = '{bold}{green-fg}' + userName
+ '{/bold}{/green-fg} '
+ '{cyan-fg}' + formattedTime + "{/cyan-fg}: \n"
+ text;
for (var replaceId in userMap) {
var replaceName = userMap[replaceId];
content = content.replace(replaceId, replaceName);
Expand Down Expand Up @@ -149,4 +151,4 @@ var MessagesList = function () {
exports.default = MessagesList;


module.exports = MessagesList;
module.exports = MessagesList;
3 changes: 1 addition & 2 deletions src/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ export default class ChannelBox {
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
}
}
});
Expand Down
5 changes: 2 additions & 3 deletions src/ChannelsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ export default class ChannelsList extends EventEmitter {
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
},
hover: {
bg: 'green'
Expand Down Expand Up @@ -264,4 +263,4 @@ export default class ChannelsList extends EventEmitter {

}

module.exports = ChannelsList;
module.exports = ChannelsList;
7 changes: 2 additions & 5 deletions src/MessageForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default class MessageForm {
bottom: 0,
width: '100%-2',
height: 4,
bg: 'black',
// border: {type: 'line'}
});

Expand All @@ -24,14 +23,12 @@ export default class MessageForm {
top: 0,
width: '100%',
height: 4,
bg: 'black',
fg: 'white',
input: true,
mouse: true,
keys: true,
inputOnFocus: true,
label: 'Write Message (Ctrl-o)',
border: {type: 'line'}
border: {type: 'line', fg: 'yellow' }
});

this.textbox.key('enter', (ch, key) => {
Expand All @@ -57,4 +54,4 @@ export default class MessageForm {
}
}

module.exports = MessageForm;
module.exports = MessageForm;
13 changes: 6 additions & 7 deletions src/MessagesList.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ export default class MessagesList {
inverse: true
},
style: {
fg: 'white',
bg: 'black',
border: {
fg: '#f0f0f0'
fg: 'yellow',
}
}
});
Expand Down Expand Up @@ -90,9 +88,10 @@ export default class MessagesList {
;
let time = moment.unix(m.ts);
let formattedTime = time.format('h:mma')
let content = '{bold}'+userName + '{/bold} '
+ '{grey-fg}'+formattedTime+"{/grey-fg}: \n"
+ (m.text ? m.text : JSON.stringify(m));
let text = (m.text ? m.text : JSON.stringify(m));
let content = '{bold}{green-fg}'+userName + '{/bold}{green-fg} '
+ '{cyan-fg}'+formattedTime+"{/cyan-fg}: \n"
+ text;
for (const replaceId in userMap) {
const replaceName = userMap[replaceId];
content = content.replace(replaceId, replaceName);
Expand Down Expand Up @@ -124,4 +123,4 @@ export default class MessagesList {
}
}

module.exports = MessagesList;
module.exports = MessagesList;

0 comments on commit bc833f3

Please sign in to comment.