Permalink
Browse files

Remake of homepage with delayed loading of user data, fixing all over…

…lays and new token view function

. Closes #1
  • Loading branch information...
1 parent f6e0936 commit 1b4473ecaa89ede1777c39fd2680a491d164b338 @rdohms committed Jan 29, 2011
Showing with 2,179 additions and 69 deletions.
  1. +2 −0 .gitignore
  2. +190 −2 ftum.tmproj
  3. +43 −0 library/App/Action/AjaxUserinfoAction.php
  4. +16 −16 library/App/Action/ListAction.php
  5. +75 −0 library/App/JsonResponse.php
  6. +52 −0 public/css/fonts.css
  7. +2 −1 public/css/form.css
  8. +31 −17 public/css/site.css
  9. BIN public/favicon.ico
  10. +91 −0 public/fonts/SIL Open Font License 1.1.txt
  11. BIN public/fonts/TitilliumText22L001-webfont.eot
  12. +151 −0 public/fonts/TitilliumText22L001-webfont.svg
  13. BIN public/fonts/TitilliumText22L001-webfont.ttf
  14. BIN public/fonts/TitilliumText22L001-webfont.woff
  15. BIN public/fonts/TitilliumText22L002-webfont.eot
  16. +151 −0 public/fonts/TitilliumText22L002-webfont.svg
  17. BIN public/fonts/TitilliumText22L002-webfont.ttf
  18. BIN public/fonts/TitilliumText22L002-webfont.woff
  19. BIN public/fonts/TitilliumText22L003-webfont.eot
  20. +151 −0 public/fonts/TitilliumText22L003-webfont.svg
  21. BIN public/fonts/TitilliumText22L003-webfont.ttf
  22. BIN public/fonts/TitilliumText22L003-webfont.woff
  23. BIN public/fonts/TitilliumText22L004-webfont.eot
  24. +151 −0 public/fonts/TitilliumText22L004-webfont.svg
  25. BIN public/fonts/TitilliumText22L004-webfont.ttf
  26. BIN public/fonts/TitilliumText22L004-webfont.woff
  27. BIN public/fonts/TitilliumText22L005-webfont.eot
  28. +151 −0 public/fonts/TitilliumText22L005-webfont.svg
  29. BIN public/fonts/TitilliumText22L005-webfont.ttf
  30. BIN public/fonts/TitilliumText22L005-webfont.woff
  31. BIN public/fonts/TitilliumText22L006-webfont.eot
  32. +151 −0 public/fonts/TitilliumText22L006-webfont.svg
  33. BIN public/fonts/TitilliumText22L006-webfont.ttf
  34. BIN public/fonts/TitilliumText22L006-webfont.woff
  35. +58 −0 public/fonts/demo.html
  36. BIN public/images/bg.png
  37. BIN public/images/favicon.png
  38. BIN public/images/loading-small.gif
  39. BIN public/images/logo-48.png
  40. BIN public/images/logo-big.png
  41. BIN public/images/token.png
  42. +60 −15 public/js/cmds.js
  43. +482 −0 public/js/jquery.tmpl.js
  44. +10 −0 public/js/jquery.tmpl.min.js
  45. +99 −0 public/js/jquery.tmplPlus.js
  46. +11 −0 public/js/jquery.tmplPlus.min.js
  47. +20 −7 templates/layout.html
  48. +30 −10 templates/list.html
  49. +1 −1 templates/new.html
