my-simon 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/README.md +3 -20
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/my-simon.gemspec +3 -78
  5. metadata +2 -77
  6. data/DOC/Launch Check List.docx +0 -0
  7. data/DOC/Launch Check List.pdf +0 -0
  8. data/build/rakefile.rb +0 -12
  9. data/config.rb +0 -24
  10. data/scaffolding/simon/controller.tpl +0 -9
  11. data/scaffolding/simon/model.tpl +0 -10
  12. data/scaffolding/simon/view.tpl +0 -5
  13. data/scaffolding/standards/html_template.html +0 -44
  14. data/scaffolding/standards/html_template.php +0 -44
  15. data/scaffolding/standards/jquery_plugin_template.js +0 -45
  16. data/scaffolding/standards/js_template.js +0 -43
  17. data/www/.htaccess +0 -488
  18. data/www/404.html +0 -32
  19. data/www/crossdomain.xml +0 -25
  20. data/www/favicon.ico +0 -0
  21. data/www/index.php +0 -17
  22. data/www/lib/js/homePage.js +0 -43
  23. data/www/lib/js/jquery/JQbook.js +0 -809
  24. data/www/lib/js/jquery/jquery-1.8.0.min.js +0 -27
  25. data/www/lib/js/jquery/jquery.alphanumeric.js +0 -82
  26. data/www/lib/js/jquery/jquery.cookie.js +0 -96
  27. data/www/lib/js/jquery/jquery.easing.1.3.js +0 -207
  28. data/www/lib/js/main.js +0 -117
  29. data/www/lib/js/master.js +0 -6
  30. data/www/lib/js/plugins/handlebars-1.0.rc.1.js +0 -1920
  31. data/www/lib/js/plugins/modernizr-1.7.min.js +0 -2
  32. data/www/lib/js/plugins/swfobject.js +0 -777
  33. data/www/lib/js/plugins_mod/README.txt +0 -3
  34. data/www/lib/php/app.php +0 -53
  35. data/www/lib/php/controller/index.php +0 -10
  36. data/www/lib/php/controller/regex.php +0 -23
  37. data/www/lib/php/model/Book.php +0 -8
  38. data/www/lib/php/model/Model.php +0 -8
  39. data/www/lib/php/plugins/php-activerecord/ActiveRecord.php +0 -44
  40. data/www/lib/php/plugins/php-activerecord/lib/CallBack.php +0 -226
  41. data/www/lib/php/plugins/php-activerecord/lib/Column.php +0 -155
  42. data/www/lib/php/plugins/php-activerecord/lib/Config.php +0 -288
  43. data/www/lib/php/plugins/php-activerecord/lib/Connection.php +0 -456
  44. data/www/lib/php/plugins/php-activerecord/lib/ConnectionManager.php +0 -38
  45. data/www/lib/php/plugins/php-activerecord/lib/DateTime.php +0 -45
  46. data/www/lib/php/plugins/php-activerecord/lib/Exceptions.php +0 -137
  47. data/www/lib/php/plugins/php-activerecord/lib/Expressions.php +0 -183
  48. data/www/lib/php/plugins/php-activerecord/lib/Inflector.php +0 -115
  49. data/www/lib/php/plugins/php-activerecord/lib/Model.php +0 -1673
  50. data/www/lib/php/plugins/php-activerecord/lib/Reflections.php +0 -86
  51. data/www/lib/php/plugins/php-activerecord/lib/Relationship.php +0 -637
  52. data/www/lib/php/plugins/php-activerecord/lib/SQLBuilder.php +0 -396
  53. data/www/lib/php/plugins/php-activerecord/lib/Serialization.php +0 -302
  54. data/www/lib/php/plugins/php-activerecord/lib/Singleton.php +0 -57
  55. data/www/lib/php/plugins/php-activerecord/lib/Table.php +0 -547
  56. data/www/lib/php/plugins/php-activerecord/lib/Utils.php +0 -351
  57. data/www/lib/php/plugins/php-activerecord/lib/Validations.php +0 -833
  58. data/www/lib/php/plugins/php-activerecord/lib/adapters/MysqlAdapter.php +0 -73
  59. data/www/lib/php/plugins/php-activerecord/lib/adapters/OciAdapter.php +0 -121
  60. data/www/lib/php/plugins/php-activerecord/lib/adapters/PgsqlAdapter.php +0 -104
  61. data/www/lib/php/plugins/php-activerecord/lib/adapters/SqliteAdapter.php +0 -81
  62. data/www/lib/php/system/Config.php +0 -174
  63. data/www/lib/php/system/config.routes.php +0 -29
  64. data/www/lib/php/system/router.php +0 -220
  65. data/www/lib/php/template/footer.php +0 -59
  66. data/www/lib/php/template/header.php +0 -74
  67. data/www/lib/php/view/index.php +0 -5
  68. data/www/media/images/facebook_share.jpg +0 -0
  69. data/www/robots.txt +0 -5
  70. data/www/sandbox/readme.txt +0 -3
  71. data/www/sass/javascript.scss +0 -1
  72. data/www/sass/layout.scss +0 -128
  73. data/www/sass/master.scss +0 -4
  74. data/www/sass/reset.scss +0 -47
  75. data/www/sass/typography.scss +0 -24
  76. data/www/styles/javascript.css +0 -1
  77. data/www/styles/layout.css +0 -186
  78. data/www/styles/master.css +0 -4
  79. data/www/styles/reset.css +0 -60
  80. data/www/styles/typography.css +0 -24
