Permalink
Browse files

Cleanup file names and the like

  • Loading branch information...
1 parent 4041b85 commit e9cef3b15528431f623671e16475600afbadf948 Dave Johnson committed Jul 21, 2011
View
@@ -3,7 +3,7 @@ Facebook Connect PhoneGap Plugin
Offical plugin for Facebook Connect.
-This is all licensed under MIT except for app/www/facebook.js which is the Facebook JS SDK and is Apache 2.0.
+This is all licensed under MIT except for app/www/facebook_js_sdk.js which is the Facebook JS SDK and is Apache 2.0.
Android (OS X)
-----------
View
@@ -3,9 +3,9 @@
<!-- phonegap -->
<script src="phonegap-0.9.6.js"></script>
<!-- phonegap facebook plugin -->
- <script src="pg-plugin-facebook-connect.js"></script>
+ <script src="pg-plugin-fb-connect.js"></script>
<!-- facebook js sdk -->
- <script src="facebook.js"></script>
+ <script src="facebook_js_sdk.js"></script>
</head>
<body>
<button onclick="init()">Init</button>
@@ -21,54 +21,54 @@
<script>
FB.Event.subscribe('auth.login', function(response) {
- writeLog('auth.login event');
- });
+ alert('auth.login event');
+ });
FB.Event.subscribe('auth.logout', function(response) {
- writeLog('auth.logout event');
- });
+ alert('auth.logout event');
+ });
FB.Event.subscribe('auth.sessionChange', function(response) {
- writeLog('auth.sessionChange event');
- });
+ alert('auth.sessionChange event');
+ });
FB.Event.subscribe('auth.statusChange', function(response) {
- writeLog('auth.statusChange event');
- });
+ alert('auth.statusChange event');
+ });
function getSession() {
alert(JSON.stringify(FB.getSession()));
}
function getLoginStatus() {
FB.getLoginStatus(function(response) {
- if (response.session) {
- alert('logged in');
- } else {
- alert('not logged in');
- }
- });
+ if (response.session) {
+ alert('logged in');
+ } else {
+ alert('not logged in');
+ }
+ });
}
function me() {
FB.api('/me/friends', function(response) {
- alert(JSON.stringify(response));
- });
+ alert(JSON.stringify(response));
+ });
}
function logout() {
FB.logout(function(response) {
- alert('logged out');
- });
+ alert('logged out');
+ });
}
function login() {
- FB.login(
- function(e) {
- alert(e);
- },
- { perms: "email" }
- );
+ FB.login(
+ function(e) {
+ alert(e);
+ },
+ { perms: "email" }
+ );
}
function init() {
@@ -80,8 +80,8 @@
}
document.addEventListener('deviceready', function() {
- navigator.app.addService("com.facebook.phonegap.Connect", "com.facebook.phonegap.ConnectPlugin");
- }, false);
+ navigator.app.addService("com.facebook.phonegap.Connect", "com.facebook.phonegap.ConnectPlugin");
+ }, false);
</script>
<div id="log"></div>
</body>
@@ -1,24 +0,0 @@
-PG = ( typeof PG == 'undefined' ? {} : PG );
-PG.FB = {
-init: function(apiKey) {
- PhoneGap.exec(null, null, 'com.facebook.phonegap.Connect', 'init', [apiKey]);
-},
-login: function(a, b) {
- b = b || { perms: '' };
- PhoneGap.exec(function(e) { // login
- FB.Auth.setSession(e.session, 'connected');
- if (a) a(e);
- }, null, 'com.facebook.phonegap.Connect', 'login', b.perms.split(',') );
-},
-logout: function(cb) {
- PhoneGap.exec(function(e) {
- FB.Auth.setSession(null, 'notConnected');
- if (cb) cb(e);
- }, null, 'com.facebook.phonegap.Connect', 'logout', []);
-},
-getLoginStatus: function(cb) {
- PhoneGap.exec(function(e) {
- if (cb) cb(e);
- }, null, 'com.facebook.phonegap.Connect', 'getLoginStatus', []);
-}
-};
File renamed without changes.
View
@@ -3,11 +3,9 @@
<!-- phonegap -->
<script src="phonegap-1.0.0rc1.min.js"></script>
<!-- phonegap facebook plugin -->
- <script src="facebook-connect-0.0.1.js"></script>
- <!-- weinre -->
- <script src="http://debug.phonegap.com/target/target-script-min.js#foobook"></script>
+ <script src="pg-plugin-fb-connect.js"></script>
<!-- facebook js sdk -->
- <script src="facebook.js"></script>
+ <script src="facebook_js_sdk.js"></script>
</head>
<body>
<button onclick="init()">Init</button>
@@ -21,96 +19,56 @@
<div id="fb-root"></div>
<script>
-
- ///////////////////////////////////////////////////////////////////////////
- // We write results to the DOM because of handleOpenURL restrictions
-
- var lastTime = null;
- function writeTimestamp()
- {
- var now = new Date().getTime();
- if (lastTime == null) {
- lastTime = new Date(now);
- }
-
- var elapsed = now - lastTime;
- if (elapsed > 10000 || elapsed == 0) {
- write("<hr />");
- writeln(new Date(now).toString());
- if (elapsed != 0) {
- lastTime = new Date(now);
- }
- }
- }
-
- function writeLog(str)
- {
- writeTimestamp();
- writeln(str);
- }
-
- function write(str)
- {
- var el = document.getElementById("log");
- el.innerHTML = el.innerHTML + str;
- el.scrollTop = el.scrollHeight;
- }
-
- function writeln(str)
- {
- write(str + '<br />');
- }
- ///////////////////////////////////////////////////////////////////////////
-
FB.Event.subscribe('auth.login', function(response) {
- writeLog('auth.login event');
- });
+ alert('auth.login event');
+ });
FB.Event.subscribe('auth.logout', function(response) {
- writeLog('auth.logout event');
- });
+ alert('auth.logout event');
+ });
FB.Event.subscribe('auth.sessionChange', function(response) {
- writeLog('auth.sessionChange event');
- });
+ alert('auth.sessionChange event');
+ });
FB.Event.subscribe('auth.statusChange', function(response) {
- writeLog('auth.statusChange event');
- });
+ alert('auth.statusChange event');
+ });
function getSession() {
alert(JSON.stringify(FB.getSession()));
}
function getLoginStatus() {
FB.getLoginStatus(function(response) {
- if (response.session) {
- alert('logged in');
- } else {
- alert('not logged in');
- }
- });
+ if (response.session) {
+ alert('logged in');
+ } else {
+ alert('not logged in');
+ }
+ });
}
function me() {
FB.api('/me/friends', function(response) {
- alert(JSON.stringify(response));
- });
+ alert(JSON.stringify(response));
+ });
}
function logout() {
FB.logout(function(response) {
- alert('logged out');
- });
+ alert('logged out');
+ });
}
function login() {
- FB.login(
- function(e) {
- },
- { perms: "email" }
- );
+ FB.login(
+ function(e) {
+ alert(e);
+ },
+ { perms: "email" }
+ );
}
function init() {
@@ -122,8 +80,8 @@
}
document.addEventListener('deviceready', function() {
- navigator.app.addService("com.facebook.phonegap.Connect", "com.facebook.phonegap.ConnectPlugin");
- }, false);
+ navigator.app.addService("com.facebook.phonegap.Connect", "com.facebook.phonegap.ConnectPlugin");
+ }, false);
</script>
<div id="log"></div>
</body>
@@ -0,0 +1,24 @@
+PG = ( typeof PG == 'undefined' ? {} : PG );
+PG.FB = {
+ init: function(apiKey) {
+ PhoneGap.exec(null, null, 'com.facebook.phonegap.Connect', 'init', [apiKey]);
+ },
+ login: function(a, b) {
+ b = b || { perms: '' };
+ PhoneGap.exec(function(e) { // login
+ FB.Auth.setSession(e.session, 'connected');
+ if (a) a(e);
+ }, null, 'com.facebook.phonegap.Connect', 'login', b.perms.split(',') );
+ },
+ logout: function(cb) {
+ PhoneGap.exec(function(e) {
+ FB.Auth.setSession(null, 'notConnected');
+ if (cb) cb(e);
+ }, null, 'com.facebook.phonegap.Connect', 'logout', []);
+ },
+ getLoginStatus: function(cb) {
+ PhoneGap.exec(function(e) {
+ if (cb) cb(e);
+ }, null, 'com.facebook.phonegap.Connect', 'getLoginStatus', []);
+ }
+};

0 comments on commit e9cef3b

Please sign in to comment.