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
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" | |
standardController="Merchandise__c" extensions="MobileInventoryExtension" | |
recordSetVar="products"> | |
<head> | |
<title>Mobile Inventory</title> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" /> |
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
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" | |
standardController="Merchandise__c" extensions="MobileInventoryExtension" | |
recordSetVar="products"> | |
<head> | |
<title>Mobile Inventory</title> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" /> |
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
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" | |
standardController="Merchandise__c" extensions="MobileInventoryExtension" | |
recordSetVar="products"> | |
<head> | |
<title>Mobile Inventory</title> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" /> |
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
global class GoogleInternalRegHandler implements Auth.RegistrationHandler{ | |
global User createUser(Id portalId, Auth.UserData data){ | |
User u = [SELECT Id FROM user WHERE GoogleID__c =: data.identifier]; | |
return u; | |
} | |
global void updateUser(Id userId, Id portalId, Auth.UserData data){ | |
} | |
} |
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
@RestResource(urlMapping='/messagetotask') | |
global class MessageToTask { | |
@HttpPost | |
global static void incomingMessage() { | |
String expectedSignature = | |
RestContext.request.headers.get('X-Twilio-Signature'); | |
String url = 'https://' + RestContext.request.headers.get('Host') + | |
'/services/apexrest' + RestContext.request.requestURI; | |
Map <String, String> params = RestContext.request.params; |
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
<apex:page > | |
<style> | |
.chartHidden{ | |
display: none; | |
} | |
.chartShown{ | |
display: block; | |
} | |
</style> | |
<apex:includeScript value="{!$Resource.jquery}" /> |
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
public class PortalHandler implements Auth.RegistrationHandler{ | |
// createUser is called when there is no existing user linked to the incoming | |
// | |
public User createUser(Id portalId, Auth.UserData data){ | |
User u; | |
// Use incoming email for username, since we're working with a portal user | |
// Look for a existing user with same email address | |
List<User> l = [SELECT Id, ContactId FROM User WHERE UserName = :data.email]; | |
if (l.size() > 0) { |
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
<apex:page > | |
<apex:includeScript value="{!$Resource.cometd}"/> | |
<apex:includeScript value="{!$Resource.jquery191}" /> | |
<apex:includeScript value="{!$Resource.forcetk}" /> | |
<apex:includeScript value="{!$Resource.jquery_cometd}"/> | |
<apex:includeScript value="https://www.google.com/jsapi" /> | |
<script> | |
// Get an instance of the REST API client and set the session ID | |
var client = new forcetk.Client(); | |
client.setSessionToken('{!$Api.Session_ID}'); |
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
<apex:page standardStylesheets="false" showHeader="false" sidebar="false" | |
standardController="Merchandise__c" extensions="MobileInventoryExtension" | |
recordSetVar="products"> | |
<head> | |
<title>Mobile Inventory</title> | |
<meta name="viewport" | |
content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<apex:stylesheet value="{!URLFOR($Resource.jquerymobile130, 'jquery.mobile-1.3.0.min.css')}" /> |
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 jwt = require('jwt-simple'); | |
var getpem = require('rsa-pem-from-mod-exp'); | |
// Decode JWT token, verify with the relevant key from the supplied | |
// array | |
function decodeIdToken(idtoken, keys, code) { | |
var header = JSON.parse(new Buffer(idtoken.split('.')[0], 'base64').toString('utf8')); | |
for (var i = 0; i < keys.length; i++) { | |
if (keys[i].kid === header.kid) { |