This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
var github = { | |
token: null, | |
getUser: function() { | |
return request({ | |
"method":"GET", | |
"uri": "https://api.github.com/user", | |
"json": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
getUserReposUrl: function(user) { | |
return user.repos_url; | |
} | |
}; | |
function main(params) { | |
github.token = params.token; | |
return github.getUser() | |
.then(github.getUserReposUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
getUserRepos: function(uri, repos) { | |
return request({ | |
"method": "GET", | |
"uri": uri, | |
"json": true, | |
"resolveWithFullResponse": true, | |
"headers": { | |
"Authorization": "Bearer " + github.token, | |
"User-Agent": "My little demo app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
isPublic: function(repo) { | |
return !repo.private; | |
}, | |
isOriginal: function(repo) { | |
return !repo.fork; | |
}, | |
licenseUrl: function(repo) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var github = { | |
checkLicense: function(uri) { | |
return request({ | |
"method": "GET", | |
"uri": uri, | |
"json": true, | |
"headers": { | |
"Authorization": "Bearer " + github.token, | |
"User-Agent": "My little demo app" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request-promise'); | |
var github = { | |
token: null, | |
getUser: function() { | |
return request({ | |
"method":"GET", | |
"uri": "https://api.github.com/user", | |
"json": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cq:dialog jcr:primaryType="nt:unstructured" jcr:title="Embed" sling:resourceType="cq/gui/components/authoring/dialog"> | |
<content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"> | |
<items jcr:primaryType="nt:unstructured"> | |
<column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> | |
<items jcr:primaryType="nt:unstructured"> | |
<url | |
jcr:primaryType="nt:unstructured" | |
fieldDescription="URL of a page that supports oEmbed auto-discovery (e.g. YouTube)" | |
fieldLabel="Web page address" | |
name="./webpage" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/libs/foundation/global.jsp"%><% | |
%><% | |
String url = properties.get("webpage", String.class); | |
%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cq:design_dialog jcr:primaryType="nt:unstructured" jcr:title="Embed" sling:resourceType="cq/gui/components/authoring/dialog" jcr:description="Content policy for embedding content"> | |
<content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> | |
<items jcr:primaryType="nt:unstructured"> | |
<tabs jcr:primaryType="nt:unstructured" maximized="true" sling:resourceType="granite/ui/components/coral/foundation/tabs"> | |
<items jcr:primaryType="nt:unstructured"> | |
<properties jcr:primaryType="nt:unstructured" jcr:title="Main" margin="true" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"> | |
<items jcr:primaryType="nt:unstructured"> | |
<content jcr:primaryType="nt:unstructured" margin="false" sling:resourceType="granite/ui/components/coral/foundation/container"> | |
<items jcr:primaryType="nt:unstructured"> | |
<allowedSites jcr:primaryType="nt:unstructured" fieldDescription="I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@include file="/libs/foundation/global.jsp"%><% | |
String[] whitelist = currentStyle.get("allowedSites", new String[0]); | |
%> |