View
@@ -1,5 +1,7 @@
.DS_Store
+Icon?
.svn
+ftum.tmproj
config/config.ini.php
!config/config.ini.php.sample
View
@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>currentDocument</key>
+ <string>templates/about.html</string>
<key>documents</key>
<array>
<dict>
@@ -18,10 +20,196 @@
<key>fileHierarchyDrawerWidth</key>
<integer>193</integer>
<key>metaData</key>
- <dict/>
+ <dict>
+ <key>public/css/form.css</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>17</integer>
+ <key>line</key>
+ <integer>60</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>11</integer>
+ </dict>
+ <key>public/css/site.css</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>48</integer>
+ <key>line</key>
+ <integer>64</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>38</integer>
+ </dict>
+ <key>public/js/cmds.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>5</integer>
+ <key>line</key>
+ <integer>23</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>5</integer>
+ </dict>
+ <key>templates/about.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>46</integer>
+ <key>line</key>
+ <integer>20</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>templates/add_friend.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>26</integer>
+ <key>line</key>
+ <integer>6</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>templates/create.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>14</integer>
+ <key>line</key>
+ <integer>13</integer>
+ </dict>
+ <key>columnSelection</key>
+ <false/>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>0</integer>
+ <key>line</key>
+ <integer>0</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>14</integer>
+ <key>line</key>
+ <integer>13</integer>
+ </dict>
+ </dict>
+ <key>templates/error.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>21</integer>
+ <key>line</key>
+ <integer>4</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>templates/layout.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>17</integer>
+ <key>line</key>
+ <integer>36</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>1</integer>
+ </dict>
+ <key>templates/list.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>55</integer>
+ <key>line</key>
+ <integer>52</integer>
+ </dict>
+ <key>columnSelection</key>
+ <false/>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>24</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>52</integer>
+ <key>line</key>
+ <integer>52</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>60</integer>
+ <key>line</key>
+ <integer>52</integer>
+ </dict>
+ </dict>
+ <key>templates/new.html</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>24</integer>
+ <key>line</key>
+ <integer>6</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ </dict>
+ <key>openDocuments</key>
+ <array>
+ <string>templates/about.html</string>
+ <string>templates/list.html</string>
+ <string>public/js/cmds.js</string>
+ <string>templates/error.html</string>
+ <string>templates/layout.html</string>
+ <string>templates/create.html</string>
+ <string>templates/add_friend.html</string>
+ <string>public/css/site.css</string>
+ <string>public/css/form.css</string>
+ <string>templates/new.html</string>
+ </array>
<key>showFileHierarchyDrawer</key>
<true/>
<key>windowFrame</key>
- <string>{{203, 0}, {1477, 1028}}</string>
+ <string>{{603, 254}, {1077, 774}}</string>
</dict>
</plist>
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Action;
+
+class AjaxUserinfoAction extends Base
+{
+
+ public function run()
+ {
+
+ try{
+
+ //Get list of users
+ $fb = $this->getFacebookClient();
+
+ //Get Input Params
+ $uid = $this->getInspekt()->post->getInt('uid');
+ $token = $this->getInspekt()->post->getRaw('token');
+
+ //Get extra data
+ $fb->setAccessToken($token);
+ $details = $fb->api('/me');
+
+ //Get Available perms
+ $allPerms = $fb->fql('SELECT '.$fb->getFacebookPermissionList().' FROM permissions WHERE uid = "'.$uid.'"');
+ $perms = implode(', ', \array_keys(\array_filter(array_shift($allPerms))));
+ $details['perms'] = ($perms == '')? 'none defined':$perms;
+
+ $details['uid'] = $uid;
+ $details['access_token'] = $token;
+
+ } catch (\Exception $e) {
+ $this->redirectToError($e);
+ return;
+ }
+
+ $response = new \App\JsonResponse(200, null, $details);
+ $response->sendOutput();
+ }
+
+}
+
+?>
@@ -13,22 +13,22 @@ public function run()
$fb->setAccessToken(null);
$response = $fb->api('/'.$fb->getAppId().'/accounts/test-users');
$testUsers = (\array_key_exists('data', $response))? $response['data']:array();
-
- //Get extra data
- $users = array();
- foreach($testUsers as $user){
- $fb->setAccessToken($user['access_token']);
- $details = $fb->api('/me');
-
- //Get Available perms
- $allPerms = $fb->fql('SELECT '.$fb->getFacebookPermissionList().' FROM permissions WHERE uid = "'.$user['id'].'"');
- $user['perms'] = \array_filter(array_shift($allPerms));
-
-
- //Add to user list with full data
- $users[] = \array_merge($user, $details);
-
- }
+$users = $testUsers;
+// //Get extra data
+// $users = array();
+// foreach($testUsers as $user){
+// $fb->setAccessToken($user['access_token']);
+// //$details = $fb->api('/me');
+//
+// //Get Available perms
+// //$allPerms = $fb->fql('SELECT '.$fb->getFacebookPermissionList().' FROM permissions WHERE uid = "'.$user['id'].'"');
+// //$user['perms'] = \array_filter(array_shift($allPerms));
+//
+//
+// //Add to user list with full data
+// //$users[] = \array_merge($user, $details);
+//
+// }
} catch (\Exception $e) {
$this->redirectToError($e);
return;
@@ -0,0 +1,75 @@
+<?php
+namespace App;
+
+class JsonResponse
+{
+
+ protected $code;
+
+ protected $message;
+
+ protected $data;
+
+ public function __construct($code = null, $message = null, $data = null)
+ {
+ $this->setCode($code);
+ $this->setMessage($message);
+ $this->setData($data);
+ }
+
+ private function buildOutput()
+ {
+
+ $output = array();
+ $output['code'] = $this->getCode();
+ $output['message'] = $this->getMessage();
+ $output['data'] = $this->getData();
+
+ return \json_encode($output);
+ }
+
+ public function sendOutput()
+ {
+ echo $this->buildOutput();
+ }
+
+ public function getOutput()
+ {
+ return $this->buildOutput();
+ }
+
+ public function getCode()
+ {
+ return $this->code;
+ }
+
+ public function setCode($code)
+ {
+ $this->code = $code;
+ }
+
+ public function getMessage()
+ {
+ return $this->message;
+ }
+
+ public function setMessage($message)
+ {
+ $this->message = $message;
+ }
+
+ public function getData()
+ {
+ return $this->data;
+ }
+
+ public function setData($data)
+ {
+ $this->data = $data;
+ }
+
+
+
+}
+
+?>
Oops, something went wrong.

0 comments on commit 1b4473e

Please sign in to comment.