Created
August 23, 2012 11:57
-
-
Save tstachl/3435991 to your computer and use it in GitHub Desktop.
NodeProxy Desk.com implementation
This file contains hidden or 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
<script> | |
function callback() { | |
$.widget('desk.contact', $.ui.autocomplete, require('contact')); | |
$('.salesforce input').contact({ | |
category: 'company', | |
username: 'username', | |
password: 'password', | |
clientId: 'SalesforceClientId', | |
clientSecret: 'SalesforceClientSecret', | |
mapping: { | |
'first_name': 'FirstName', | |
'last_name': 'LastName', | |
'company': 'Account.Name', | |
'title': 'Title', | |
'industry': 'Account.Industry' | |
} | |
}); | |
} | |
(function(d, src, id, callback) { | |
if (d.getElementById(id)) return callback ? callback() : null; | |
var s, ref = d.getElementsByTagName('script')[0]; | |
s = d.createElement('script'); s.id = id; s.async = true; | |
s.src = src; ref.parentNode.insertBefore(s, ref); | |
s.onload = s.onreadystatechange = function(e, isAbort) { | |
if (!isAbort && callback && (!s.readyState || /loaded|complete/.test(s.readyState))) | |
callback() | |
} | |
}(document, '//nodeproxy.herokuapp.com/assets/desk.js', 'salesforce-jssdk', callback)); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment