Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add testing code

  • Loading branch information...
commit 299acff9ef400fa256fbeedd9772a88d6d4a7f8c 1 parent f43b86d
Chris Nandor authored September 18, 2008
12  plugins/Ajax/htdocs/images/slash.sfnet.js
@@ -11,8 +11,9 @@ function $dom( id ) {
11 11
 
12 12
 (function($){
13 13
 
14  
-var isAuthenticated = /* check cookie */ true;
  14
+var kTesting = true;
15 15
 
  16
+var isAuthenticated = kTesting ? true : false;
16 17
 var kAuthenticated=true, kNotAuthenticated=false;
17 18
 
18 19
 var root_d2_selector = '#sd-d2-root';
@@ -99,6 +100,10 @@ function auth_call( fn, params ) {
99 100
 	// XXX this at some point may need to be context-dependent
100 101
 	params.group_id = $('span.sd-key-group-id').text();
101 102
 
  103
+	if (kTesting) {
  104
+		fn(kAuthenticated);
  105
+	}
  106
+
102 107
 	get_token(function( token_text ) {
103 108
 		$.ajax({
104 109
 			//url:     '/slashdot/auth.pl',
@@ -129,6 +134,11 @@ function get_token( fn, params ) {
129 134
 		return;
130 135
 	}
131 136
 
  137
+	if (kTesting) {
  138
+		fn();
  139
+		return;
  140
+	}
  141
+
132 142
 	$.ajax({
133 143
 		url:      'XXX', // XXX!
134 144
 		type:     'POST',

0 notes on commit 299acff

Please sign in to comment.
Something went wrong with that request. Please try again.