Skip to content

Commit

Permalink
extended cross-domain AJAX support
Browse files Browse the repository at this point in the history
  • Loading branch information
austincheney committed Aug 9, 2011
1 parent 5bf6fc3 commit 71778cf
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion documentation.html

Large diffs are not rendered by default.

28 changes: 20 additions & 8 deletions js-beautify.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ var js_beautify = function (args) {
resulting_string,
in_char_class,
sharp,
whitespace_count = 0;
whitespace_count = 0,
dot = true;
n_newlines = 0;
if (parser_pos >= input_length) {
return ["", "TK_EOF"];
Expand Down Expand Up @@ -431,13 +432,24 @@ var js_beautify = function (args) {
}
}
}
// small and surprisingly unugly hack for 1E-10
// representation
if (parser_pos !== input_length && c.match(/^[0-9]+[Ee]$/) && (input.charAt(parser_pos) === "-" || input.charAt(parser_pos) === "+")) {
sign = input.charAt(parser_pos);
parser_pos += 1;
t = this(parser_pos);
c += sign + t[0];
if (parser_pos !== input_length && c.match(/^\d+[Ee]$/) && (input.charAt(parser_pos) === "-" || input.charAt(parser_pos) === "+")) {
sign = [input.charAt(parser_pos)];
while (parser_pos < input_length) {
parser_pos += 1;
if (input.charAt(parser_pos).match(/\d|\./)) {
if (input.charAt(parser_pos).match(/\./)) {
if (dot) {
dot = false;
} else {
sign.push(" ");
}
}
sign.push(input.charAt(parser_pos));
} else {
break;
}
}
c += sign.join("");
return [c, "TK_WORD"];
}
// hack for "in" operator
Expand Down
2 changes: 1 addition & 1 deletion pd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion prettydiff.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion proxy.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$referer = $_SERVER['HTTP_REFERER'];
$refpos = strpos($referer, 'prettydiff.com');
if ($refpos === 7 || $refpos === 11) {
if ($refpos === 0 || $refpos === 7 || $refpos === 11) {
$x = $_GET['x'];
//$r = file_get_contents($x);
//echo($r);
Expand Down

0 comments on commit 71778cf

Please sign in to comment.