mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API-CHANGE: updated jsmin to point at new github repo for the project
This commit is contained in:
parent
eee5f3e266
commit
0bb424e2a2
8
thirdparty/jsmin/.piston.yml
vendored
8
thirdparty/jsmin/.piston.yml
vendored
@ -1,8 +1,8 @@
|
||||
---
|
||||
format: 1
|
||||
handler:
|
||||
piston:remote-revision: 7
|
||||
piston:uuid: d4d03eb5-ab2f-0410-8b36-bd473e2d5c71
|
||||
commit: e71eac35ce7a0f191d199be9e35a8d12f1f999fd
|
||||
branch: master
|
||||
lock: false
|
||||
repository_url: http://jsmin-php.googlecode.com/svn/trunk/
|
||||
repository_class: Piston::Svn::Repository
|
||||
repository_class: Piston::Git::Repository
|
||||
repository_url: https://github.com/rgrove/jsmin-php/
|
||||
|
44
thirdparty/jsmin/jsmin.php
vendored
44
thirdparty/jsmin/jsmin.php
vendored
@ -73,6 +73,15 @@ class JSMin {
|
||||
|
||||
// -- Protected Instance Methods ---------------------------------------------
|
||||
|
||||
|
||||
|
||||
/* action -- do something! What you do is determined by the argument:
|
||||
1 Output A. Copy B to A. Get the next B.
|
||||
2 Copy B to A. Get the next B. (Delete A).
|
||||
3 Get the next B. (Delete B).
|
||||
action treats a string as a single character. Wow!
|
||||
action recognizes a regular expression if it is preceded by ( or , or =.
|
||||
*/
|
||||
protected function action($d) {
|
||||
switch($d) {
|
||||
case 1:
|
||||
@ -107,21 +116,40 @@ class JSMin {
|
||||
if ($this->b === '/' && (
|
||||
$this->a === '(' || $this->a === ',' || $this->a === '=' ||
|
||||
$this->a === ':' || $this->a === '[' || $this->a === '!' ||
|
||||
$this->a === '&' || $this->a === '|' || $this->a === '?')) {
|
||||
$this->a === '&' || $this->a === '|' || $this->a === '?' ||
|
||||
$this->a === '{' || $this->a === '}' || $this->a === ';' ||
|
||||
$this->a === "\n" )) {
|
||||
|
||||
$this->output .= $this->a . $this->b;
|
||||
|
||||
for (;;) {
|
||||
$this->a = $this->get();
|
||||
|
||||
if ($this->a === '/') {
|
||||
if ($this->a === '[') {
|
||||
/*
|
||||
inside a regex [...] set, which MAY contain a '/' itself. Example: mootools Form.Validator near line 460:
|
||||
return Form.Validator.getValidator('IsEmpty').test(element) || (/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(element.get('value'));
|
||||
*/
|
||||
for (;;) {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
|
||||
if ($this->a === ']') {
|
||||
break;
|
||||
} elseif ($this->a === '\\') {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
} elseif (ord($this->a) <= self::ORD_LF) {
|
||||
throw new JSMinException('Unterminated regular expression '.
|
||||
'literal.');
|
||||
throw new JSMinException('Unterminated regular expression set in regex literal.');
|
||||
}
|
||||
}
|
||||
} elseif ($this->a === '/') {
|
||||
break;
|
||||
} elseif ($this->a === '\\') {
|
||||
$this->output .= $this->a;
|
||||
$this->a = $this->get();
|
||||
} elseif (ord($this->a) <= self::ORD_LF) {
|
||||
throw new JSMinException('Unterminated regular expression literal.');
|
||||
}
|
||||
|
||||
$this->output .= $this->a;
|
||||
@ -138,7 +166,7 @@ class JSMin {
|
||||
|
||||
if ($c === null) {
|
||||
if ($this->inputIndex < $this->inputLength) {
|
||||
$c = $this->input[$this->inputIndex];
|
||||
$c = substr($this->input, $this->inputIndex, 1);
|
||||
$this->inputIndex += 1;
|
||||
} else {
|
||||
$c = null;
|
||||
@ -156,6 +184,9 @@ class JSMin {
|
||||
return ' ';
|
||||
}
|
||||
|
||||
/* isAlphanum -- return true if the character is a letter, digit, underscore,
|
||||
dollar sign, or non-ASCII character.
|
||||
*/
|
||||
protected function isAlphaNum($c) {
|
||||
return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;
|
||||
}
|
||||
@ -241,6 +272,9 @@ class JSMin {
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
/* next -- get the next character, excluding comments. peek() is used to see
|
||||
if a '/' is followed by a '/' or '*'.
|
||||
*/
|
||||
protected function next() {
|
||||
$c = $this->get();
|
||||
|
||||
|
30217
thirdparty/jsmin/test/ext-all-debug.js
vendored
30217
thirdparty/jsmin/test/ext-all-debug.js
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user