jquery-eclipsefdn-api
About
A jQuery plugin that fetches and display data from various Eclipse Foundation APIs.
Options
Here's a list of available settings.
$("div").eclipseFdnApi({
username: "cguindon",
type: "mpFavoritesCount"
});
Attribute | Type | Default | Description |
---|
apiUrl | String | https://api.eclipse.org | Eclipse Api URL. |
gerritUrl | String | https://git.eclipse.org/r | Eclipse Gerrit URL. |
eventUrl | String | https://events.eclipse.org/data/EclipseEvents.json | Eclipse event json feed URL. |
forumsUrl | String | https://www.eclipse.org/forums | Eclipse Forums URL. |
marketplaceUrl | String | https://marketplace.eclipse.org | Eclipse Marketplace URL. |
errorMsg | String | <i class=\"fa red fa-exclamation-triangle\" aria-hidden=\"true\"></i> An unexpected error has occurred. | Error message for when the ajax request fails. |
gerritUserNotFoundMsg | String | <i class=\"fa red fa-exclamation-triangle\" aria-hidden=\"true\"></i> An unexpected error has occurred. | Error message for when a user is not found on Gerrit. |
username | String | cguindon | The username to fetch Eclipse Favorites or Gerrit reviews for. |
currentUsername | String | `` | The user making the request this page. Useful if content changed if the user is viewing his own page. |
type | String | | Valid values are gerritReviews , gerritReviewsCount , mpFavorites , projectsList , forumsMsg and recentEvents . |
itemsPerPage | Integer | 20 | Number of fetched items to display per page. |
Contributing
Check CONTRIBUTING.md for more information.
License
MIT License © Christopher Guindon
Thanks to https://github.com/jquery-boilerplate/jquery-boilerplate, MIT License © Zeno Rocha
jquery-eclipsefdn-igc README
About
A jQuery plugin to provide OAUTH2 Implicit Grant Flow authorization functionality for API requests to client scripts and plugins
Options
Here's an example of how to use the client.
$(document).on("igcRequestComplete", function(event, eventData) {
if (eventData.clientName === "myScript") {
}
});
$(document).on("igcRequestFailed", function(event, eventError) {
if (eventError.clientName === "myScript") {
}
});
$(document).on("igcAuthFailed", function(event, authError) {
if (authError.clientName === "myScript") {
}
});
$(document).eclipseFdnIgc({
clientName: "myScript",
authURL: "https://accounts.example.com",
apiURL: "https://api.example.com",
username: "darmstrong"
});
requestOptions = {
path: "marketplace/favorites/12345",
method: "PUT",
cid: "myClientID",
scope: "scopeToRequest",
successCallback: function(data) {
},
errorCallback: function(jqXHR) {
}
};
$(document).eclipseFdnIgc.makeRequest(requestOptions);
Attribute | Type | Default | Description |
---|
clientName | String | unknown | Identifying name for client. Used to separate stored items. |
authUrl | String | https://accounts.eclipse.org | Eclipse Authorization base URL. |
apiUrl | String | https://api.eclipse.org | Eclipse API base url. |
redirectUri | String | [location.protocol, "//", location.host, "/site_login_implicit_grant"].join("") | redirect landing page for authorization response. defaults to current site and path of "/site_login_implicit_grant" |
baseStorageName | String | eclipseIGC | base name to build storage name from. |
redirectIfValid | Boolean | true | redirect to originating page after validating authorization response |
validateUser | Boolean | true | Validates authorization token matches currently logged in user |
useOpenWin | Boolean | false | Opens a new window for authorization flow instead of using current window. |
encodeStorage | Boolean | true | Base64 encode data placed in storage |
userName | String | '' | currently logged in username, used for validation purposes and to clear items if user logs out or other account is logged in |
completeOnAuthorization | Boolean | true | finish the request that triggered authorization after completing validation |
License
MIT License © Christopher Guindon
Thanks to https://github.com/jquery-boilerplate/jquery-boilerplate, MIT License © Zeno Rocha