Permalink
Browse files

extended cross-domain AJAX support

  • Loading branch information...
1 parent 5bf6fc3 commit 71778cf8914ec210826b00376293639cde1440ad austincheney committed Aug 9, 2011
Showing with 24 additions and 12 deletions.
  1. +1 −1 documentation.html
  2. +20 −8 js-beautify.js
  3. +1 −1 pd.js
  4. +1 −1 prettydiff.js
  5. +1 −1 proxy.php
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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"];
@@ -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
View
2 pd.js

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -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);

0 comments on commit 71778cf

Please sign in to comment.