From e4a3586a14996bbece3b26c9e3b7704ea6af8615 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Sat, 28 Nov 2015 15:24:36 -0600 Subject: LibreJS upgraded to 6.0.10 --- .../node_modules/pathfinder/docs/awesomebar.md | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/docs/awesomebar.md (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/docs/awesomebar.md') diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/docs/awesomebar.md b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/docs/awesomebar.md new file mode 100644 index 0000000..dcfbb1f --- /dev/null +++ b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/node_modules/pathfinder/docs/awesomebar.md @@ -0,0 +1,61 @@ + + + +The `awesomebar` API provides a simple way to create AwesomeBar suggestions. + +## Example ## + + // add github search + AwesomeBarSuggestion({ + icon: self.data.url("github_16.png"), + matches: /^(?:@[\w\d_-]+|github\s)/i, + onSearch: function(query, suggest) { + query = query.trim(); + if (/^github\s/i.test(query)) { + query = query.replace(/^github\s/i, ""); + suggest({ + title: 'Search Github for: ' + query, + favicon: self.data.url("github_16.png"), + url: 'https://github.com/search?q=' + encodeURIComponent(query) + }, true); + } else { + var username = query.match(/^@([\w\d_-]+)/)[1]; + suggest({ + title: 'Github user: ' + username, + label: "View user profile for @" + username, + favicon: self.data.url("github_16.png"), + url: 'https://github.com/' + username + }, true); + } + } + }); + + +@class + A `AwesomeBarSuggestion` constructor is exported, which allows one to create a + AwesomeBar suggestions. + + +@constructor + Creates a AwesomeBar suggestion handler. + +@param options {object} + Options for the AwesomeBar suggester, with the following parameters: + +@prop matches {string} + A regular expression which is tested againsted the location bar input string. + +@prop [icon] {string} + A URL for a 16x16 icon image. + +@prop onSearch {function} + Function that is invoked when the match pattern matches the location bar input + string. If will receive too arguments, `query` which is the input string, and + `suggest` which is a function that can be made to return suggestions. + + + +@method + Removes the AwesomeBar suggester. + + -- cgit v1.2.3