|
|
From 5694cb272541b3b22cec791327eb37dc1b4f944d Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Mislav=20Marohni=C4=87?=
Date: Mon, 11 Aug 2008 22:22:00 +0200
Subject: [PATCH] Namespacing: wrap everything in anonymous function.
Remove deprecated.js and add a hack that copies references of local classes and functions to Prototype object.
---
src/prototype.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/prototype.js b/src/prototype.js
index 6ab0788..1ce91df 100644
--- a/src/prototype.js
+++ b/src/prototype.js
@@ -33,11 +33,17 @@ var Prototype = {
if (Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions = false;
-
+(function() {
<%= include 'base.js', 'string.js' %>
<%= include 'enumerable.js', 'array.js', 'number.js', 'hash.js', 'range.js' %>
-<%= include 'ajax.js', 'dom.js', 'selector.js', 'form.js', 'event.js', 'deprecated.js' %>
+<%= include 'ajax.js', 'dom.js', 'selector.js', 'form.js', 'event.js' %>
Element.addMethods();
+
+$w("Class Abstract Try PeriodicalExecuter Template $break Enumerable $A $w \
+$H Hash ObjectRange $R Ajax $ Selector $$ Form Field $F Event").each(function(name) {
+ Prototype[name] = eval(name)
+});
+}());
--
1.5.5.1
From 5455814114814fffaa70c28bc1c2cb3064db88ee Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Mislav=20Marohni=C4=87?=
Date: Mon, 11 Aug 2008 22:23:08 +0200
Subject: [PATCH] create local references for window.Node and window.Event
---
src/dom.js | 2 +-
src/event.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dom.js b/src/dom.js
index 3f67e33..ec7ce9e 100644
--- a/src/dom.js
+++ b/src/dom.js
@@ -22,7 +22,7 @@ if (Prototype.BrowserFeatures.XPath) {
/*--------------------------------------------------------------------------*/
-if (!window.Node) var Node = { };
+var Node = window.Node || { };
if (!Node.ELEMENT_NODE) {
// DOM level 2 ECMAScript Language Binding
diff --git a/src/event.js b/src/event.js
index 14f9aa4..b30d490 100644
--- a/src/event.js
+++ b/src/event.js
@@ -1,4 +1,4 @@
-if (!window.Event) var Event = { };
+var Event = window.Event || { };
Object.extend(Event, {
KEY_BACKSPACE: 8,
--
1.5.5.1
From cd233d11617803732209de356bc6a988656df8be Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Mislav=20Marohni=C4=87?=
Date: Mon, 11 Aug 2008 22:24:14 +0200
Subject: [PATCH] make the events test functional again by creating shortcuts to "$" and "$w"
---
test/functional/event.html | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/test/functional/event.html b/test/functional/event.html
index 526e711..d4e63e2 100644
--- a/test/functional/event.html
+++ b/test/functional/event.html
@@ -25,6 +25,9 @@
mislav
paste again
|