Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bg: 'red',
fg: 'white'
};
function isaBox(x) {
if (x.indexOf('ag') != -1)
return true;
return false;
}
function isaText(x) {
return (x[0] == ':');
}
let res = undefined;
if (isaText(name)) {
res = blessed.textarea(obj);
res.select = function() { /* do nothing */ };
} else if (isaBox(name)) {
res = blessed.box(obj);
res.select = function() { /* do nothing */ };
} else {
obj.selectedFg = 'white';
obj.selectedBg = '#000070';
res = blessed.list(obj);
res.setContent = function(x) {
if (typeof x === 'string') {
res.setItems(x.split('\n'));
}
}
}
res.cmd = name;
return res;
screen.key('n', function(ch, key) {
var newChatBox = blessed.textarea({
parent: screen,
// Possibly support:
// align: 'center',
fg: 'blue',
height: '15%',
border: {
type: 'line'
},
width: '75%',
top: '35%',
left: '12.5%',
label: "New Conversation - type in contact iMessage info and hit enter"
});
newChatBox.on('focus', function() {
newChatBox.readInput(function(data) {});
right: 0,
bottom: 3,
content: 'Welcome!',
tags: true,
scrollable: true,
alwaysScroll: true,
scrollbar: {
bg: 666
},
style: {
fg: 'white'
}
});
// Input box
var messageInput = blessed.textarea({
bottom: 0,
left: 0,
right: 0,
height: 3,
input: true,
inputOnFocus: true,
mouse: true,
clickable: true,
focused: true,
content: '',
border: {
type: 'line'
},
style: {
fg: 'white',
}
exports = module.exports = function (context) {
var input = Blessed.textarea({
bottom: 0,
height: 3,
autoPadding: true,
inputOnFocus: true,
padding: {
top: 1,
left: 2
},
style: Styles['message-input']
});
return input;
};
var init = function (screen) {
styles.layout.parent = screen;
layout = blessed.layout(styles.layout);
styles.textarea.parent = layout;
styles.menubar.parent = layout;
textarea = blessed.textarea(styles.textarea);
menubar = blessed.listbar(styles.menubar);
return {
layout : layout,
textarea: textarea,
menubar : menubar
};
};
fg: 'green',
},
border: {
fg: 'green',
},
focus: {
label: {
bold: true,
},
border: {
bold: true,
}
}
},
})
const descrBox = blessed.textarea({
parent: cardForm,
name: 'desc',
top: 3,
keys: true,
vi: true,
inputOnFocus: true,
border: {
type: 'line',
},
label: ` Description `,
style: {
label: {
fg: 'green',
left: '50%',
},
border: {
fullUnicode: true,
});
const naviEl = blessed.list({
width: '30%-1',
height: '100%-2',
left: 2,
top: 1,
style: {
border: {
fg: 'white',
}
},
});
const textArea = blessed.textarea({
width: '70%-1',
height: '100%-2',
top: 2,
left: '30%',
keys: true,
inputOnFocus: true,
style: {
border: {
fg: 'white',
}
},
});
const ed = new Editor({
parent: screen,
width: '70%-1',
function drawFooter(){
inbox = blessed.textarea({
bottom: 1,
height: 1,
left: '0%',
width: '100%',
inputOnFocus: true,
style: {
fg: '#787878',
bg: '#454545',
focus: {
fg: '#f6f6f6',
bg: '#353535'
}
}
})
footer = blessed.text({