Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let selected = infoList.selected;
if (selected < OPTIONS.length) {
let optionKey = OPTIONS[selected].split(',')[0].replace(/\W/g, '');
helpText = yargsOptions[optionKey].describe;
boxTitle = optionKey + ' option';
} else {
let replacementObj = REPLACEMENTS[Object.keys(REPLACEMENTS)[selected - OPTIONS.length]];
helpText = replacementObj.description;
boxTitle = replacementObj.name + ' Variable';
if (replacementObj.parameters) {
helpText += '\n\nParameters: ' + replacementObj.parameters.description;
}
}
helpText += '\n\n{center}Press space to close{/center}';
let msg = blessed.message({
parent: screen,
label: boxTitle,
border: 'line',
height: 'shrink',
width: 'half',
top: 'center',
left: 'center',
tags: true,
keys: true
});
msg.display(helpText, 0, function() { msg.destroy(); });
});
// ========== END EVENT HANDLERS ==========
parent: screen,
top: 'center',
left: 'center',
height: 5,
align: 'center',
width: '50%',
tags: true,
hidden: true,
border: 'line'
});
/**
* Message
*/
screen._.msg = blessed.message({
parent: screen,
top: 'center',
left: 'center',
// Fixed in blessed:
// height: '50%',
height: 'shrink',
width: '50%',
align: 'center',
tags: true,
hidden: true,
border: 'line',
// "q" will not make the box disappear on display()
ignoreKeys: ['q']
});
/**
// height: '50%',
height: 'shrink',
width: '50%',
align: 'center',
tags: true,
hidden: true,
border: 'line',
// "q" will not make the box disappear on display()
ignoreKeys: ['q']
});
/**
* Details
*/
screen._.details = blessed.message({
parent: screen,
// Fixed in blessed.
// top: 'center',
// left: 'center',
// height: 'shrink',
// width: 'shrink',
//top: 2,
//left: 4,
//right: 4,
//bottom: 2,
top: 'center',
left: 'center',
width: '70%',
initMessage(){
const t = this;
t.message = blessed.message({
parent: t.screen,
top: '100%-5',
left: '100%-30',
height: 5,
padding: DEFAULT_PADDING,
align: 'left',
valign: 'center',
width: 30,
tags: true,
hidden: true,
border: 'line'
});
}
parent: this.screen,
bottom: 0,
right: 0,
height: 1
})
this.chatInputSeperator = Blessed.line({
parent: this.screen,
bottom: 1,
right: 0,
orientation: 'horizontal'
})
this.loginMessage = Blessed.message({
parent: this.screen,
top: "center",
left: "center",
height: "shrink",
width: "half",
tags: true,
keys: true,
hidden: true,
border: "line"
})
}
export default (parent, label) => blessed.message({
parent,
...stylesheet,
label
});
initLoader(){
const t = this;
t.message = blessed.message({
parent: t.screen,
top: '100%-5',
left: '100%-30',
height: 5,
align: 'left',
valign: 'center',
width: 30,
tags: true,
hidden: true,
border: 'line'
});
}
const messageBox = blessed.message({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: 'shrink',
border: 'line',
label: ' {blue-fg}Message{/} ',
tags: true,
keys: true,
mouse: true,
hidden: true
})
const infoBox = blessed.message({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: '40%',
border: 'line',
label: ' {blue-fg}Info{/} ',
tags: true,
keys: true,
mouse: true,
hidden: true,
style: {
bg: '#023f00',
border: {
fg: '#f0f0f0'
}
initMessage(){
const t = this;
t.message = blessed.message({
parent: t.screen,
top: '100%-5',
left: '100%-30',
height: 5,
padding: DEFAULT_PADDING,
align: 'left',
valign: 'center',
width: 30,
tags: true,
hidden: true,
border: 'line'
});
}
content: 'Feedly Terminal'
});
var loader = blessed.loading({
parent: screen,
top: 'center',
left: 'center',
height: 5,
align: 'center',
width: '50%',
tags: true,
hidden: true,
border: 'line'
});
var msg = blessed.message({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: '50%',
align: 'center',
tags: true,
hidden: true,
border: 'line'
});
var prompt = blessed.prompt({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',