Permalink
Browse files

Add testing code

  • Loading branch information...
1 parent f43b86d commit 299acff9ef400fa256fbeedd9772a88d6d4a7f8c @pudge pudge committed Sep 19, 2008
Showing with 11 additions and 1 deletion.
  1. +11 −1 plugins/Ajax/htdocs/images/slash.sfnet.js
View
12 plugins/Ajax/htdocs/images/slash.sfnet.js
@@ -11,8 +11,9 @@ function $dom( id ) {
(function($){
-var isAuthenticated = /* check cookie */ true;
+var kTesting = true;
+var isAuthenticated = kTesting ? true : false;
var kAuthenticated=true, kNotAuthenticated=false;
var root_d2_selector = '#sd-d2-root';
@@ -99,6 +100,10 @@ function auth_call( fn, params ) {
// XXX this at some point may need to be context-dependent
params.group_id = $('span.sd-key-group-id').text();
+ if (kTesting) {
+ fn(kAuthenticated);
+ }
+
get_token(function( token_text ) {
$.ajax({
//url: '/slashdot/auth.pl',
@@ -129,6 +134,11 @@ function get_token( fn, params ) {
return;
}
+ if (kTesting) {
+ fn();
+ return;
+ }
+
$.ajax({
url: 'XXX', // XXX!
type: 'POST',

0 comments on commit 299acff

Please sign in to comment.