Merge pull request #7734 from rmehta/random-in-awesomebar
feat: try "random" in awesomebar
This commit is contained in:
commit
e7f98b414f
1 changed files with 13 additions and 0 deletions
|
|
@ -160,6 +160,7 @@ frappe.search.AwesomeBar = Class.extend({
|
|||
this.make_global_search(txt);
|
||||
this.make_search_in_current(txt);
|
||||
this.make_calculator(txt);
|
||||
this.make_random(txt);
|
||||
},
|
||||
|
||||
build_options: function(txt) {
|
||||
|
|
@ -268,4 +269,16 @@ frappe.search.AwesomeBar = Class.extend({
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
make_random: function(txt) {
|
||||
if(txt.toLowerCase().includes('random')) {
|
||||
this.options.push({
|
||||
label: "Generate Random Password",
|
||||
value: frappe.utils.get_random(16),
|
||||
onclick: function() {
|
||||
frappe.msgprint(frappe.utils.get_random(16), "Result");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue