[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

test[fb-web] 00 Check FB SDK is loaded

" Test for FB global in javascript space. "
#{FB} isNil ifTrue: [
	self error: 'The Facebook SDK is not loaded in this page.'
].
^#ok


" Test using FB framework. "

"release - use framework loaded from U8 service"
self require: #FB in: 'u8:aleReimondo/FB/FB.st.js'.

"development - use swiki repo for framework code"
Smalltalk at: #FB ifAbsent: [
	self print: '// Loading Facebook framework API from swiki'.
	self @> 'swiki:s8-media/apiFb-webIndex'
].

FB current isNil ifTrue: [
	self error: 'The Facebook SDK is not loaded in this page.'
].
^#ok