Merge pull request #7734 from rmehta/random-in-awesomebar

feat: try "random" in awesomebar
This commit is contained in:
Rushabh Mehta 2019-06-20 11:19:36 +05:30 committed by GitHub
commit e7f98b414f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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");
}
})
}
}
});