data/www/404.html DELETED
@@ -1,32 +0,0 @@
1
- <!doctype html>
2
- <title>Page Not Found</title>
3
- <style>
4
- body { text-align: center;}
5
- h1 { font-size: 50px; text-align: center }
6
- span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
7
- body { font: 20px Constantia, 'Hoefler Text', "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
8
- ::-moz-selection{ background:#FF5E99; color:#fff; }
9
- ::selection { background:#FF5E99; color:#fff; }
10
- article {display:block; text-align: left; width: 500px; margin: 0 auto; }
11
-
12
- a { color: rgb(36, 109, 56); text-decoration:none; }
13
- a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
14
- </style>
15
-
16
- <article>
17
- <h1>Not found <span frown>:(</span></h1>
18
- <div>
19
- <p>Sorry, but the page you were trying to view does not exist.</p>
20
- <p>It looks like this was the result of either:</p>
21
- <ul>
22
- <li>a mistyped address</li>
23
- <li>an out-of-date link</li>
24
- </ul>
25
- </div>
26
-
27
- <script>
28
- var GOOG_FIXURL_LANG = (navigator.language || '').slice(0,2),
29
- GOOG_FIXURL_SITE = location.host;
30
- </script>
31
- <script src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>
32
- </article>
data/www/crossdomain.xml DELETED
@@ -1,25 +0,0 @@
1
- <?xml version="1.0"?>
2
- <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
3
- <cross-domain-policy>
4
-
5
-
6
- <!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
7
-
8
- <!-- Most restrictive policy: -->
9
- <site-control permitted-cross-domain-policies="none"/>
10
-
11
-
12
-
13
- <!-- Least restrictive policy: -->
14
- <!--
15
- <site-control permitted-cross-domain-policies="all"/>
16
- <allow-access-from domain="*" to-ports="*" secure="false"/>
17
- <allow-http-request-headers-from domain="*" headers="*" secure="false"/>
18
- -->
19
- <!--
20
- If you host a crossdomain.xml file with allow-access-from domain=“*”
21
- and don’t understand all of the points described here, you probably
22
- have a nasty security vulnerability. ~ simon willison
23
- -->
24
-
25
- </cross-domain-policy>
data/www/favicon.ico DELETED
Binary file
data/www/index.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- ob_start('ob_gzhandler');
4
- define('DIR_WEB', dirname(__FILE__));
5
- define('DIR_PHPLIB', dirname(__FILE__).'/lib/php');
6
- define('DIR_SYS', DIR_PHPLIB.'/system');
7
- define('DIR_CTRL', DIR_PHPLIB.'/controller');
8
- define('DIR_MDL', DIR_PHPLIB.'/model');
9
- define('DIR_TMPL', DIR_PHPLIB.'/template');
10
- define('DIR_VIEW', DIR_PHPLIB.'/view');
11
- define('DIR_PLUGINS', DIR_PHPLIB.'/plugins');
12
-
13
- require_once DIR_PHPLIB.'/app.php';
14
-
15
- $app = new App();
16
-
17
- ?>
@@ -1,43 +0,0 @@
1
- /*! homePage class
2
- * Put javascript plugin depedencies below (see main.js for an exmaple)
3
- *
4
- */
5
- var CHANGE_ME = CHANGE_ME || {};
6
- CHANGE_ME.homePage = function(){
7
- // =================================================
8
- // = Private variables (example: var _foo = bar; ) =
9
- // =================================================
10
-
11
-
12
-
13
- // =================================================
14
- // = public functions =
15
- // =================================================
16
- var self = {
17
-
18
- init : function(){
19
-
20
- debug.group("# [homePage.js]");
21
-
22
- debug.log('- initialized');
23
-
24
- //--> sof private functions
25
-
26
- //--> eof private functions
27
-
28
- debug.groupEnd();
29
-
30
- }
31
-
32
- };
33
-
34
- return self;
35
-
36
- // ================================================
37
- // = Private functionse (function _private() {} ) =
38
- // ================================================
39
-
40
- }();
41
- //CHANGE_ME.main.queue(CHANGE_ME.homePage.init);
42
-
43
-
@@ -1,809 +0,0 @@
1
- /*!*
2
- * @author samuelme
3
- * JQbook v1.0 - http://samcreate.com/
4
- *
5
- * JQbook is (c) 2007 Aaron McGuire and is released under the MIT License:
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
-
9
- /*
10
- Class: JQbook
11
- Manages most basic retrieval of information from facebook.
12
-
13
- Requires:
14
-
15
- jquery: <http://docs.jquery.com/Downloading_jQuery>
16
-
17
- Facebook API: <http://connect.facebook.net/en_US/all.js>
18
-
19
- <div id="fb-root"></div>
20
-
21
-
22
- Quick Example:
23
-
24
- (start code)
25
- $(document).ready(function() {
26
-
27
- $("#fb-root").bind(JQbook.events.CONNECTION_READY, _ready);
28
-
29
- JQbook.init({appID:"APPLICATION_ID_NUMBER"});
30
-
31
- JQbook.login();
32
-
33
-
34
- });
35
-
36
- function _ready(p_evt,p_response){
37
-
38
- if (p_response.session){
39
-
40
- //logged in
41
-
42
- }else{
43
-
44
- //error
45
-
46
- }
47
- }
48
-
49
- (end)
50
-
51
-
52
-
53
- */
54
-
55
- var JQbook = function(){
56
-
57
- var _user_name = "",_user_id = "",logged_in = false, _opts = "";
58
-
59
-
60
- return {
61
-
62
- /*
63
- Events: JQbook.events
64
-
65
-
66
- JQbook.events.USER_NOT_LOGGED_IN - User is not loggedin.
67
- JQbook.events.CONNECTION_READY - Facebook is_connected and readys.
68
- JQbook.events.CONNECTION_READY_PERMISSIONS_NONE - Causes the counter to only increment in even numbers.
69
- JQbook.events.CONNECTION_FAILED - User authentication failed.
70
- JQbook.events.ON_USERINFO_FOUND - User data recieved.
71
- JQbook.events.ON_USERINFO_NOTFOUND - User data not found.
72
- JQbook.events.ON_WALLINFO_FOUND - User_wall data found.
73
- JQbook.events.ON_WALLINFO_NOTFOUND - User wall data not found.
74
- JQbook.events.ON_LIKESINFO_FOUND - User likes data found.
75
- JQbook.events.ON_LIKESINFO_NOT_FOUND - User likes data_not found.
76
- JQbook.events.ON_MOVIESINFO_FOUND - User movies data found.
77
- JQbook.events.ON_MOVIESINFO_NOT_FOUND - User movies data not found.
78
- JQbook.events.ON_NOTESINFO_FOUND - User notes data found.
79
- JQbook.events.ON_NOTESINFO_NOT_FOUND - User notes data not found.
80
- JQbook.events.ON_GROUPSINFO_FOUND - User groups data found.
81
- JQbook.events.ON_GROUPSINFO_NOT_FOUND - User groups data not found.
82
- JQbook.events.ON_IMAGESINFO_FOUND - User images data found.
83
- JQbook.events.ON_STREAM_PUBLISH_SUCCESS - STREAM PUBLISH SUCCEEDED.
84
- JQbook.events.ON_STREAM_PUBLISH_FAILED - STREAM PUBLISH FAILED.
85
-
86
- Example:
87
-
88
- > Listen to events on $("#fb-root")
89
- >
90
- >
91
- > $("#fb-root").bind(JQbook.events.CONNECTION_READY, _ready_handler);
92
- >
93
-
94
-
95
- */
96
-
97
- events : {
98
-
99
- USER_NOT_LOGGED_IN:"User_is_not_loggedin",
100
- CONNECTION_READY:"Facebook_is_connected_and_ready",
101
- CONNECTION_READY_PERMISSIONS_NONE:"User_connected_but_did_not_allow_the_extended_permissions_you_requested",
102
- CONNECTION_FAILED:"User_authentication_failed",
103
- ON_USERINFO_FOUND:"User_data_recieved",
104
- ON_USERINFO_NOTFOUND:"User_data_not_found",
105
- ON_WALLINFO_FOUND:"User_wall_data_found",
106
- ON_WALLINFO_NOTFOUND:"User_wall_data_not_found",
107
- ON_LIKESINFO_FOUND:"User_likes_data_found",
108
- ON_LIKESINFO_NOT_FOUND:"User_likes_data_not_found",
109
- ON_MOVIESINFO_FOUND:"User_movies_data_found",
110
- ON_MOVIESINFO_NOT_FOUND:"User_movies_data_not_found",
111
- ON_NOTESINFO_FOUND:"User_notes_data_found",
112
- ON_NOTESINFO_NOT_FOUND:"User_notes_data_not_found",
113
- ON_GROUPSINFO_FOUND:"User_groups_data_found",
114
- ON_GROUPSINFO_NOT_FOUND:"User_groups_data_not_found",
115
- ON_IMAGESINFO_FOUND:"User_images_data_found",
116
- ON_STREAM_PUBLISH_SUCCESS:"STREAM_PUBLISH_SUCCEEDED",
117
- ON_STREAM_PUBLISH_FAILED:"STREAM_PUBLISH_FAILED"
118
-
119
- },
120
- /*
121
- Object: JQbook.defaults
122
-
123
- appID, permissions
124
-
125
- *appID:* 'APPLICATION_ID_NUMBER'
126
- >
127
- *permissions:* 'email,publish_stream,read_stream,user_groups,user_notes,user_birthday'
128
-
129
- Example:
130
- >JQbook.defaults = { appID: 'APPLICATION_ID_NUMBER', permissions: 'email,publish_stream,read_stream,user_groups,user_notes,user_birthday' }
131
-
132
- */
133
- defaults : {
134
-
135
- appID: '',
136
- permissions: 'email,publish_stream,read_stream,user_groups,user_notes,user_birthday'
137
-
138
- },
139
-
140
- options : function(opts){
141
-
142
- if(opts == undefined || opts == "") opts = {};
143
-
144
- return $.extend({}, JQbook.defaults, opts);
145
- },
146
- /*
147
- Function: JQbook.init
148
-
149
- Initialize the facebook API library.
150
-
151
- Parameters:
152
-
153
- opts:object {appID: 'APPLICATION_ID_NUMBER', permissions: 'email,publish_stream,read_stream,user_groups,user_notes,user_birthday'}.
154
-
155
-
156
- Returns:
157
-
158
- Nothing.
159
-
160
- Example:
161
-
162
- (start code)
163
- JQbook.init({appID:"APPLICATION_ID_NUMBER"});
164
- (end)
165
-
166
-
167
-
168
- */
169
-
170
- init : function(opts){
171
-
172
-
173
-
174
- try{
175
-
176
- JQbook.defaults.permissions = opts.permissions != null ? opts.permissions : JQbook.defaults.permissions;
177
-
178
- JQbook.defaults.permissions = JQbook.defaults.permissions == '' ? null : JQbook.defaults.permissions;
179
-
180
- FB.init({appId: JQbook.options(opts).appID, status: true, cookie: true, xfbml: true});
181
-
182
- JQbook.loginStatus();
183
-
184
- }catch(e){
185
-
186
- _opts = opts;
187
-
188
- var t = setTimeout(function(){JQbook.init(_opts);},1000);
189
-
190
- }
191
-
192
- },
193
- /*
194
- Function: JQbook.loginStatus
195
-
196
- Check if the user is logged in
197
-
198
- Parameters:
199
-
200
- p_callback:function - function called after facebook login status is true or false. If login status is true, the function will return an object with the user's id
201
- if the status is false it returns false.
202
-
203
-
204
- Returns:
205
-
206
- Nothing.
207
-
208
- Example:
209
-
210
- (start code)
211
- JQbook.loginStatus();
212
- (end)
213
-
214
-
215
-
216
- */
217
- loginStatus : function(p_callback){
218
-
219
- FB.getLoginStatus(function(response){
220
-
221
- if (response.session){
222
-
223
- logged_in = true;
224
-
225
- JQbook.uid(response.session.uid);
226
-
227
- $("#fb-root").trigger(JQbook.events.CONNECTION_READY, [ {uid:response.session.uid} ]);
228
-
229
- _callback(p_callback,response);
230
-
231
- }
232
- });
233
-
234
- },
235
- /*
236
- Function: JQbook.login
237
-
238
- Logges the user into the facebook API. Login/Authorize/Permissions.
239
-
240
- Parameters:
241
-
242
- p_callback:function - function called after facebook login status is true or false. If login status is true, the function will return an object with the user's id
243
- if the status is false it returns false.
244
-
245
-
246
- Returns:
247
-
248
- Nothing.
249
-
250
- Example:
251
-
252
- (start code)
253
- JQbook.login();
254
- (end)
255
-
256
-
257
-
258
- */
259
- login : function (p_callback){
260
-
261
- FB.getLoginStatus(function(response){
262
-
263
- if (response.session){
264
-
265
- logged_in = true;
266
-
267
- JQbook.uid(response.session.uid);
268
-
269
- $("#fb-root").trigger(JQbook.events.CONNECTION_READY, [ {uid:response.session.uid} ]);
270
-
271
- _callback(p_callback,response);
272
-
273
- }else{
274
-
275
- FB.login(function(response) {
276
-
277
- if (response.session) {
278
-
279
- if (response.perms) {
280
- // Note: You can also check for specific extended permissions allowed if you need to here
281
- logged_in = true;
282
- JQbook.uid(response.session.uid);
283
- $("#fb-root").trigger(JQbook.events.CONNECTION_READY, [ {uid:response.session.uid} ]);
284
- _callback(p_callback,response);
285
-
286
- }else{
287
- logged_in = true;
288
- JQbook.uid(response.session.uid);
289
- $("#fb-root").trigger(JQbook.events.CONNECTION_READY_PERMISSIONS_NONE);
290
- _callback(p_callback,JQbook.events.CONNECTION_READY_PERMISSIONS_NONE);
291
- }
292
-
293
- } else {
294
-
295
- $("#fb-root").trigger(JQbook.events.CONNECTION_FAILED);
296
- _callback(p_callback,false);
297
-
298
- }},{perms:JQbook.options().permissions}
299
- );
300
- }
301
- });
302
-
303
- },
304
- /*
305
- Function: JQbook.userInfo
306
- Returns users info
307
-
308
-
309
-
310
- -About.
311
- -birthday (check special permissions).
312
- -email (check special permissions).
313
- -first_name.
314
- -gender.
315
- -hometown.
316
- -id.
317
- -last_name.
318
- -link.
319
- -middle_name.
320
- -name.
321
- -timesone.
322
- -updataed_time.
323
- -verified.
324
-
325
- Parameters:
326
-
327
- p_callback:function - function called after facebook returns user info as an Object
328
-
329
-
330
- Returns:
331
-
332
- Nothing.
333
-
334
- Example:
335
-
336
- (start code)
337
- JQbook.userInfo();
338
- (end)
339
-
340
-
341
-
342
- */
343
- userInfo : function(p_callback){
344
-
345
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
346
-
347
- FB.api('/me', function(response){
348
- if(!response || response.error){
349
- // Facebook error getting the user's info
350
- $("#fb-root").trigger(JQbook.events.ON_USERINFO_NOTFOUND);
351
- _callback(p_callback,false);
352
- return(false);
353
- }
354
-
355
- $("#fb-root").trigger(JQbook.events.ON_USERINFO_FOUND, [ response ]);
356
-
357
- _callback(p_callback,response);
358
-
359
- JQbook.name(response.name);
360
-
361
- JQbook.uid(response.id);
362
-
363
- });
364
-
365
- },
366
- /*
367
- Function: JQbook.userWall
368
-
369
- Queries facebook for the users wallposts
370
-
371
- Parameters:
372
- p_limit_amount:Number - limit the amount of posts we return.
373
- p_callback:function - function called after facebook returns users wall posts as an Object
374
-
375
-
376
- Returns:
377
-
378
- Nothing.
379
-
380
- Example:
381
-
382
- (start code)
383
- JQbook.userWall();
384
- (end)
385
-
386
- See Also:
387
- <JQbook.defaults>
388
-
389
-
390
-
391
- */
392
- userWall : function(p_limit_amount,p_callback){
393
-
394
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
395
-
396
- if(p_limit_amount == null || p_limit_amount == ""){
397
-
398
- p_limit_amount = 50;
399
-
400
- }
401
-
402
- FB.api(
403
- {
404
- method: 'fql.query',
405
- query: 'SELECT actor_id, message FROM stream WHERE source_id = '+JQbook.uid()+' limit '+p_limit_amount
406
- },
407
- function(response) {
408
-
409
- $("#fb-root").trigger(JQbook.events.ON_WALLINFO_FOUND, [ response ]);
410
- _callback(p_callback,response);
411
-
412
- }
413
- );
414
- },
415
- /*
416
- Function: JQbook.userLikes
417
-
418
- Queries facebook for the users Likes
419
-
420
- Parameters:
421
- p_callback:function - function called after facebook returns users likes as an Object. If nothing is recieved, it returns false.
422
-
423
-
424
- Returns:
425
-
426
- Nothing.
427
-
428
- Example:
429
-
430
- (start code)
431
- JQbook.userLikes();
432
- (end)
433
-
434
- See Also:
435
- <JQbook.defaults>
436
-
437
- */
438
- userLikes : function(p_callback){
439
-
440
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
441
-
442
- FB.api('/'+JQbook.uid()+'/likes', function(response){
443
- if(!response || response.error){
444
-
445
- $("#fb-root").trigger(JQbook.events.ON_LIKESINFO_NOT_FOUND);
446
- _callback(p_callback, false);
447
- return(false);
448
- }
449
-
450
-
451
- $("#fb-root").trigger(JQbook.events.ON_LIKESINFO_FOUND, [ response.data ]);
452
- _callback(p_callback, response.data);
453
-
454
-
455
- });
456
- },
457
- /*
458
- Function: JQbook.userMovies
459
-
460
- Queries facebook for the users movies
461
-
462
- Parameters:
463
- p_callback:function - function called after facebook returns users movies as an Object. If nothing is recieved, it returns false.
464
-
465
-
466
- Returns:
467
-
468
- Nothing.
469
-
470
- Example:
471
-
472
- (start code)
473
- JQbook.userMovies();
474
- (end)
475
-
476
- See Also:
477
- <JQbook.defaults>
478
-
479
-
480
- */
481
- userMovies : function(p_callback){
482
-
483
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
484
-
485
- FB.api('/'+JQbook.uid()+'/movies', function(response){
486
- if(!response || response.error){
487
-
488
- $("#fb-root").trigger(JQbook.events.ON_MOVIESINFO_NOT_FOUND);
489
- _callback(p_callback, false);
490
- return(false);
491
- }
492
-
493
-
494
- $("#fb-root").trigger(JQbook.events.ON_MOVIESINFO_FOUND, [ response.data ]);
495
- _callback(p_callback, response.data);
496
-
497
- });
498
- },
499
- /*
500
- Function: JQbook.userNotes
501
-
502
- Queries facebook for the users notes
503
-
504
- Parameters:
505
- p_callback:function - function called after facebook returns users notes as an Object. If nothing is recieved, it returns false.
506
-
507
-
508
- Returns:
509
-
510
- Nothing.
511
-
512
- Example:
513
-
514
- (start code)
515
- JQbook.userNotes();
516
- (end)
517
-
518
- See Also:
519
- <JQbook.defaults>
520
-
521
-
522
- */
523
- userNotes : function(p_callback){
524
-
525
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
526
-
527
- FB.api('/'+JQbook.uid()+'/notes', function(response){
528
- if(!response || response.error){
529
-
530
- $("#fb-root").trigger(JQbook.events.ON_NOTESINFO_NOT_FOUND);
531
- _callback(p_callback, false);
532
- return(false);
533
- }
534
-
535
-
536
- $("#fb-root").trigger(JQbook.events.ON_NOTESINFO_FOUND, [ response.data ]);
537
- _callback(p_callback, response.data);
538
-
539
- });
540
- },
541
- /*
542
- Function: JQbook.userGroups
543
-
544
- Queries facebook for the users groups
545
-
546
- Parameters:
547
- p_callback:function - function called after facebook returns users groups as an Object. If nothing is recieved, it returns false.
548
-
549
-
550
- Returns:
551
-
552
- Nothing.
553
-
554
- Example:
555
-
556
- (start code)
557
- JQbook.userGroups();
558
- (end)
559
-
560
- See Also:
561
- <JQbook.defaults>
562
-
563
-
564
- */
565
- userGroups : function(p_callback){
566
-
567
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
568
-
569
- FB.api('/'+JQbook.uid()+'/groups', function(response){
570
- if(!response || response.error){
571
-
572
- $("#fb-root").trigger(JQbook.events.ON_GROUPSINFO_NOT_FOUND);
573
- _callback(p_callback, false);
574
- return(false);
575
- }
576
-
577
-
578
- $("#fb-root").trigger(JQbook.events.ON_GROUPSINFO_FOUND, [ response.data ]);
579
- _callback(p_callback, response.data);
580
-
581
- });
582
- },
583
- /*
584
- Function: JQbook.userProfileIMGS
585
-
586
- Queries facebook for the users profile images(s). Recieves the user's profile image in 3 different sizes *(pic, pic_big, pic_square)*
587
-
588
- Parameters:
589
- p_callback:function - function called after facebook returns users images as an Object. If nothing is recieved, it returns false.
590
-
591
-
592
- Returns:
593
-
594
- Nothing.
595
-
596
- Example:
597
-
598
- (start code)
599
- JQbook.userProfileIMGS();
600
- (end)
601
-
602
- See Also:
603
- <JQbook.defaults>
604
-
605
-
606
- */
607
- userProfileIMGS : function(p_callback){
608
-
609
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
610
-
611
- FB.api(
612
- {
613
- method: 'fql.query',
614
- query: 'SELECT pic, pic_square,pic_big FROM profile WHERE id = '+JQbook.uid()
615
- },
616
- function(response) {
617
-
618
- $("#fb-root").trigger(JQbook.events.ON_IMAGESINFO_FOUND, [ response ]);
619
- _callback(p_callback,response);
620
-
621
- }
622
- );
623
- },
624
- /*
625
- Function: JQbook.streamPublish
626
-
627
- Publishes a post on the user's stream.
628
-
629
- Parameters:
630
- p_name:String - name of post.
631
- p_description:String - description on post.
632
- p_img:String - location of image.
633
- p_hrefTitle:String - link title.
634
- p_hrefLink:String - actual link.
635
- p_userPrompt:String - prompt, actually not sure what this does??
636
- p_display:String - put null to popup as modal, or put 'popup' to force a popup window. Defaults to iframe.
637
- p_callback:function - function called after facebook returns users images as an Object. If nothing is recieved, it returns false.
638
-
639
-
640
- Returns:
641
-
642
- Nothing.
643
-
644
- Example:
645
-
646
- (start code)
647
- JQbook.streamPublish("Samcreate", "Aaron McGuire's portfolio","http://samcreate.com/2010/portimages/5408matches.thumb2.jpg","www.samcreate.com","http://www.samcreate.com/",'user prompt!');
648
- (end)
649
-
650
- See Also:
651
- <JQbook.defaults>
652
-
653
-
654
- */
655
- streamPublish: function(p_name, p_description, p_img, p_hrefTitle, p_hrefLink, p_userPrompt,p_display,p_callback){
656
-
657
- if(logged_in ==false) { JQbook.debug(JQbook.events.USER_NOT_LOGGED_IN); return;}
658
-
659
- FB.ui(
660
- {
661
- method: 'stream.publish',
662
- message: '',
663
- display: p_display,
664
- attachment: {
665
- name: p_name,
666
- caption: '',
667
- description: (p_description),
668
- href: p_hrefLink,
669
- media: [
670
- {
671
- 'type': 'image',
672
- 'src': p_img,
673
- 'href': p_hrefLink
674
- }
675
- ]
676
- },
677
- action_links: [
678
- { text: p_hrefTitle, href: p_hrefLink }
679
- ],
680
- user_prompt_message: p_userPrompt
681
- },
682
- function(response) {
683
- if (response && response.post_id) {
684
- $("#fb-root").trigger(JQbook.events.ON_STREAM_PUBLISH_SUCCESS, [ response ]);
685
- _callback(p_callback,response);
686
- } else {
687
-
688
- $("#fb-root").trigger(JQbook.events.ON_STREAM_PUBLISH_FAILED);
689
- _callback(p_callback,false);
690
- }
691
- });
692
-
693
-
694
-
695
- },
696
- /*
697
- Function: JQbook.uid
698
-
699
- A getter/stetter function for the user's ID. This is automatically set if the user has logged in successfully, or if <JQbook.userInfo> is called.
700
-
701
- Parameters:
702
- p_uid:String - The user's ID
703
-
704
-
705
- Returns:
706
-
707
- The user's ID
708
-
709
- Example:
710
-
711
-
712
- >//get id
713
- >var id = JQbook.uid();
714
- >
715
- >//set id
716
- >JQbook.uid(127634763);
717
- See Also:
718
- <JQbook.userInfo>
719
-
720
-
721
- */
722
- uid : function(p_uid){
723
- if(p_uid == null || p_uid == ""){
724
-
725
- return _user_id;
726
-
727
- }else{
728
-
729
- _user_id = p_uid;
730
- }
731
- },
732
- /*
733
- Function: JQbook.name
734
-
735
- A getter/stetter function for the user's Name. This is automatically set if <JQbook.userInfo> is called.
736
-
737
- Parameters:
738
- p_name:String - The user's Name
739
-
740
-
741
- Returns:
742
-
743
- The user's Name
744
-
745
- Example:
746
-
747
-
748
- >//get id
749
- >var id = JQbook.name();
750
- >
751
- >//set id
752
- >JQbook.name("Aaron McGuire");
753
-
754
- See Also:
755
- <JQbook.userInfo>
756
-
757
-
758
- */
759
- name : function(p_name) {
760
- if(p_name === null || p_name === ""){
761
- return _user_name;
762
- }else{
763
- _user_name = p_name;
764
- }
765
- },
766
- /*
767
- Function: JQbook.debug
768
-
769
- If console.log is available, it will out put.
770
-
771
- Parameters:
772
- p_obj:* - Object to output.
773
-
774
-
775
- Returns:
776
-
777
- Nothing.
778
-
779
- Example:
780
-
781
- (start code)
782
- JQbook.login(function(response){
783
- JQbook.debug(response);
784
- });
785
- (end)
786
-
787
- See Also:
788
- <http://getfirebug.com/>
789
-
790
- */
791
- debug : function($p_obj){
792
- if (window.console && window.console.log)
793
- window.console.log($p_obj);
794
- }
795
- }
796
-
797
-
798
- function _callback(p_func,response){
799
-
800
- if(typeof p_func == "function"){
801
-
802
- p_func(response);
803
-
804
- }
805
-
806
- }
807
-
808
-
809
- }()