Skip to content

Commit 405723a

Browse files
committed
More tab->4sp (functions) (finished)
1 parent c339eca commit 405723a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+721
-721
lines changed

functions/language/require.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function require( filename ) {
3131
// BEGIN REDUNDANT
3232
this.php_js = this.php_js || {};
3333
// END REDUNDANT
34-
34+
3535
if (!this.php_js.includes) {
3636
this.php_js.includes = cur_file;
3737
}

functions/language/require_once.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ function require_once(filename) {
1212
cur_file[this.window.location.href] = 1;
1313

1414
// save include state for reference by include_once and require_once()
15-
// BEGIN REDUNDANT
15+
// BEGIN REDUNDANT
1616
php_js_shared = php_js_shared || {}; // We use a non-namespaced global here since we wish to share across all instances
1717
// END REDUNDANT
1818

1919
if (!php_js_shared.includes) {
20-
php_js_shared.includes = cur_file;
21-
}
20+
php_js_shared.includes = cur_file;
21+
}
2222
if (!php_js_shared.includes[filename]) {
2323
if (this.require(filename)) {
2424
return true;

functions/math/expm1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function expm1 (x) {
22
// http://kevin.vanzonneveld.net
33
// + original by: Brett Zamir (http://brettz9.blogspot.com)
4-
// % note 1: Precision 'n' can be adjusted as desired
4+
// % note 1: Precision 'n' can be adjusted as desired
55
// * example 1: expm1(1e-15);
66
// * returns 1: 1.0000000000000007e-15
77
var ret=0, n = 50; // degree of precision

functions/math/log1p.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function log1p (x) {
22
// http://kevin.vanzonneveld.net
33
// + original by: Brett Zamir (http://brettz9.blogspot.com)
4-
// % note 1: Precision 'n' can be adjusted as desired
4+
// % note 1: Precision 'n' can be adjusted as desired
55
// * example 1: log1p(1e-15);
66
// * returns 1: 9.999999999999995e-16
77

functions/math/rand.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function rand( min, max ) {
22
// http://kevin.vanzonneveld.net
33
// + original by: Leslie Hoare
44
// + bugfixed by: Onno Marsman
5-
// % note 1: See the commented out code below for a version which will work with our experimental (though probably unnecessary) srand() function)
5+
// % note 1: See the commented out code below for a version which will work with our experimental (though probably unnecessary) srand() function)
66
// * example 1: rand(1, 1);
77
// * returns 1: 1
88

@@ -18,35 +18,35 @@ function rand( min, max ) {
1818
/*
1919
// See note above for an explanation of the following alternative code
2020
21-
// + reimplemented by: Brett Zamir (http://brettz9.blogspot.com)
22-
// - depends on: srand
23-
// % note 1: This is a very possibly imperfect adaptation from the PHP source code
24-
var rand_seed, ctx, PHP_RAND_MAX=2147483647; // 0x7fffffff
21+
// + reimplemented by: Brett Zamir (http://brettz9.blogspot.com)
22+
// - depends on: srand
23+
// % note 1: This is a very possibly imperfect adaptation from the PHP source code
24+
var rand_seed, ctx, PHP_RAND_MAX=2147483647; // 0x7fffffff
2525
26-
if (!this.php_js || this.php_js.rand_seed === undefined) {
27-
this.srand();
28-
}
29-
rand_seed = this.php_js.rand_seed;
26+
if (!this.php_js || this.php_js.rand_seed === undefined) {
27+
this.srand();
28+
}
29+
rand_seed = this.php_js.rand_seed;
3030
31-
var argc = arguments.length;
31+
var argc = arguments.length;
3232
if (argc === 1) {
3333
throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
3434
}
3535
36-
var do_rand = function (ctx) {
37-
return ((ctx * 1103515245 + 12345) % (PHP_RAND_MAX + 1));
38-
};
36+
var do_rand = function (ctx) {
37+
return ((ctx * 1103515245 + 12345) % (PHP_RAND_MAX + 1));
38+
};
3939
40-
var php_rand = function (ctxArg) { // php_rand_r
41-
this.php_js.rand_seed = do_rand(ctxArg);
42-
return parseInt(this.php_js.rand_seed, 10);
43-
};
40+
var php_rand = function (ctxArg) { // php_rand_r
41+
this.php_js.rand_seed = do_rand(ctxArg);
42+
return parseInt(this.php_js.rand_seed, 10);
43+
};
4444
45-
var number = php_rand(rand_seed);
45+
var number = php_rand(rand_seed);
4646
47-
if (argc === 2) {
48-
number = min + parseInt(parseFloat(parseFloat(max) - min + 1.0) * (number/(PHP_RAND_MAX + 1.0)), 10);
47+
if (argc === 2) {
48+
number = min + parseInt(parseFloat(parseFloat(max) - min + 1.0) * (number/(PHP_RAND_MAX + 1.0)), 10);
4949
}
50-
return number;
50+
return number;
5151
*/
5252
}

functions/misc/constant.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ function constant(name) {
44
// + improved by: Brett Zamir (http://brettz9.blogspot.com)
55
// * example 1: constant('IMAGINARY_CONSTANT1');
66
// * returns 1: null
7-
8-
var clssPos = 0, clssCnst = null;
9-
if ((clssPos = name.indexOf('::')) !== -1) {
10-
clssCnst = name.slice(clssPos+2);
11-
name = name.slice(0, clssPos);
12-
}
7+
8+
var clssPos = 0, clssCnst = null;
9+
if ((clssPos = name.indexOf('::')) !== -1) {
10+
clssCnst = name.slice(clssPos+2);
11+
name = name.slice(0, clssPos);
12+
}
1313

1414
if (this.window[name] === undefined) {
1515
return null;
1616
}
17-
if (clssCnst) {
18-
return this.window[name][clssCnst];
19-
}
17+
if (clssCnst) {
18+
return this.window[name][clssCnst];
19+
}
2020
return this.window[name];
2121
}

functions/misc/define.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function define(name, value) {
2929
};
3030
return value.replace(/\x08|[\x0A-\x0D]|"|\\/g, function(value){
3131
return "\\"+replace[value];
32-
});
32+
});
3333
};
3434
defn = function (name, value){
3535
if (d.createElementNS) {

functions/misc/defined.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ function defined( constant_name ) {
33
// + original by: Waldo Malqui Silva
44
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
55
// + revised by: Brett Zamir (http://brettz9.blogspot.com)
6-
// % note 1: Because this function can (albeit only temporarily) overwrite a global variable,
7-
// % note 1: it is not thread-safe (normally not a concern for JavaScript, but would be if used
8-
// % note 1: in a threaded environment, e.g., DOM worker threads)
6+
// % note 1: Because this function can (albeit only temporarily) overwrite a global variable,
7+
// % note 1: it is not thread-safe (normally not a concern for JavaScript, but would be if used
8+
// % note 1: in a threaded environment, e.g., DOM worker threads)
99
// * example 1: defined('IMAGINARY_CONSTANT1');
1010
// * returns 1: false
1111

functions/net-gopher/gopher_parsedir.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
function gopher_parsedir (dirent) {
2-
// http://kevin.vanzonneveld.net
3-
// + original by: Brett Zamir (http://brettz9.blogspot.com)
4-
// * example 1: var entry = gopher_parsedir('0All about my gopher site.\t/allabout.txt\tgopher.example.com\t70\u000d\u000a');
5-
// * example 1: entry.title;
6-
// * returns 1: 'All about my gopher site.'
2+
// http://kevin.vanzonneveld.net
3+
// + original by: Brett Zamir (http://brettz9.blogspot.com)
4+
// * example 1: var entry = gopher_parsedir('0All about my gopher site.\t/allabout.txt\tgopher.example.com\t70\u000d\u000a');
5+
// * example 1: entry.title;
6+
// * returns 1: 'All about my gopher site.'
77

88
/* Types
99
* 0 = plain text file
@@ -22,8 +22,8 @@ function gopher_parsedir (dirent) {
2222
* s = Audio file format, primarily a WAV file
2323
*/
2424

25-
var entryPattern = /^(.)(.*?)\t(.*?)\t(.*?)\t(.*?)\u000d\u000a$/;
26-
var entry = dirent.match(entryPattern);
25+
var entryPattern = /^(.)(.*?)\t(.*?)\t(.*?)\t(.*?)\u000d\u000a$/;
26+
var entry = dirent.match(entryPattern);
2727

2828
if (entry === null) {
2929
throw 'Could not parse the directory entry';
@@ -59,5 +59,5 @@ function gopher_parsedir (dirent) {
5959
default:
6060
return {type:-1, data: dirent}; // GOPHER_UNKNOWN
6161
}
62-
return {type:type, title:entry[2], path:entry[3], host:entry[4], port:entry[5]};
62+
return {type:type, title:entry[2], path:entry[3], host:entry[4], port:entry[5]};
6363
}

functions/network/long2ip.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ function long2ip ( proper_address ) {
77
var output = false;
88

99
if ( !isNaN( proper_address ) && ( proper_address >= 0 || proper_address <= 4294967295 ) ) {
10-
output = Math.floor(proper_address / Math.pow( 256, 3 ) ) + '.' +
11-
Math.floor( ( proper_address % Math.pow( 256, 3 ) ) / Math.pow( 256, 2 ) ) + '.' +
12-
Math.floor( ( ( proper_address % Math.pow( 256, 3 ) ) % Math.pow( 256, 2 ) ) / Math.pow( 256, 1 ) ) + '.' +
13-
Math.floor( ( ( ( proper_address % Math.pow( 256, 3 ) ) % Math.pow( 256, 2 ) ) % Math.pow( 256, 1 ) ) / Math.pow( 256, 0 ) );
10+
output = Math.floor(proper_address / Math.pow( 256, 3 ) ) + '.' +
11+
Math.floor( ( proper_address % Math.pow( 256, 3 ) ) / Math.pow( 256, 2 ) ) + '.' +
12+
Math.floor( ( ( proper_address % Math.pow( 256, 3 ) ) % Math.pow( 256, 2 ) ) / Math.pow( 256, 1 ) ) + '.' +
13+
Math.floor( ( ( ( proper_address % Math.pow( 256, 3 ) ) % Math.pow( 256, 2 ) ) % Math.pow( 256, 1 ) ) / Math.pow( 256, 0 ) );
1414
}
1515

1616
return output;

0 commit comments

Comments
 (0)