webshims-rails 1.14.5 → 1.14.6
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.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/lib/webshims-rails/version.rb +2 -2
- data/readme.textile +7 -0
- data/vendor/assets/javascripts/webshims/polyfiller.js +38 -6
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +26 -20
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +54 -19
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +32 -15
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +45 -21
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +45 -21
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +48 -24
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +32 -15
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +18 -81
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +48 -24
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +286 -179
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +19 -1
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +26 -20
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +311 -199
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +22 -17
- data/vendor/assets/javascripts/webshims/shims/combos/27.js +22 -17
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/combos/34.js +41 -5
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +32 -15
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +32 -15
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +48 -24
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +48 -24
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +54 -19
- data/vendor/assets/javascripts/webshims/shims/combos/98.js +24 -7
- data/vendor/assets/javascripts/webshims/shims/combos/99.js +24 -7
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +22 -4
- data/vendor/assets/javascripts/webshims/shims/es5.js +3 -1
- data/vendor/assets/javascripts/webshims/shims/es6.js +1 -5
- data/vendor/assets/javascripts/webshims/shims/filereader.js +22 -17
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +32 -15
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +18 -8
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-fa.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/jme/controls.css +11 -0
- data/vendor/assets/javascripts/webshims/shims/jme/controls.scss +16 -0
- data/vendor/assets/javascripts/webshims/shims/jme/mediacontrols-lazy.js +3 -20
- data/vendor/assets/javascripts/webshims/shims/jme/mediacontrols.js +24 -7
- data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +26 -20
- data/vendor/assets/javascripts/webshims/shims/mediaelement-debug.js +9 -1
- data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +267 -178
- data/vendor/assets/javascripts/webshims/shims/picture.js +18 -81
- data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +1 -9
- data/vendor/assets/javascripts/webshims/shims/sizzle.js +1 -8
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +4 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +5 -0
- data/vendor/assets/javascripts/webshims/shims/styles/shim-ext.css +4 -0
- data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/track.js +19 -1
- data/vendor/assets/javascripts/webshims/shims/url.js +316 -0
- data/vendor/assets/javascripts/webshims/shims/usermedia-core.js +28 -0
- data/vendor/assets/javascripts/webshims/shims/usermedia-shim.js +179 -0
- metadata +5 -3
- data/vendor/assets/javascripts/webshims/extras/modernizr-custom.js +0 -511
@@ -1,5 +1,4 @@
|
|
1
|
-
(function(){
|
2
|
-
"use strict";
|
1
|
+
webshim.ready('matchMedia', function($, webshim, w, doc, undefined){
|
3
2
|
try {
|
4
3
|
new Image();
|
5
4
|
} catch(e){
|
@@ -7,75 +6,8 @@
|
|
7
6
|
return document.createElement('img');
|
8
7
|
};
|
9
8
|
}
|
10
|
-
|
11
9
|
webshim.isReady('picture', true);
|
12
|
-
|
13
|
-
if(window.picturefill){
|
14
|
-
var sel = 'picture, img[srcset]';
|
15
|
-
webshim.addReady(function(context){
|
16
|
-
if(context.querySelector(sel)){
|
17
|
-
window.picturefill();
|
18
|
-
}
|
19
|
-
});
|
20
|
-
}
|
21
|
-
});
|
22
|
-
})();
|
23
|
-
/*! Picturefill - v2.1.0-beta - 2014-07-15
|
24
|
-
* http://scottjehl.github.io/picturefill
|
25
|
-
* Copyright (c) 2014 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
|
26
|
-
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
|
27
|
-
|
28
|
-
window.matchMedia || (window.matchMedia = function() {
|
29
|
-
"use strict";
|
30
|
-
|
31
|
-
// For browsers that support matchMedium api such as IE 9 and webkit
|
32
|
-
var styleMedia = (window.styleMedia || window.media);
|
33
|
-
|
34
|
-
// For those that don't support matchMedium
|
35
|
-
if (!styleMedia) {
|
36
|
-
var style = document.createElement('style'),
|
37
|
-
script = document.getElementsByTagName('script')[0],
|
38
|
-
info = null;
|
39
|
-
|
40
|
-
style.type = 'text/css';
|
41
|
-
style.id = 'matchmediajs-test';
|
42
|
-
|
43
|
-
script.parentNode.insertBefore(style, script);
|
44
|
-
|
45
|
-
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
46
|
-
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
47
|
-
|
48
|
-
styleMedia = {
|
49
|
-
matchMedium: function(media) {
|
50
|
-
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
51
|
-
|
52
|
-
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
53
|
-
if (style.styleSheet) {
|
54
|
-
style.styleSheet.cssText = text;
|
55
|
-
} else {
|
56
|
-
style.textContent = text;
|
57
|
-
}
|
58
|
-
|
59
|
-
// Test if media query is true or false
|
60
|
-
return info.width === '1px';
|
61
|
-
}
|
62
|
-
};
|
63
|
-
}
|
64
|
-
|
65
|
-
return function(media) {
|
66
|
-
return {
|
67
|
-
matches: styleMedia.matchMedium(media || 'all'),
|
68
|
-
media: media || 'all'
|
69
|
-
};
|
70
|
-
};
|
71
|
-
}());
|
72
|
-
/*! Picturefill - Responsive Images that work today.
|
73
|
-
* Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar )
|
74
|
-
* License: MIT/GPLv2
|
75
|
-
* Spec: http://picture.responsiveimages.org/
|
76
|
-
*/
|
77
|
-
(function( w, doc ) {
|
78
|
-
// Enable strict mode
|
10
|
+
// Enable strict mode
|
79
11
|
"use strict";
|
80
12
|
|
81
13
|
// If picture is supported, well, that's awesome. Let's get outta here...
|
@@ -490,6 +422,10 @@ window.matchMedia || (window.matchMedia = function() {
|
|
490
422
|
if ( source.nodeName.toUpperCase() !== "SOURCE" ) {
|
491
423
|
continue;
|
492
424
|
}
|
425
|
+
// if it's a source element that has the `src` property set, throw a warning in the console
|
426
|
+
if ( source.getAttribute( "src" ) !== null && typeof console !== undefined ){
|
427
|
+
console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");
|
428
|
+
}
|
493
429
|
|
494
430
|
var media = source.getAttribute( "media" );
|
495
431
|
|
@@ -626,17 +562,18 @@ window.matchMedia || (window.matchMedia = function() {
|
|
626
562
|
picturefill._ = pf;
|
627
563
|
|
628
564
|
/* expose picturefill */
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
} else if ( typeof define === "function" && define.amd ){
|
633
|
-
// AMD support
|
634
|
-
define( function() { return picturefill; } );
|
635
|
-
} else if ( typeof w === "object" ) {
|
636
|
-
// If no AMD and we are in the browser, attach to window
|
637
|
-
w.picturefill = picturefill;
|
638
|
-
}
|
565
|
+
w.picturefill = picturefill;
|
566
|
+
|
567
|
+
(function(){
|
639
568
|
|
640
|
-
|
569
|
+
webshim.isReady('picture', true);
|
570
|
+
var sel = 'picture, img[srcset]';
|
571
|
+
webshim.addReady(function(context){
|
572
|
+
if(context.querySelector(sel)){
|
573
|
+
window.picturefill();
|
574
|
+
}
|
575
|
+
});
|
576
|
+
})();
|
577
|
+
} );
|
641
578
|
|
642
579
|
|
@@ -9,15 +9,7 @@
|
|
9
9
|
* http://api.jqueryui.com/position/
|
10
10
|
*/
|
11
11
|
(function( factory ) {
|
12
|
-
|
13
|
-
|
14
|
-
// AMD. Register as an anonymous module.
|
15
|
-
define( [ "jquery" ], factory );
|
16
|
-
} else {
|
17
|
-
|
18
|
-
// Browser globals
|
19
|
-
factory( window.webshims && window.webshims.$ || jQuery );
|
20
|
-
}
|
12
|
+
factory( window.webshims && window.webshims.$ || jQuery );
|
21
13
|
}(function( $ ) {
|
22
14
|
(function() {
|
23
15
|
|
@@ -2031,14 +2031,7 @@
|
|
2031
2031
|
}
|
2032
2032
|
|
2033
2033
|
// EXPOSE
|
2034
|
-
|
2035
|
-
define(function() { return Sizzle; });
|
2036
|
-
// Sizzle requires that there be a global window in Common-JS like environments
|
2037
|
-
} else if ( typeof module !== "undefined" && module.exports ) {
|
2038
|
-
module.exports = Sizzle;
|
2039
|
-
} else {
|
2040
|
-
window.Sizzle = Sizzle;
|
2041
|
-
}
|
2034
|
+
window.Sizzle = Sizzle;
|
2042
2035
|
// EXPOSE
|
2043
2036
|
|
2044
2037
|
|
Binary file
|
@@ -456,11 +456,29 @@ webshims.register('track', function($, webshims, window, document, undefined){
|
|
456
456
|
webshims.error('you must provide a language for track in subtitles state');
|
457
457
|
}
|
458
458
|
obj.__wsmode = obj.mode;
|
459
|
+
|
460
|
+
webshims.defineProperty(obj, '_wsUpdateMode', {
|
461
|
+
value: function(){
|
462
|
+
$(mediaelem).triggerHandler('updatetrackdisplay');
|
463
|
+
},
|
464
|
+
enumerable: false
|
465
|
+
});
|
459
466
|
}
|
460
467
|
|
461
468
|
return obj;
|
462
469
|
};
|
463
470
|
|
471
|
+
if(!$.propHooks.mode){
|
472
|
+
$.propHooks.mode = {
|
473
|
+
set: function(obj, value){
|
474
|
+
obj.mode = value;
|
475
|
+
if(obj._wsUpdateMode && obj._wsUpdateMode.call){
|
476
|
+
obj._wsUpdateMode();
|
477
|
+
}
|
478
|
+
return obj.mode;
|
479
|
+
}
|
480
|
+
};
|
481
|
+
}
|
464
482
|
|
465
483
|
/*
|
466
484
|
taken from:
|
@@ -711,7 +729,7 @@ modified for webshims
|
|
711
729
|
var name = copyName[copyProp] || copyProp;
|
712
730
|
webshims.onNodeNamesPropertyModify('track', copyProp, function(){
|
713
731
|
var trackData = webshims.data(this, 'trackData');
|
714
|
-
|
732
|
+
|
715
733
|
if(trackData){
|
716
734
|
if(copyProp == 'kind'){
|
717
735
|
refreshTrack(this, trackData);
|
@@ -0,0 +1,316 @@
|
|
1
|
+
webshim.register('url', function($, webshims, window, document, undefined, options){
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
// URL Polyfill
|
5
|
+
// Draft specification: http://url.spec.whatwg.org
|
6
|
+
|
7
|
+
// Notes:
|
8
|
+
// - Primarily useful for parsing URLs and modifying query parameters
|
9
|
+
// - Should work in IE8+ and everything more modern
|
10
|
+
|
11
|
+
(function (global) {
|
12
|
+
// Browsers may have:
|
13
|
+
// * No global URL object
|
14
|
+
// * URL with static methods only - may have a dummy constructor
|
15
|
+
// * URL with members except searchParams
|
16
|
+
// * Full URL API support
|
17
|
+
var origURL = global.URL;
|
18
|
+
var nativeURL;
|
19
|
+
try {
|
20
|
+
if (origURL) {
|
21
|
+
nativeURL = new global.URL('http://example.com');
|
22
|
+
if ('searchParams' in nativeURL)
|
23
|
+
return;
|
24
|
+
if (!('href' in nativeURL))
|
25
|
+
nativeURL = undefined;
|
26
|
+
}
|
27
|
+
} catch (_) {}
|
28
|
+
|
29
|
+
function URLUtils(url) {
|
30
|
+
if (nativeURL)
|
31
|
+
return new origURL(url);
|
32
|
+
var anchor = document.createElement('a');
|
33
|
+
anchor.href = url;
|
34
|
+
return anchor;
|
35
|
+
}
|
36
|
+
|
37
|
+
global.URL = function URL(url, base) {
|
38
|
+
if (!(this instanceof global.URL))
|
39
|
+
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator.");
|
40
|
+
|
41
|
+
if (base) {
|
42
|
+
url = (function () {
|
43
|
+
if (nativeURL) return new origURL(url, base).href;
|
44
|
+
|
45
|
+
var doc;
|
46
|
+
// Use another document/base tag/anchor for relative URL resolution, if possible
|
47
|
+
if (document.implementation && document.implementation.createHTMLDocument) {
|
48
|
+
doc = document.implementation.createHTMLDocument('');
|
49
|
+
} else if (document.implementation && document.implementation.createDocument) {
|
50
|
+
doc = document.implementation.createElement('http://www.w3.org/1999/xhtml', 'html', null);
|
51
|
+
doc.documentElement.appendChild(doc.createElement('head'));
|
52
|
+
doc.documentElement.appendChild(doc.createElement('body'));
|
53
|
+
} else if (window.ActiveXObject) {
|
54
|
+
doc = new window.ActiveXObject('htmlfile');
|
55
|
+
doc.write('<head></head><body></body>');
|
56
|
+
doc.close();
|
57
|
+
}
|
58
|
+
|
59
|
+
if (!doc) throw Error('base not supported');
|
60
|
+
|
61
|
+
var baseTag = doc.createElement('base');
|
62
|
+
baseTag.href = base;
|
63
|
+
doc.getElementsByTagName('head')[0].appendChild(baseTag);
|
64
|
+
var anchor = doc.createElement('a');
|
65
|
+
anchor.href = url;
|
66
|
+
return anchor.href;
|
67
|
+
}());
|
68
|
+
}
|
69
|
+
|
70
|
+
// An inner object implementing URLUtils (either a native URL
|
71
|
+
// object or an HTMLAnchorElement instance) is used to perform the
|
72
|
+
// URL algorithms. With full ES5 getter/setter support, return a
|
73
|
+
// regular object For IE8's limited getter/setter support, a
|
74
|
+
// different HTMLAnchorElement is returned with properties
|
75
|
+
// overridden
|
76
|
+
|
77
|
+
var instance = URLUtils(url || '');
|
78
|
+
|
79
|
+
// Detect for ES5 getter/setter support
|
80
|
+
var ES5_GET_SET = (Object.defineProperties && (function () {
|
81
|
+
var o = {}; Object.defineProperties(o, { p: { 'get': function () { return true; } } }); return o.p;
|
82
|
+
}()));
|
83
|
+
|
84
|
+
var self = ES5_GET_SET ? this : document.createElement('a');
|
85
|
+
|
86
|
+
// NOTE: Doesn't do the encoding/decoding dance
|
87
|
+
function parse(input, isindex) {
|
88
|
+
var sequences = input.split('&');
|
89
|
+
if (isindex && sequences[0].indexOf('=') === -1)
|
90
|
+
sequences[0] = '=' + sequences[0];
|
91
|
+
var pairs = [];
|
92
|
+
sequences.forEach(function (bytes) {
|
93
|
+
if (bytes.length === 0) return;
|
94
|
+
var index = bytes.indexOf('=');
|
95
|
+
if (index !== -1) {
|
96
|
+
var name = bytes.substring(0, index);
|
97
|
+
var value = bytes.substring(index + 1);
|
98
|
+
} else {
|
99
|
+
name = bytes;
|
100
|
+
value = '';
|
101
|
+
}
|
102
|
+
name = name.replace('+', ' ');
|
103
|
+
value = value.replace('+', ' ');
|
104
|
+
pairs.push({ name: name, value: value });
|
105
|
+
});
|
106
|
+
var output = [];
|
107
|
+
pairs.forEach(function (pair) {
|
108
|
+
output.push({
|
109
|
+
name: decodeURIComponent(pair.name),
|
110
|
+
value: decodeURIComponent(pair.value)
|
111
|
+
});
|
112
|
+
});
|
113
|
+
return output; // Spec bug?
|
114
|
+
}
|
115
|
+
|
116
|
+
function URLSearchParams(url_object, init) {
|
117
|
+
var pairs = [];
|
118
|
+
if (init)
|
119
|
+
pairs = parse(init);
|
120
|
+
|
121
|
+
this._setPairs = function (list) { pairs = list; };
|
122
|
+
this._updateSteps = function () { updateSteps(); };
|
123
|
+
|
124
|
+
var updating = false;
|
125
|
+
function updateSteps() {
|
126
|
+
if (updating) return;
|
127
|
+
updating = true;
|
128
|
+
|
129
|
+
// TODO: For all associated url objects
|
130
|
+
url_object.search = serialize(pairs);
|
131
|
+
|
132
|
+
updating = false;
|
133
|
+
}
|
134
|
+
|
135
|
+
// NOTE: Doesn't do the encoding/decoding dance
|
136
|
+
function serialize(pairs) {
|
137
|
+
var output = '', first = true;
|
138
|
+
pairs.forEach(function (pair) {
|
139
|
+
var name = encodeURIComponent(pair.name);
|
140
|
+
var value = encodeURIComponent(pair.value);
|
141
|
+
if (!first) output += '&';
|
142
|
+
output += name + '=' + value;
|
143
|
+
first = false;
|
144
|
+
});
|
145
|
+
return output;
|
146
|
+
}
|
147
|
+
|
148
|
+
webshim.defineProperties(this, {
|
149
|
+
append: {
|
150
|
+
value: function (name, value) {
|
151
|
+
pairs.push({ name: name, value: value });
|
152
|
+
updateSteps();
|
153
|
+
}
|
154
|
+
},
|
155
|
+
|
156
|
+
'delete': {
|
157
|
+
value: function (name) {
|
158
|
+
for (var i = 0; i < pairs.length;) {
|
159
|
+
if (pairs[i].name === name)
|
160
|
+
pairs.splice(i, 1);
|
161
|
+
else
|
162
|
+
++i;
|
163
|
+
}
|
164
|
+
updateSteps();
|
165
|
+
}
|
166
|
+
},
|
167
|
+
|
168
|
+
get: {
|
169
|
+
value: function (name) {
|
170
|
+
for (var i = 0; i < pairs.length; ++i) {
|
171
|
+
if (pairs[i].name === name)
|
172
|
+
return pairs[i].value;
|
173
|
+
}
|
174
|
+
return null;
|
175
|
+
}
|
176
|
+
},
|
177
|
+
|
178
|
+
getAll: {
|
179
|
+
value: function (name) {
|
180
|
+
var result = [];
|
181
|
+
for (var i = 0; i < pairs.length; ++i) {
|
182
|
+
if (pairs[i].name === name)
|
183
|
+
result.push(pairs[i].value);
|
184
|
+
}
|
185
|
+
return result;
|
186
|
+
}
|
187
|
+
},
|
188
|
+
|
189
|
+
has: {
|
190
|
+
value: function (name) {
|
191
|
+
for (var i = 0; i < pairs.length; ++i) {
|
192
|
+
if (pairs[i].name === name)
|
193
|
+
return true;
|
194
|
+
}
|
195
|
+
return false;
|
196
|
+
}
|
197
|
+
},
|
198
|
+
|
199
|
+
set: {
|
200
|
+
value: function (name, value) {
|
201
|
+
var found = false;
|
202
|
+
for (var i = 0; i < pairs.length;) {
|
203
|
+
if (pairs[i].name === name) {
|
204
|
+
if (!found) {
|
205
|
+
pairs[i].value = value;
|
206
|
+
++i;
|
207
|
+
} else {
|
208
|
+
pairs.splice(i, 1);
|
209
|
+
}
|
210
|
+
} else {
|
211
|
+
++i;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
updateSteps();
|
215
|
+
}
|
216
|
+
},
|
217
|
+
|
218
|
+
toString: {
|
219
|
+
value: function () {
|
220
|
+
return serialize(pairs);
|
221
|
+
}
|
222
|
+
}
|
223
|
+
});
|
224
|
+
};
|
225
|
+
|
226
|
+
var queryObject = new URLSearchParams(
|
227
|
+
self, instance.search ? instance.search.substring(1) : null);
|
228
|
+
|
229
|
+
webshim.defineProperties(self, {
|
230
|
+
href: {
|
231
|
+
get: function () { return instance.href; },
|
232
|
+
set: function (v) { instance.href = v; tidy_instance(); update_steps(); }
|
233
|
+
},
|
234
|
+
origin: {
|
235
|
+
get: function () {
|
236
|
+
if ('origin' in instance) return instance.origin;
|
237
|
+
return this.protocol + '//' + this.host;
|
238
|
+
}
|
239
|
+
},
|
240
|
+
protocol: {
|
241
|
+
get: function () { return instance.protocol; },
|
242
|
+
set: function (v) { instance.protocol = v; }
|
243
|
+
},
|
244
|
+
username: {
|
245
|
+
get: function () { return instance.username; },
|
246
|
+
set: function (v) { instance.username = v; }
|
247
|
+
},
|
248
|
+
password: {
|
249
|
+
get: function () { return instance.password; },
|
250
|
+
set: function (v) { instance.password = v; }
|
251
|
+
},
|
252
|
+
host: {
|
253
|
+
get: function () {
|
254
|
+
// IE returns default port in |host|
|
255
|
+
var re = {'http:': /:80$/, 'https:': /:443$/, 'ftp:': /:21$/}[instance.protocol];
|
256
|
+
return re ? instance.host.replace(re, '') : instance.host;
|
257
|
+
},
|
258
|
+
set: function (v) { instance.host = v; }
|
259
|
+
},
|
260
|
+
hostname: {
|
261
|
+
get: function () { return instance.hostname; },
|
262
|
+
set: function (v) { instance.hostname = v; }
|
263
|
+
},
|
264
|
+
port: {
|
265
|
+
get: function () { return instance.port; },
|
266
|
+
set: function (v) { instance.port = v; }
|
267
|
+
},
|
268
|
+
pathname: {
|
269
|
+
get: function () {
|
270
|
+
// IE does not include leading '/' in |pathname|
|
271
|
+
if (instance.pathname.charAt(0) !== '/') return '/' + instance.pathname;
|
272
|
+
return instance.pathname;
|
273
|
+
},
|
274
|
+
set: function (v) { instance.pathname = v; }
|
275
|
+
},
|
276
|
+
search: {
|
277
|
+
get: function () { return instance.search; },
|
278
|
+
set: function (v) {
|
279
|
+
if (instance.search === v) return;
|
280
|
+
instance.search = v; tidy_instance(); update_steps();
|
281
|
+
}
|
282
|
+
},
|
283
|
+
searchParams: {
|
284
|
+
get: function () { return queryObject; }
|
285
|
+
// TODO: implement setter
|
286
|
+
},
|
287
|
+
hash: {
|
288
|
+
get: function () { return instance.hash; },
|
289
|
+
set: function (v) { instance.hash = v; tidy_instance(); }
|
290
|
+
}
|
291
|
+
});
|
292
|
+
|
293
|
+
function tidy_instance() {
|
294
|
+
var href = instance.href.replace(/#$|\?$|\?(?=#)/g, '');
|
295
|
+
if (instance.href !== href)
|
296
|
+
instance.href = href;
|
297
|
+
}
|
298
|
+
|
299
|
+
function update_steps() {
|
300
|
+
queryObject._setPairs(instance.search ? parse(instance.search.substring(1)) : []);
|
301
|
+
queryObject._updateSteps();
|
302
|
+
}
|
303
|
+
|
304
|
+
return self;
|
305
|
+
};
|
306
|
+
|
307
|
+
if (origURL) {
|
308
|
+
for (var i in origURL) {
|
309
|
+
if (origURL.hasOwnProperty(i))
|
310
|
+
global.URL[i] = origURL[i];
|
311
|
+
}
|
312
|
+
}
|
313
|
+
|
314
|
+
}(window));
|
315
|
+
|
316
|
+
});
|