envjs 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +5 -0
- data/Manifest.txt +1 -0
- data/lib/envjs.rb +1 -1
- data/lib/envjs/env.js +6 -1
- data/lib/envjs/static.js +4 -1
- data/src/html/select.js +4 -1
- data/src/platform/johnson.js +6 -1
- data/test/primary-tests.js +1 -0
- data/test/unit/insertion.js +23 -0
- metadata +16 -6
data/CHANGELOG.rdoc
CHANGED
data/Manifest.txt
CHANGED
data/lib/envjs.rb
CHANGED
data/lib/envjs/env.js
CHANGED
@@ -306,7 +306,12 @@ $env.connection = $master.connection || function(xhr, responseHandler, data){
|
|
306
306
|
}
|
307
307
|
|
308
308
|
try {
|
309
|
-
connection = Ruby.Net.HTTP.
|
309
|
+
connection = Ruby.Net.HTTP.new( url.host, url.port );
|
310
|
+
if (url.scheme === "https") {
|
311
|
+
Ruby.eval("require 'net/https'");
|
312
|
+
connection.use_ssl = true;
|
313
|
+
}
|
314
|
+
connection.start();
|
310
315
|
resp = connection.request(req);
|
311
316
|
} catch(e) {
|
312
317
|
$env.warn("XHR net request failed: "+e);
|
data/lib/envjs/static.js
CHANGED
@@ -7038,8 +7038,11 @@ __extend__(HTMLSelectElement.prototype, {
|
|
7038
7038
|
return this.getAttribute(qualifiedName);
|
7039
7039
|
},
|
7040
7040
|
setAttribute: function(name, value){
|
7041
|
+
// This is a workaround for now for copying nodes in
|
7041
7042
|
if (name === "type") {
|
7042
|
-
|
7043
|
+
if (!this.ownerDocument._performingImportNodeOperation) {
|
7044
|
+
throw new Error("cannot set readonly attribute: "+name);
|
7045
|
+
}
|
7043
7046
|
} else if (name === "multiple") {
|
7044
7047
|
HTMLInputCommon.prototype.
|
7045
7048
|
setAttribute.call(this, "type", value ? "select-multiple" : "select-one");
|
data/src/html/select.js
CHANGED
@@ -27,8 +27,11 @@ __extend__(HTMLSelectElement.prototype, {
|
|
27
27
|
return this.getAttribute(qualifiedName);
|
28
28
|
},
|
29
29
|
setAttribute: function(name, value){
|
30
|
+
// This is a workaround for now for copying nodes in
|
30
31
|
if (name === "type") {
|
31
|
-
|
32
|
+
if (!this.ownerDocument._performingImportNodeOperation) {
|
33
|
+
throw new Error("cannot set readonly attribute: "+name);
|
34
|
+
}
|
32
35
|
} else if (name === "multiple") {
|
33
36
|
HTMLInputCommon.prototype.
|
34
37
|
setAttribute.call(this, "type", value ? "select-multiple" : "select-one");
|
data/src/platform/johnson.js
CHANGED
@@ -160,7 +160,12 @@ $env.connection = $master.connection || function(xhr, responseHandler, data){
|
|
160
160
|
}
|
161
161
|
|
162
162
|
try {
|
163
|
-
connection = Ruby.Net.HTTP.
|
163
|
+
connection = Ruby.Net.HTTP.new( url.host, url.port );
|
164
|
+
if (url.scheme === "https") {
|
165
|
+
Ruby.eval("require 'net/https'");
|
166
|
+
connection.use_ssl = true;
|
167
|
+
}
|
168
|
+
connection.start();
|
164
169
|
resp = connection.request(req);
|
165
170
|
} catch(e) {
|
166
171
|
$env.warn("XHR net request failed: "+e);
|
data/test/primary-tests.js
CHANGED
@@ -8,6 +8,7 @@ window.addEventListener("load",function(){
|
|
8
8
|
load("test/unit/dom.js");
|
9
9
|
load("test/unit/window.js");
|
10
10
|
load("test/unit/elementmembers.js");
|
11
|
+
load("test/unit/insertion.js");
|
11
12
|
if (multiwindow) {
|
12
13
|
load("test/unit/onload.js");
|
13
14
|
load("test/unit/scope.js"); // must come before frame.js changes page content
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module("insertion");
|
2
|
+
|
3
|
+
test("inserting SELECT elements with multiple='multiple' should not raise an error", function() {
|
4
|
+
expect(3);
|
5
|
+
var div = document.createElement('div');
|
6
|
+
var html = "<select multiple='multiple'><option value='wheels'>Wheels within Wheels</option></select>";
|
7
|
+
ok(div.innerHTML = html, html);
|
8
|
+
var select = document.createElement('select');
|
9
|
+
var x;
|
10
|
+
try {
|
11
|
+
select.type = "foo";
|
12
|
+
}catch(e){
|
13
|
+
x = e;
|
14
|
+
}
|
15
|
+
ok(x !== void(0), "should not allow setting type");
|
16
|
+
x = void(0);
|
17
|
+
try {
|
18
|
+
select.setAttribute("type","foo");
|
19
|
+
}catch(e){
|
20
|
+
x = e;
|
21
|
+
}
|
22
|
+
ok(x !== void(0), "should not allow setting type via setAttribute");
|
23
|
+
});
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
9
|
+
- 7
|
10
|
+
version: 0.3.7
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- John Resig
|
@@ -16,16 +17,18 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2010-05
|
20
|
+
date: 2010-07-05 00:00:00 -07:00
|
20
21
|
default_executable:
|
21
22
|
dependencies:
|
22
23
|
- !ruby/object:Gem::Dependency
|
23
24
|
name: johnson
|
24
25
|
prerelease: false
|
25
26
|
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
26
28
|
requirements:
|
27
29
|
- - ">="
|
28
30
|
- !ruby/object:Gem::Version
|
31
|
+
hash: -1876988194
|
29
32
|
segments:
|
30
33
|
- 2
|
31
34
|
- 0
|
@@ -38,14 +41,16 @@ dependencies:
|
|
38
41
|
name: hoe
|
39
42
|
prerelease: false
|
40
43
|
requirement: &id002 !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
41
45
|
requirements:
|
42
46
|
- - ">="
|
43
47
|
- !ruby/object:Gem::Version
|
48
|
+
hash: 21
|
44
49
|
segments:
|
45
50
|
- 2
|
46
51
|
- 6
|
47
|
-
-
|
48
|
-
version: 2.6.
|
52
|
+
- 1
|
53
|
+
version: 2.6.1
|
49
54
|
type: :development
|
50
55
|
version_requirements: *id002
|
51
56
|
description: |-
|
@@ -353,6 +358,7 @@ files:
|
|
353
358
|
- test/unit/events.js
|
354
359
|
- test/unit/fixtures/external_script.js
|
355
360
|
- test/unit/iframe.js
|
361
|
+
- test/unit/insertion.js
|
356
362
|
- test/unit/multi-window.js
|
357
363
|
- test/unit/nu.validator.js
|
358
364
|
- test/unit/onload.js
|
@@ -375,23 +381,27 @@ rdoc_options:
|
|
375
381
|
require_paths:
|
376
382
|
- lib
|
377
383
|
required_ruby_version: !ruby/object:Gem::Requirement
|
384
|
+
none: false
|
378
385
|
requirements:
|
379
386
|
- - ">="
|
380
387
|
- !ruby/object:Gem::Version
|
388
|
+
hash: 3
|
381
389
|
segments:
|
382
390
|
- 0
|
383
391
|
version: "0"
|
384
392
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
393
|
+
none: false
|
385
394
|
requirements:
|
386
395
|
- - ">="
|
387
396
|
- !ruby/object:Gem::Version
|
397
|
+
hash: 3
|
388
398
|
segments:
|
389
399
|
- 0
|
390
400
|
version: "0"
|
391
401
|
requirements: []
|
392
402
|
|
393
403
|
rubyforge_project: envjs
|
394
|
-
rubygems_version: 1.3.
|
404
|
+
rubygems_version: 1.3.7
|
395
405
|
signing_key:
|
396
406
|
specification_version: 3
|
397
407
|
summary: A browser environment for javascript interpreters
|