summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/prototype
diff options
context:
space:
mode:
authorwei <>2006-01-09 03:40:59 +0000
committerwei <>2006-01-09 03:40:59 +0000
commit9c9a2d731fea9679f65904a3a6b72dd78b4253a4 (patch)
tree1d81a12a7a79e74e98218d01c6278a81f0996f5d /framework/Web/Javascripts/prototype
parent10420d2bcde1a7437b58175f417170b2d6d93e50 (diff)
Update library
Diffstat (limited to 'framework/Web/Javascripts/prototype')
-rw-r--r--framework/Web/Javascripts/prototype/AUTHORS12
-rw-r--r--framework/Web/Javascripts/prototype/LICENSE16
-rw-r--r--framework/Web/Javascripts/prototype/README64
-rw-r--r--framework/Web/Javascripts/prototype/THANKS21
-rw-r--r--framework/Web/Javascripts/prototype/ajax.js75
-rw-r--r--framework/Web/Javascripts/prototype/array.js25
-rw-r--r--framework/Web/Javascripts/prototype/base.js6
-rw-r--r--framework/Web/Javascripts/prototype/dom.js26
-rw-r--r--framework/Web/Javascripts/prototype/enumerable.js6
-rw-r--r--framework/Web/Javascripts/prototype/form.js61
-rw-r--r--framework/Web/Javascripts/prototype/prototype.js16
-rw-r--r--framework/Web/Javascripts/prototype/range.js8
-rw-r--r--framework/Web/Javascripts/prototype/string.js16
13 files changed, 268 insertions, 84 deletions
diff --git a/framework/Web/Javascripts/prototype/AUTHORS b/framework/Web/Javascripts/prototype/AUTHORS
new file mode 100644
index 00000000..5fea268f
--- /dev/null
+++ b/framework/Web/Javascripts/prototype/AUTHORS
@@ -0,0 +1,12 @@
+Creator and maintainer
+
+* Sam Stephenson -- http://conio.net/
+
+Contributors
+
+* Thomas Fuchs -- http://mir.aculo.us/
+* David Heinemeier Hansson -- http://www.loudthinking.com/
+* Matthew McCray -- http://www.mattmccray.com/
+* Michael Schuerig -- http://www.schuerig.de/michael/
+* Sean Treadway -- http://sean.treadway.info/
+* flash@vanklinkenbergsoftware.nl
diff --git a/framework/Web/Javascripts/prototype/LICENSE b/framework/Web/Javascripts/prototype/LICENSE
new file mode 100644
index 00000000..6c4c6312
--- /dev/null
+++ b/framework/Web/Javascripts/prototype/LICENSE
@@ -0,0 +1,16 @@
+Copyright (c) 2005 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/framework/Web/Javascripts/prototype/README b/framework/Web/Javascripts/prototype/README
new file mode 100644
index 00000000..74761a82
--- /dev/null
+++ b/framework/Web/Javascripts/prototype/README
@@ -0,0 +1,64 @@
+= Prototype
+==== An object-oriented JavaScript framework
+
+(c) 2005 Sam Stephenson (mailto:sam@conio.net)
+
+Prototype is a JavaScript framework that aims to ease development of dynamic
+web applications. Its development is driven heavily by the Ruby on Rails
+framework, but it can be used in any environment.
+
+=== Targeted platforms
+
+Prototype currently targets the following platforms:
+
+* Microsoft Internet Explorer for Windows, version 6.0 and higher
+* Mozilla Firefox 1.0/Mozilla 1.7 and higher
+* Apple Safari 1.2 and higher
+
+== Using Prototype
+
+To use Prototype in your application, download the latest release from the
+Prototype web site (http://prototype.conio.net/) and copy
+<tt>dist/prototype.js</tt> to a suitable location. Then include it in your HTML
+like so:
+
+ <script type="text/javascript" src="/path/to/prototype.js"></script>
+
+=== Building Prototype from source
+
+<tt>prototype.js</tt> is a composite file generated from many source files in
+the <tt>src/</tt> directory. To build Prototype, you'll need:
+
+* a copy of the Prototype source tree, either from a distribution tarball or
+ from the darcs repository (see below)
+* Ruby 1.8.2 or higher (http://www.ruby-lang.org/)
+* Rake -- Ruby Make (http://rake.rubyforge.org/)
+* RDoc, if your Ruby distribution does not include it
+* darcs 1.0.1 or higher (http://abridgegame.org/darcs/; static binaries
+ available at http://www.scannedinavian.org/DarcsWiki/CategoryBinaries)
+
+From the root Prototype directory,
+
+* <tt>rake dist</tt> will preprocess the Prototype source using ERB and
+ generate the composite <tt>dist/prototype.js</tt>.
+* <tt>rake package</tt> will create a distribution tarball in the
+ <tt>pkg/</tt> directory.
+
+== Contributing to Prototype
+
+You'll need the tools mentioned above. Modify the files in <tt>src/</tt>, add
+tests in <tt>test/</tt> if possible, generate a new dist file, and record the
+changes with <tt>darcs record -al</tt>. Then email patches to
+mailto:sam@conio.net using <tt>darcs send</tt>.
+
+== Documentation
+
+Prototype is embarrassingly lacking in documentation. (The source code should
+be fairly easy to comprehend; I'm committed to using a clean style with
+meaningful identifiers. But I know that only goes so far.)
+
+Much of the problem is that there is no easy way to document it from within the
+source code itself. I've tried JSDoc[http://jsdoc.sf.net/] and a Perl script
+included with JsUnit[http://www.edwardh.com/jsunit/]; neither groks Prototype's
+hash-style class definitions or inheritance scheme. Making them work would
+require major changes, and I don't have the time for that right now.
diff --git a/framework/Web/Javascripts/prototype/THANKS b/framework/Web/Javascripts/prototype/THANKS
new file mode 100644
index 00000000..d36adacb
--- /dev/null
+++ b/framework/Web/Javascripts/prototype/THANKS
@@ -0,0 +1,21 @@
+Special thanks are in order for Mikael and Daniel Brockman, whose patterns
+heavily influenced the design and implementation of this library.
+* Daniel Brockman -- http://www.deepwood.net/
+* Mikael Brockman -- http://www.phubuh.org/
+---
+* Scott Barron -- http://scott.elitists.net/
+* Hemant Bhanoo
+* Jamis Buck -- http://jamis.jamisbuck.org/
+* Lucas Carlson -- http://www.rufy.com/
+* Jon Casey
+* Patrick Corcoran
+* Alper Cugun
+* Darren James -- http://www.openrico.org/
+* Marcel Molina Jr. -- http://vernix.org/marcel/
+* Alex Russell
+* Chriztian Steinmeier
+* Dan Webb
+* Gary Wright
+
+and anyone else who has sent patches or bug reports. If your name isn't on this
+list, please forgive my oversight and send me an email (sam at conio.net). \ No newline at end of file
diff --git a/framework/Web/Javascripts/prototype/ajax.js b/framework/Web/Javascripts/prototype/ajax.js
index 1fe0dab9..6abef835 100644
--- a/framework/Web/Javascripts/prototype/ajax.js
+++ b/framework/Web/Javascripts/prototype/ajax.js
@@ -31,8 +31,7 @@ Ajax.Responders = {
if (responder[callback] && typeof responder[callback] == 'function') {
try {
responder[callback].apply(responder, [request, transport, json]);
- } catch (e) {
- }
+ } catch (e) {}
}
});
}
@@ -108,8 +107,7 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
this.transport.send(this.options.method == 'post' ? body : null);
} catch (e) {
- (this.options.onException || Prototype.emptyFunction)(this, e);
- Ajax.Responders.dispatch('onException', this, e);
+ this.dispatchException(e);
}
},
@@ -143,12 +141,23 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
this.respondToReadyState(this.transport.readyState);
},
+ header: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) {}
+ },
+
evalJSON: function() {
try {
- var json = this.transport.getResponseHeader('X-JSON'), object;
- object = eval(json);
- return object;
+ return eval(this.header('X-JSON'));
+ } catch (e) {}
+ },
+
+ evalResponse: function() {
+ try {
+ return eval(this.transport.responseText);
} catch (e) {
+ this.dispatchException(e);
}
},
@@ -156,22 +165,38 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
var event = Ajax.Request.Events[readyState];
var transport = this.transport, json = this.evalJSON();
- if (event == 'Complete')
- (this.options['on' + this.transport.status]
- || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
- || Prototype.emptyFunction)(transport, json);
-
- (this.options['on' + event] || Prototype.emptyFunction)(transport, json);
- Ajax.Responders.dispatch('on' + event, this, transport, json);
-
+ if (event == 'Complete') {
+ try {
+ (this.options['on' + this.transport.status]
+ || this.options['on' + (this.responseIsSuccess() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if ((this.header('Content-type') || '').match(/^text\/javascript/i))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + event] || Prototype.emptyFunction)(transport, json);
+ Ajax.Responders.dispatch('on' + event, this, transport, json);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
/* Avoid memory leak in MSIE: clean up the oncomplete event handler */
if (event == 'Complete')
this.transport.onreadystatechange = Prototype.emptyFunction;
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
}
});
Ajax.Updater = Class.create();
-Ajax.Updater.ScriptFragment = '(?:<script.*?>)((\n|.)*?)(?:<\/script>)';
Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
initialize: function(container, url, options) {
@@ -196,16 +221,16 @@ Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
updateContent: function() {
var receiver = this.responseIsSuccess() ?
this.containers.success : this.containers.failure;
-
- var match = new RegExp(Ajax.Updater.ScriptFragment, 'img');
- var response = this.transport.responseText.replace(match, '');
- var scripts = this.transport.responseText.match(match);
+ var response = this.transport.responseText;
+
+ if (!this.options.evalScripts)
+ response = response.stripScripts();
if (receiver) {
if (this.options.insertion) {
new this.options.insertion(receiver, response);
} else {
- receiver.innerHTML = response;
+ Element.update(receiver, response);
}
}
@@ -213,14 +238,6 @@ Object.extend(Object.extend(Ajax.Updater.prototype, Ajax.Request.prototype), {
if (this.onComplete)
setTimeout(this.onComplete.bind(this), 10);
}
-
- if (this.options.evalScripts && scripts) {
- match = new RegExp(Ajax.Updater.ScriptFragment, 'im');
- setTimeout((function() {
- for (var i = 0; i < scripts.length; i++)
- eval(scripts[i].match(match)[1]);
- }).bind(this), 10);
- }
}
});
diff --git a/framework/Web/Javascripts/prototype/array.js b/framework/Web/Javascripts/prototype/array.js
index 397afbbf..f5694c05 100644
--- a/framework/Web/Javascripts/prototype/array.js
+++ b/framework/Web/Javascripts/prototype/array.js
@@ -1,4 +1,5 @@
var $A = Array.from = function(iterable) {
+ if (!iterable) return [];
if (iterable.toArray) {
return iterable.toArray();
} else {
@@ -11,12 +12,19 @@ var $A = Array.from = function(iterable) {
Object.extend(Array.prototype, Enumerable);
+Array.prototype._reverse = Array.prototype.reverse;
+
Object.extend(Array.prototype, {
_each: function(iterator) {
for (var i = 0; i < this.length; i++)
iterator(this[i]);
},
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
first: function() {
return this[0];
},
@@ -48,16 +56,21 @@ Object.extend(Array.prototype, {
indexOf: function(object) {
for (var i = 0; i < this.length; i++)
if (this[i] == object) return i;
- return false;
+ return -1;
},
- reverse: function() {
- var result = [];
- for (var i = this.length; i > 0; i--)
- result.push(this[i-1]);
- return result;
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
},
+ shift: function() {
+ var result = this[0];
+ for (var i = 0; i < this.length - 1; i++)
+ this[i] = this[i + 1];
+ this.length--;
+ return result;
+ },
+
inspect: function() {
return '[' + this.map(Object.inspect).join(', ') + ']';
}
diff --git a/framework/Web/Javascripts/prototype/base.js b/framework/Web/Javascripts/prototype/base.js
index 70f92add..9ac55c73 100644
--- a/framework/Web/Javascripts/prototype/base.js
+++ b/framework/Web/Javascripts/prototype/base.js
@@ -26,10 +26,10 @@ Object.inspect = function(object) {
}
}
-Function.prototype.bind = function(object) {
- var __method = this;
+Function.prototype.bind = function() {
+ var __method = this, args = $A(arguments), object = args.shift();
return function() {
- return __method.apply(object, arguments);
+ return __method.apply(object, args.concat($A(arguments)));
}
}
diff --git a/framework/Web/Javascripts/prototype/dom.js b/framework/Web/Javascripts/prototype/dom.js
index 282fbfe0..3587a8da 100644
--- a/framework/Web/Javascripts/prototype/dom.js
+++ b/framework/Web/Javascripts/prototype/dom.js
@@ -1,7 +1,7 @@
document.getElementsByClassName = function(className, parentElement) {
var children = ($(parentElement) || document.body).getElementsByTagName('*');
return $A(children).inject([], function(elements, child) {
- if (Element.hasClassName(child, className))
+ if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
elements.push(child);
return elements;
});
@@ -43,6 +43,11 @@ Object.extend(Element, {
element = $(element);
element.parentNode.removeChild(element);
},
+
+ update: function(element, html) {
+ $(element).innerHTML = html.stripScripts();
+ setTimeout(function() {html.evalScripts()}, 10);
+ },
getHeight: function(element) {
element = $(element);
@@ -70,12 +75,11 @@ Object.extend(Element, {
// removes whitespace-only text node children
cleanWhitespace: function(element) {
- if(undef(element) || isNull(element)) return;
element = $(element);
for (var i = 0; i < element.childNodes.length; i++) {
var node = element.childNodes[i];
if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
- node.parentNode.removeChild(node);
+ Element.remove(node);
}
},
@@ -108,6 +112,12 @@ Object.extend(Element, {
return value == 'auto' ? null : value;
},
+ setStyle: function(element, style) {
+ element = $(element);
+ for (name in style)
+ element.style[name.camelize()] = style[name];
+ },
+
getDimensions: function(element) {
element = $(element);
if (Element.getStyle(element, 'display') != 'none')
@@ -152,7 +162,7 @@ Object.extend(Element, {
element.style.top =
element.style.left =
element.style.bottom =
- element.style.right = '';
+ element.style.right = '';
}
},
@@ -184,7 +194,7 @@ Abstract.Insertion = function(adjacency) {
Abstract.Insertion.prototype = {
initialize: function(element, content) {
this.element = $(element);
- this.content = content;
+ this.content = content.stripScripts();
if (this.adjacency && this.element.insertAdjacentHTML) {
try {
@@ -201,6 +211,8 @@ Abstract.Insertion.prototype = {
if (this.initializeRange) this.initializeRange();
this.insertContent([this.range.createContextualFragment(this.content)]);
}
+
+ setTimeout(function() {content.evalScripts()}, 10);
},
contentFromAnonymousTable: function() {
@@ -233,7 +245,7 @@ Insertion.Top.prototype = Object.extend(new Abstract.Insertion('afterBegin'), {
},
insertContent: function(fragments) {
- fragments.reverse().each((function(fragment) {
+ fragments.reverse(false).each((function(fragment) {
this.element.insertBefore(fragment, this.element.firstChild);
}).bind(this));
}
@@ -294,7 +306,7 @@ Element.ClassNames.prototype = {
if (!this.include(classNameToRemove)) return;
this.set(this.select(function(className) {
return className != classNameToRemove;
- }));
+ }).join(' '));
},
toString: function() {
diff --git a/framework/Web/Javascripts/prototype/enumerable.js b/framework/Web/Javascripts/prototype/enumerable.js
index edeb297b..78afa842 100644
--- a/framework/Web/Javascripts/prototype/enumerable.js
+++ b/framework/Web/Javascripts/prototype/enumerable.js
@@ -20,8 +20,8 @@ var Enumerable = {
all: function(iterator) {
var result = true;
this.each(function(value, index) {
- if (!(result &= (iterator || Prototype.K)(value, index)))
- throw $break;
+ result = result && !!(iterator || Prototype.K)(value, index);
+ if (!result) throw $break;
});
return result;
},
@@ -29,7 +29,7 @@ var Enumerable = {
any: function(iterator) {
var result = true;
this.each(function(value, index) {
- if (result &= (iterator || Prototype.K)(value, index))
+ if (result = !!(iterator || Prototype.K)(value, index))
throw $break;
});
return result;
diff --git a/framework/Web/Javascripts/prototype/form.js b/framework/Web/Javascripts/prototype/form.js
index 92a5d91a..4fa00ae2 100644
--- a/framework/Web/Javascripts/prototype/form.js
+++ b/framework/Web/Javascripts/prototype/form.js
@@ -19,8 +19,10 @@ var Field = {
},
activate: function(element) {
- $(element).focus();
- $(element).select();
+ element = $(element);
+ element.focus();
+ if (element.select)
+ element.select();
}
}
@@ -41,7 +43,7 @@ var Form = {
},
getElements: function(form) {
- var form = $(form);
+ form = $(form);
var elements = new Array();
for (tagName in Form.Element.Serializers) {
@@ -53,7 +55,7 @@ var Form = {
},
getInputs: function(form, typeName, name) {
- var form = $(form);
+ form = $(form);
var inputs = form.getElementsByTagName('input');
if (!typeName && !name)
@@ -88,16 +90,15 @@ var Form = {
}
},
+ findFirstElement: function(form) {
+ return Form.getElements(form).find(function(element) {
+ return element.type != 'hidden' && !element.disabled &&
+ ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
focusFirstElement: function(form) {
- var form = $(form);
- var elements = Form.getElements(form);
- for (var i = 0; i < elements.length; i++) {
- var element = elements[i];
- if (element.type != 'hidden' && !element.disabled) {
- Field.activate(element);
- break;
- }
- }
+ Field.activate(Form.findFirstElement(form));
},
reset: function(form) {
@@ -107,21 +108,29 @@ var Form = {
Form.Element = {
serialize: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
- if (parameter)
- return encodeURIComponent(parameter[0]) + '=' +
- encodeURIComponent(parameter[1]);
+ if (parameter) {
+ var key = encodeURIComponent(parameter[0]);
+ if (key.length == 0) return;
+
+ if (parameter[1].constructor != Array)
+ parameter[1] = [parameter[1]];
+
+ return parameter[1].map(function(value) {
+ return key + '=' + encodeURIComponent(value);
+ }).join('&');
+ }
},
getValue: function(element) {
- var element = $(element);
+ element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);
- if (parameter)
+ if (parameter)
return parameter[1];
}
}
@@ -259,24 +268,14 @@ Abstract.EventObserver.prototype = {
switch (element.type.toLowerCase()) {
case 'checkbox':
case 'radio':
- element.target = this;
- element.prev_onclick = element.onclick || Prototype.emptyFunction;
- element.onclick = function() {
- this.prev_onclick();
- this.target.onElementEvent();
- }
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
break;
case 'password':
case 'text':
case 'textarea':
case 'select-one':
case 'select-multiple':
- element.target = this;
- element.prev_onchange = element.onchange || Prototype.emptyFunction;
- element.onchange = function() {
- this.prev_onchange();
- this.target.onElementEvent();
- }
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
break;
}
}
diff --git a/framework/Web/Javascripts/prototype/prototype.js b/framework/Web/Javascripts/prototype/prototype.js
index 8beb4d43..6ae99602 100644
--- a/framework/Web/Javascripts/prototype/prototype.js
+++ b/framework/Web/Javascripts/prototype/prototype.js
@@ -1,5 +1,19 @@
+/* Prototype JavaScript framework, version 1.4.0
+ * (c) 2005 Sam Stephenson <sam@conio.net>
+ *
+ * THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
+ * against the source tree, available from the Prototype darcs repository.
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ * For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
var Prototype = {
- Version: '1.4.0_rc1',
+ Version: '1.4.0',
+ ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
+
emptyFunction: function() {},
K: function(x) {return x}
} \ No newline at end of file
diff --git a/framework/Web/Javascripts/prototype/range.js b/framework/Web/Javascripts/prototype/range.js
index f7c87166..e824e32a 100644
--- a/framework/Web/Javascripts/prototype/range.js
+++ b/framework/Web/Javascripts/prototype/range.js
@@ -1,6 +1,6 @@
-var Range = Class.create();
-Object.extend(Range.prototype, Enumerable);
-Object.extend(Range.prototype, {
+ObjectRange = Class.create();
+Object.extend(ObjectRange.prototype, Enumerable);
+Object.extend(ObjectRange.prototype, {
initialize: function(start, end, exclusive) {
this.start = start;
this.end = end;
@@ -25,5 +25,5 @@ Object.extend(Range.prototype, {
});
var $R = function(start, end, exclusive) {
- return new Range(start, end, exclusive);
+ return new ObjectRange(start, end, exclusive);
} \ No newline at end of file
diff --git a/framework/Web/Javascripts/prototype/string.js b/framework/Web/Javascripts/prototype/string.js
index c869e7db..f7b74710 100644
--- a/framework/Web/Javascripts/prototype/string.js
+++ b/framework/Web/Javascripts/prototype/string.js
@@ -3,6 +3,22 @@ Object.extend(String.prototype, {
return this.replace(/<\/?[^>]+>/gi, '');
},
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(eval);
+ },
+
escapeHTML: function() {
var div = document.createElement('div');
var text = document.createTextNode(this);