Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (screen, cb) => {
const prompt = blessed.prompt({
parent: screen,
border: 'line',
height: 'shrink',
width: 'half',
top: 'center',
left: 'center',
label: ' {blue-fg}Question{/blue-fg} ',
tags: true,
keys: true,
vi: true,
hidden: false
});
prompt.input('insert vk user or community url', '', (err, value) => {
const alias = value.split('vk.com/')[1];
return vk.method('utils.resolveScreenName', { screen_name: alias }).then((apiResponse) => {
screen.key('s', function(ch, key){
var prompt = blessed.prompt({
vi: true,
keys: true
});
screen.append(prompt);
prompt.input("Input search term","", function(err, value){
user_mode = false;
search_mode = true;
_search = value;
title_text.setContent("imgurize | " + ("search: " + _search).white);
init();
screen.remove(prompt);
screen.render();
});
});
prompt(str, value, callback) {
const prompt = blessed.prompt({
parent: this,
border: 'line',
height: 'shrink',
width: 'half',
top: 'center',
left: 'center',
label: ' {blue-fg}Prompt{/blue-fg} ',
tags: true,
keys: true,
vi: true,
padding: 1,
});
prompt.input(str, value || '', (err, value) => {
if (err) { return; }
if (value) {
function uiQuestion(title, text, cb) {
var question = blessed.prompt({
parent: screen,
border: config.border,
height: 'shrink',
width: 'half',
top: 'center',
left: 'center',
label: title,
tags: true,
keys: true,
vi: true
});
question.input('\n ' + text, (err, val) => {
question.destroy();
screen.render();
if (!err && val) {
cb(val);
tabs.debug._.data = blessed.text({
parent: tabs.debug,
top: 0,
left: 3,
height: 'shrink',
width: 'shrink',
content: '',
tags: true
});
}
/**
* Global Widgets
*/
screen._.prompt = blessed.prompt({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: 'shrink',
keys: true,
vi: true,
mouse: true,
tags: true,
content: 'Label:',
border: 'line',
hidden: true
});
screen._.prompt._.input.key('C-e', function() {
if (!screen.focused || screen.focused !== screen._.prompt._.input) {
function createPrompt(screen, popupLabel) {
return blessed.prompt({
parent: screen,
border: "line",
height: 9,
width: 45,
top: "center",
left: "center",
label: popupLabel,
tags: true,
keys: true,
style: {
fg: "blue",
bg: colors.background,
border: {
fg: "light-green"
}
}
constructor(screen, rawData, _blessed=require('blessed'), Table=require('./widgets/table')) {
this.blessed = _blessed;
this.screen = screen;
this.rawData = rawData.reverse();
this.jsonMode = false;
const def = this.parseData();
const prompt = blessed.prompt({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: 'shrink',
keys: true,
vi: true,
mouse: true,
tags: true,
border: 'line',
hidden: true,
});
const table = Table({
keys: true,
fg: 'white',
import blessed from 'blessed'
const screen = blessed.screen({
smartCSR: true,
title: 'reactotron',
dockBorders: false,
fullUnicode: true
})
const promptBox = blessed.prompt({
parent: screen,
top: 'center',
left: 'center',
height: 'shrink',
width: 'shrink',
border: 'line',
label: ' {blue-fg}Prompt{/} ',
tags: true,
keys: true,
mouse: true,
hidden: true
})
const messageBox = blessed.message({
parent: screen,
top: 'center',