This repository has been archived by the owner on Jan 18, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resources plugin integration (FacebookSdkResources created) + doc update
- Loading branch information
Benoit Hediard
committed
Oct 29, 2012
1 parent
4cfcb51
commit e668b2b
Showing
22 changed files
with
322 additions
and
134 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
modules = { | ||
|
||
'fb-sdk-add-to-page-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/add-to-page-link.js' | ||
} | ||
|
||
'fb-sdk-invite-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/invite-link.js' | ||
} | ||
|
||
'fb-sdk-login-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/login-link.js' | ||
} | ||
|
||
'fb-sdk-logout-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/logout-link.js' | ||
} | ||
|
||
'fb-sdk-publish-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/publish-link.js' | ||
} | ||
|
||
'fb-sdk-send-link' { | ||
defaultBundle 'fb-sdk' | ||
resource url: '/js/send-link.js' | ||
} | ||
|
||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
<g:if test="${!disabled}"> | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_addToPage() { | ||
FB.ui({ | ||
'method':'pagetab' | ||
}<g:if test="${callBackJS}">, ${callBackJS}</g:if>); | ||
return false; | ||
} | ||
</r:script> | ||
</g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="<g:if test="${!disabled}">FBGrailsSDK_addToPage();</g:if><g:else>return false;</g:else>">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-add-to-page-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-add-to-page-link" | ||
<g:if test="${callback}">data-callback="${callback}"</g:if> | ||
<g:if test="${display}">data-display="${display}"</g:if> | ||
<g:if test="${returnUrl}">data-return_url="${returnUrl}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
<%@ page import="grails.converters.JSON" %> | ||
<g:if test="${!disabled}"> | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_invite() { | ||
FB.ui({ | ||
method: 'apprequests', | ||
message: '${message.encodeAsJavaScript()}' | ||
<g:if test="${data}">, data: '${data}'</g:if> | ||
<g:if test="${display}">, 'display':'${display}'</g:if> | ||
<g:if test="${excludeIds}">, exclude_ids: '${excludeIds as JSON}'</g:if> | ||
<g:if test="${filters}">, filters: ${filters as JSON}</g:if> | ||
<g:if test="${maxRecipients}">, max_recipients: ${maxRecipients}</g:if> | ||
<g:if test="${title}">, title: '${title.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${to}">, to: '${to}'</g:if> | ||
}<g:if test="${callBackJS}">, ${callBackJS}</g:if>); | ||
return false; | ||
} | ||
</r:script> | ||
</g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="<g:if test="${!disabled}">FBGrailsSDK_invite();</g:if><g:else>return false;</g:else>">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-invite-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-invite-link" | ||
data-message="${message.encodeAsJavaScript()}" | ||
<g:if test="${callback}">data-callback="${callback}"</g:if> | ||
<g:if test="${data}">data-data="${data}"</g:if> | ||
<g:if test="${display}">data-display="${display}"</g:if> | ||
<g:if test="${excludeIds}">data-exclude_ids="${(excludeIds as JSON).toString().replace('"',"'")}"</g:if> | ||
<g:if test="${filters}">data-filters="${(filters as JSON).toString().replace('"',"'")}"</g:if> | ||
<g:if test="${maxRecipients}">data-max_recipients="${maxRecipients}"</g:if> | ||
<g:if test="${title}">data-title="${title.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${to}">data-to="${to}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,10 @@ | ||
<g:if test="${appPermissions instanceof List}"> | ||
<g:set var="appPermissions" value="${appPermissions.join(',')}" /> | ||
</g:if> | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_login() { | ||
FB.login(function(response) { | ||
if (response.authResponse) { | ||
// user is logged | ||
<g:if test="${returnUrl}"> | ||
window.location.href = "${returnUrl}"; | ||
</g:if> | ||
<g:else> | ||
window.location.reload(); | ||
</g:else> | ||
<g:if test="${cancelUrl}"> | ||
} else { | ||
// user cancelled login | ||
window.location.href = "${cancelUrl}"; | ||
</g:if> | ||
} | ||
}, {scope:"${appPermissions}"}); | ||
} | ||
</r:script> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="FBGrailsSDK_login();">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-login-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-login-link" | ||
data-permissions="${appPermissions instanceof List ? appPermissions.join(',') : appPermissions}" | ||
<g:if test="${cancelUrl}">data-cancel_url="${cancelUrl}"</g:if> | ||
<g:if test="${returnUrl}">data-return_url="${returnUrl}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,8 @@ | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_logout() { | ||
FB.getLoginStatus(function(response) { | ||
if (response.authResponse) { | ||
FB.logout(function(response) { | ||
<g:if test="${nextUrl}"> | ||
window.location.href = "${nextUrl}"; | ||
</g:if> | ||
<g:else> | ||
window.location.reload(); | ||
</g:else> | ||
}); | ||
} else { | ||
<g:if test="${nextUrl}"> | ||
window.location.href = "${nextUrl}"; | ||
</g:if> | ||
<g:else> | ||
window.location.reload(); | ||
</g:else> | ||
} | ||
}); | ||
} | ||
</r:script> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="FBGrailsSDK_logout();">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-logout-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-logout-link" | ||
<g:if test="${nextUrl}">data-next_url="${nextUrl}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
<g:if test="${!disabled}"> | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_publish() { | ||
FB.ui({ | ||
'method':'feed' | ||
<g:if test="${display}">, 'display':'${display}'</g:if> | ||
<g:if test="${caption}">, 'caption':'${caption.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${description}">, 'description':'${description.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${link}">, 'link':'${link}'</g:if> | ||
<g:if test="${name}">, 'name':'${name.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${picture}">, 'picture':'${picture}'</g:if> | ||
<g:if test="${source}">, 'source':'${source}'</g:if> | ||
}<g:if test="${callBackJS}">, ${callBackJS}</g:if>); | ||
return false; | ||
} | ||
</r:script> | ||
</g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="<g:if test="${!disabled}">FBGrailsSDK_publish();</g:if><g:else>return false;</g:else>">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-publish-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-publish-link" | ||
<g:if test="${callback}">data-callback="${callback}"</g:if> | ||
<g:if test="${caption}">data-caption="${caption.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${display}">data-display="${display}"</g:if> | ||
<g:if test="${description}">data-description="${description.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${link}">data-link="${link}"</g:if> | ||
<g:if test="${name}">data-name="${name.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${picture}">data-picture="${picture}"</g:if> | ||
<g:if test="${source}">data-source="${source}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
<g:if test="${!disabled}"> | ||
<r:script disposition="footer"> | ||
function FBGrailsSDK_send() { | ||
FB.ui({ | ||
'method':'send', | ||
'to': ${to} | ||
<g:if test="${display}">, 'display':'${display}'</g:if> | ||
<g:if test="${description}">, 'description':'${description.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${link}">, 'link':'${link}'</g:if> | ||
<g:if test="${name}">, 'name':'${name.encodeAsJavaScript()}'</g:if> | ||
<g:if test="${picture}">, 'picture':'${picture}'</g:if> | ||
}<g:if test="${callBackJS}">, ${callBackJS}</g:if>); | ||
return false; | ||
} | ||
</r:script> | ||
</g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> <g:if test="${elementClass}">class="${elementClass}"</g:if> href="#" onclick="<g:if test="${!disabled}">FBGrailsSDK_send();</g:if><g:else>return false;</g:else>">${body}</a> | ||
<g:if test="${!disabled}"><r:require module="fb-sdk-send-link" /></g:if> | ||
<a <g:if test="${elementId}">id="${elementId}"</g:if> | ||
class="<g:if test="${elementClass}">${elementClass} </g:if>fb-sdk-send-link" | ||
data-to="${to}" | ||
<g:if test="${display}">data-display="${display}"</g:if> | ||
<g:if test="${description}">data-description="${description.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${link}">data-link="${link}"</g:if> | ||
<g:if test="${name}">data-name="${name.encodeAsJavaScript()}"</g:if> | ||
<g:if test="${picture}">data-picture="${picture}"</g:if> | ||
<g:if test="${disabled}">disabled="disabled"</g:if> | ||
href="#"> | ||
${body} | ||
</a> |
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
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
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
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
Oops, something went wrong.