Skip to content

Commit

Permalink
Popup panel accepts prompt option
Browse files Browse the repository at this point in the history
  • Loading branch information
mooz committed Aug 22, 2020
1 parent 7c28e3f commit 5c7530c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,15 @@
}
this._action = options.action || null;
this._setCandidates(candidates);
this.hintMode = !!options.hints;
// Prompt
if (options.prompt) {
this.queryInput.setAttribute("placeholder", options.prompt);
} else {
this.queryInput.removeAttribute("placeholder");
}
this.show();
// Allow selecting candidates by hints
this.hintMode = !!options.hints;
if (this.hintMode) {
hitHint(`#keysnail-popup a`, () => {
this.exit();
Expand Down Expand Up @@ -1193,6 +1200,7 @@
inline: "center",
});
},
prompt: "Outline",
}
);
},
Expand All @@ -1202,7 +1210,7 @@
text: `📖 ${site.alias}`,
url: site.url,
})),
{ toggle: true }
{ toggle: true, prompt: "Favorite sites" }
);
},
runEvalConsole: () => {
Expand All @@ -1213,6 +1221,7 @@
message(result + "");
}
},
prompt: "Evaluate JavaScript (content context)",
});
},
showKeyHelp: () => {
Expand Down

0 comments on commit 5c7530c

Please sign in to comment.