my-simon 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.document +5 -0
  2. data/.gitignore.orig +55 -0
  3. data/DOC/Launch Check List.docx +0 -0
  4. data/DOC/Launch Check List.pdf +0 -0
  5. data/Gemfile +14 -0
  6. data/Gemfile.lock +44 -0
  7. data/LICENSE.txt +20 -0
  8. data/README.md +21 -0
  9. data/README.rdoc +19 -0
  10. data/Rakefile +46 -0
  11. data/VERSION +1 -0
  12. data/build/rakefile.rb +12 -0
  13. data/config.rb +24 -0
  14. data/lib/simon.rb +0 -5
  15. data/my-simon.gemspec +141 -0
  16. data/scaffolding/simon/controller.tpl +9 -0
  17. data/scaffolding/simon/model.tpl +10 -0
  18. data/scaffolding/simon/view.tpl +5 -0
  19. data/scaffolding/standards/html_template.html +44 -0
  20. data/scaffolding/standards/html_template.php +44 -0
  21. data/scaffolding/standards/jquery_plugin_template.js +45 -0
  22. data/scaffolding/standards/js_template.js +43 -0
  23. data/simon +282 -0
  24. data/test/helper.rb +18 -0
  25. data/test/test_simon.rb +7 -0
  26. data/www/.htaccess +488 -0
  27. data/www/404.html +32 -0
  28. data/www/crossdomain.xml +25 -0
  29. data/www/favicon.ico +0 -0
  30. data/www/index.php +17 -0
  31. data/www/lib/js/homePage.js +43 -0
  32. data/www/lib/js/jquery/JQbook.js +809 -0
  33. data/www/lib/js/jquery/jquery-1.8.0.min.js +27 -0
  34. data/www/lib/js/jquery/jquery.alphanumeric.js +82 -0
  35. data/www/lib/js/jquery/jquery.cookie.js +96 -0
  36. data/www/lib/js/jquery/jquery.easing.1.3.js +207 -0
  37. data/www/lib/js/main.js +117 -0
  38. data/www/lib/js/master.js +6 -0
  39. data/www/lib/js/plugins/handlebars-1.0.rc.1.js +1920 -0
  40. data/www/lib/js/plugins/modernizr-1.7.min.js +2 -0
  41. data/www/lib/js/plugins/swfobject.js +777 -0
  42. data/www/lib/js/plugins_mod/README.txt +3 -0
  43. data/www/lib/php/app.php +53 -0
  44. data/www/lib/php/controller/index.php +10 -0
  45. data/www/lib/php/controller/regex.php +23 -0
  46. data/www/lib/php/model/Book.php +8 -0
  47. data/www/lib/php/model/Model.php +8 -0
  48. data/www/lib/php/plugins/php-activerecord/ActiveRecord.php +44 -0
  49. data/www/lib/php/plugins/php-activerecord/lib/CallBack.php +226 -0
  50. data/www/lib/php/plugins/php-activerecord/lib/Column.php +155 -0
  51. data/www/lib/php/plugins/php-activerecord/lib/Config.php +288 -0
  52. data/www/lib/php/plugins/php-activerecord/lib/Connection.php +456 -0
  53. data/www/lib/php/plugins/php-activerecord/lib/ConnectionManager.php +38 -0
  54. data/www/lib/php/plugins/php-activerecord/lib/DateTime.php +45 -0
  55. data/www/lib/php/plugins/php-activerecord/lib/Exceptions.php +137 -0
  56. data/www/lib/php/plugins/php-activerecord/lib/Expressions.php +183 -0
  57. data/www/lib/php/plugins/php-activerecord/lib/Inflector.php +115 -0
  58. data/www/lib/php/plugins/php-activerecord/lib/Model.php +1673 -0
  59. data/www/lib/php/plugins/php-activerecord/lib/Reflections.php +86 -0
  60. data/www/lib/php/plugins/php-activerecord/lib/Relationship.php +637 -0
  61. data/www/lib/php/plugins/php-activerecord/lib/SQLBuilder.php +396 -0
  62. data/www/lib/php/plugins/php-activerecord/lib/Serialization.php +302 -0
  63. data/www/lib/php/plugins/php-activerecord/lib/Singleton.php +57 -0
  64. data/www/lib/php/plugins/php-activerecord/lib/Table.php +547 -0
  65. data/www/lib/php/plugins/php-activerecord/lib/Utils.php +351 -0
  66. data/www/lib/php/plugins/php-activerecord/lib/Validations.php +833 -0
  67. data/www/lib/php/plugins/php-activerecord/lib/adapters/MysqlAdapter.php +73 -0
  68. data/www/lib/php/plugins/php-activerecord/lib/adapters/OciAdapter.php +121 -0
  69. data/www/lib/php/plugins/php-activerecord/lib/adapters/PgsqlAdapter.php +104 -0
  70. data/www/lib/php/plugins/php-activerecord/lib/adapters/SqliteAdapter.php +81 -0
  71. data/www/lib/php/system/Config.php +174 -0
  72. data/www/lib/php/system/config.routes.php +29 -0
  73. data/www/lib/php/system/router.php +220 -0
  74. data/www/lib/php/template/footer.php +59 -0
  75. data/www/lib/php/template/header.php +74 -0
  76. data/www/lib/php/view/index.php +5 -0
  77. data/www/media/images/facebook_share.jpg +0 -0
  78. data/www/robots.txt +5 -0
  79. data/www/sandbox/readme.txt +3 -0
  80. data/www/sass/javascript.scss +1 -0
  81. data/www/sass/layout.scss +128 -0
  82. data/www/sass/master.scss +4 -0
  83. data/www/sass/reset.scss +47 -0
  84. data/www/sass/typography.scss +24 -0
  85. data/www/styles/javascript.css +1 -0
  86. data/www/styles/layout.css +186 -0
  87. data/www/styles/master.css +4 -0
  88. data/www/styles/reset.css +60 -0
  89. data/www/styles/typography.css +24 -0
  90. metadata +179 -7
@@ -0,0 +1,809 @@
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
+ }()