wiki 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +10 -2
- data/bin/wiki +4 -0
- data/default-data/pages/how-to-wiki +1069 -0
- data/default-data/pages/welcome-visitors +336 -0
- data/default-data/status/favicon.png +0 -0
- data/default-data/status/local-identity +7 -0
- data/lib/wiki/favicon.rb +0 -1
- data/lib/wiki/page.rb +3 -6
- data/lib/wiki/server.rb +7 -3
- data/lib/wiki/version.rb +1 -1
- data/package.json +70 -0
- data/wiki.gemspec +20 -13
- metadata +205 -58
- data/lib/wiki/views/client/Gruntfile.js +0 -50
- data/lib/wiki/views/client/ReadMe.md +0 -67
- data/lib/wiki/views/client/build-test.bat +0 -10
- data/lib/wiki/views/client/build.bat +0 -8
- data/lib/wiki/views/client/builder.pl +0 -41
- data/lib/wiki/views/client/client.coffee +0 -3
- data/lib/wiki/views/client/client.js +0 -3607
- data/lib/wiki/views/client/crosses.png +0 -0
- data/lib/wiki/views/client/images/external-link-ltr-icon.png +0 -0
- data/lib/wiki/views/client/images/noise.png +0 -0
- data/lib/wiki/views/client/images/oops.jpg +0 -0
- data/lib/wiki/views/client/js/d3/d3.behavior.js +0 -198
- data/lib/wiki/views/client/js/d3/d3.chart.js +0 -984
- data/lib/wiki/views/client/js/d3/d3.csv.js +0 -92
- data/lib/wiki/views/client/js/d3/d3.geo.js +0 -566
- data/lib/wiki/views/client/js/d3/d3.geom.js +0 -825
- data/lib/wiki/views/client/js/d3/d3.js +0 -3597
- data/lib/wiki/views/client/js/d3/d3.layout.js +0 -1923
- data/lib/wiki/views/client/js/d3/d3.time.js +0 -660
- data/lib/wiki/views/client/js/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/wiki/views/client/js/images/ui-icons_222222_256x240.png +0 -0
- data/lib/wiki/views/client/js/jquery-1.6.2.min.js +0 -18
- data/lib/wiki/views/client/js/jquery-1.7.1.min.js +0 -4
- data/lib/wiki/views/client/js/jquery-1.9.1.min.js +0 -5
- data/lib/wiki/views/client/js/jquery-migrate-1.1.1.min.js +0 -3
- data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.css +0 -5
- data/lib/wiki/views/client/js/jquery-ui-1.10.1.custom.min.js +0 -6
- data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.css +0 -339
- data/lib/wiki/views/client/js/jquery-ui-1.8.16.custom.min.js +0 -315
- data/lib/wiki/views/client/js/jquery.ie.cors.js +0 -310
- data/lib/wiki/views/client/js/jquery.ui.touch-punch.min.js +0 -11
- data/lib/wiki/views/client/js/modernizr.custom.63710.js +0 -824
- data/lib/wiki/views/client/js/sockjs-0.3.min.js +0 -27
- data/lib/wiki/views/client/js/underscore-min.js +0 -30
- data/lib/wiki/views/client/mkplugin.sh +0 -97
- data/lib/wiki/views/client/package.json +0 -36
- data/lib/wiki/views/client/runtests.html +0 -26
- data/lib/wiki/views/client/style.css +0 -339
- data/lib/wiki/views/client/test/mocha.css +0 -231
- data/lib/wiki/views/client/test/mocha.js +0 -5340
- data/lib/wiki/views/client/test/testclient.js +0 -17133
- data/lib/wiki/views/client/testclient.coffee +0 -18
- data/lib/wiki/views/client/theme/granite.css +0 -59
- data/lib/wiki/views/client/theme/stoneSeamless.jpg +0 -0
- data/lib/wiki/views/client/twitter-maintainance.jpg +0 -0
@@ -1,310 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (C) 2011 Ovea <dev@ovea.com>
|
3
|
-
*
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
* you may not use this file except in compliance with the License.
|
6
|
-
* You may obtain a copy of the License at
|
7
|
-
*
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
*
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
* See the License for the specific language governing permissions and
|
14
|
-
* limitations under the License.
|
15
|
-
*/
|
16
|
-
/**
|
17
|
-
* https://gist.github.com/1114981
|
18
|
-
*
|
19
|
-
* By default, support transferring session cookie with XDomainRequest for IE. The cookie value is by default 'jsessionid'
|
20
|
-
*
|
21
|
-
* You can change the session cookie value like this, before including this script:
|
22
|
-
*
|
23
|
-
* window.XDR_SESSION_COOKIE_NAME = 'ID';
|
24
|
-
*
|
25
|
-
* Or if you want to disable cookie session support:
|
26
|
-
*
|
27
|
-
* window.XDR_SESSION_COOKIE_NAME = null;
|
28
|
-
*
|
29
|
-
* If you need to convert other cookies as headers:
|
30
|
-
*
|
31
|
-
* window.XDR_COOKIE_HEADERS = ['PHP_SESSION'];
|
32
|
-
*
|
33
|
-
* To DEBUG:
|
34
|
-
*
|
35
|
-
* window.XDR_DEBUG = true;
|
36
|
-
*
|
37
|
-
* To pass some headers:
|
38
|
-
*
|
39
|
-
* window.XDR_HEADERS = ['Content-Type', 'Accept']
|
40
|
-
*
|
41
|
-
*/
|
42
|
-
(function ($) {
|
43
|
-
|
44
|
-
if (!('__jquery_xdomain__' in $)
|
45
|
-
&& $.browser.msie // must be IE
|
46
|
-
&& 'XDomainRequest' in window // and support XDomainRequest (IE8+)
|
47
|
-
&& !(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()) // and must not support CORS (IE10+)
|
48
|
-
&& document.location.href.indexOf("file:///") == -1) { // and must not be local
|
49
|
-
|
50
|
-
$['__jquery_xdomain__'] = $.support.cors = true;
|
51
|
-
|
52
|
-
var urlMatcher = /^(((([^:\/#\?]+:)?(?:\/\/((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?]+)(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
|
53
|
-
oldxhr = $.ajaxSettings.xhr,
|
54
|
-
sessionCookie = 'XDR_SESSION_COOKIE_NAME' in window ? window['XDR_SESSION_COOKIE_NAME'] : "jsessionid",
|
55
|
-
cookies = 'XDR_COOKIE_HEADERS' in window ? window['XDR_COOKIE_HEADERS'] : [],
|
56
|
-
headers = 'XDR_HEADERS' in window ? window['XDR_HEADERS'] : ['Content-Type'],
|
57
|
-
ReadyState = {UNSENT:0, OPENED:1, LOADING:3, DONE:4},
|
58
|
-
debug = window['XDR_DEBUG'] && 'console' in window,
|
59
|
-
XDomainRequestAdapter,
|
60
|
-
domain,
|
61
|
-
reqId = 0;
|
62
|
-
|
63
|
-
function forEachCookie(names, fn) {
|
64
|
-
if (typeof names == 'string') {
|
65
|
-
names = [names];
|
66
|
-
}
|
67
|
-
var i, cookie;
|
68
|
-
for (i = 0; i < names.length; i++) {
|
69
|
-
cookie = new RegExp('(?:^|; )' + names[i] + '=([^;]*)', 'i').exec(document.cookie);
|
70
|
-
cookie = cookie && cookie[1];
|
71
|
-
if (cookie) {
|
72
|
-
fn.call(null, names[i], cookie);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
function parseResponse(str) {
|
78
|
-
// str === [data][header]~status~hlen~
|
79
|
-
// min: ~0~0~
|
80
|
-
if (str.length >= 5) {
|
81
|
-
// return[0] = status
|
82
|
-
// return[1] = data
|
83
|
-
// return[2] = header
|
84
|
-
var sub = str.substring(str.length <= 20 ? 0 : str.length - 20),
|
85
|
-
i = sub.length - 1,
|
86
|
-
end, hl, st;
|
87
|
-
if (sub.charAt(i) === '~') {
|
88
|
-
for (end = i--; i >= 0 && sub.charAt(i) !== '~'; i--);
|
89
|
-
hl = parseInt(sub.substring(i + 1, end));
|
90
|
-
if (!isNaN(hl) && hl >= 0 && i >= 2 && sub.charAt(i) === '~') {
|
91
|
-
for (end = i--; i >= 0 && sub.charAt(i) !== '~'; i--);
|
92
|
-
st = parseInt(sub.substring(i + 1, end));
|
93
|
-
if (!isNaN(st) && i >= 0 && sub.charAt(i) === '~') {
|
94
|
-
end = str.length - hl - sub.length + i;
|
95
|
-
return [st, str.substring(0, end), str.substr(end, hl)];
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
return [200, str, ''];
|
101
|
-
}
|
102
|
-
|
103
|
-
function parseUrl(url) {
|
104
|
-
if (typeof(url) === "object") {
|
105
|
-
return url;
|
106
|
-
}
|
107
|
-
var matches = urlMatcher.exec(url);
|
108
|
-
return matches ? {
|
109
|
-
href:matches[0] || "",
|
110
|
-
hrefNoHash:matches[1] || "",
|
111
|
-
hrefNoSearch:matches[2] || "",
|
112
|
-
domain:matches[3] || "",
|
113
|
-
protocol:matches[4] || "",
|
114
|
-
authority:matches[5] || "",
|
115
|
-
username:matches[7] || "",
|
116
|
-
password:matches[8] || "",
|
117
|
-
host:matches[9] || "",
|
118
|
-
hostname:matches[10] || "",
|
119
|
-
port:matches[11] || "",
|
120
|
-
pathname:matches[12] || "",
|
121
|
-
directory:matches[13] || "",
|
122
|
-
filename:matches[14] || "",
|
123
|
-
search:matches[15] || "",
|
124
|
-
hash:matches[16] || ""
|
125
|
-
} : {};
|
126
|
-
}
|
127
|
-
|
128
|
-
function parseCookies(header) {
|
129
|
-
if (header.length == 0) {
|
130
|
-
return [];
|
131
|
-
}
|
132
|
-
var cooks = [], i = 0, start = 0, end, dom;
|
133
|
-
do {
|
134
|
-
end = header.indexOf(',', start);
|
135
|
-
cooks[i] = (cooks[i] || '') + header.substring(start, end == -1 ? header.length : end);
|
136
|
-
start = end + 1;
|
137
|
-
if (cooks[i].indexOf('Expires=') == -1 || cooks[i].indexOf(',') != -1) {
|
138
|
-
i++;
|
139
|
-
} else {
|
140
|
-
cooks[i] += ',';
|
141
|
-
}
|
142
|
-
} while (end > 0);
|
143
|
-
for (i = 0; i < cooks.length; i++) {
|
144
|
-
dom = cooks[i].indexOf('Domain=');
|
145
|
-
if (dom != -1) {
|
146
|
-
cooks[i] = cooks[i].substring(0, dom) + cooks[i].substring(cooks[i].indexOf(';', dom) + 1);
|
147
|
-
}
|
148
|
-
}
|
149
|
-
return cooks;
|
150
|
-
}
|
151
|
-
|
152
|
-
domain = parseUrl(document.location.href).domain;
|
153
|
-
XDomainRequestAdapter = function () {
|
154
|
-
var self = this,
|
155
|
-
_xdr = new XDomainRequest(),
|
156
|
-
_mime,
|
157
|
-
_reqHeaders = [],
|
158
|
-
_method,
|
159
|
-
_url,
|
160
|
-
_id = reqId++,
|
161
|
-
_setState = function (state) {
|
162
|
-
self.readyState = state;
|
163
|
-
if (typeof self.onreadystatechange === 'function') {
|
164
|
-
self.onreadystatechange.call(self);
|
165
|
-
}
|
166
|
-
},
|
167
|
-
_done = function (state, code) {
|
168
|
-
if (!self.responseText) {
|
169
|
-
self.responseText = '';
|
170
|
-
}
|
171
|
-
if (debug) {
|
172
|
-
console.log('[XDR-' + _id + '] request end with state ' + state + ' and code ' + code + ' and data length ' + self.responseText.length);
|
173
|
-
}
|
174
|
-
self.status = code;
|
175
|
-
if (!self.responseType) {
|
176
|
-
_mime = _mime || _xdr.contentType;
|
177
|
-
if (_mime.match(/\/json/)) {
|
178
|
-
self.responseType = 'json';
|
179
|
-
self.response = self.responseText;
|
180
|
-
} else if (_mime.match(/\/xml/)) {
|
181
|
-
self.responseType = 'document';
|
182
|
-
var $error, dom = new ActiveXObject('Microsoft.XMLDOM');
|
183
|
-
dom.async = false;
|
184
|
-
dom.loadXML(self.responseText);
|
185
|
-
self.responseXML = self.response = dom;
|
186
|
-
if ($(dom).children('error').length != 0) {
|
187
|
-
$error = $(dom).find('error');
|
188
|
-
self.status = parseInt($error.attr('response_code'));
|
189
|
-
}
|
190
|
-
} else {
|
191
|
-
self.responseType = 'text';
|
192
|
-
self.response = self.responseText;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
_setState(state);
|
196
|
-
// clean memory
|
197
|
-
_xdr = null;
|
198
|
-
_reqHeaders = null;
|
199
|
-
_url = null;
|
200
|
-
};
|
201
|
-
_xdr.onprogress = function () {
|
202
|
-
_setState(ReadyState.LOADING);
|
203
|
-
};
|
204
|
-
_xdr.ontimeout = function () {
|
205
|
-
_done(ReadyState.DONE, 408);
|
206
|
-
};
|
207
|
-
_xdr.onerror = function () {
|
208
|
-
_done(ReadyState.DONE, 500);
|
209
|
-
};
|
210
|
-
_xdr.onload = function () {
|
211
|
-
// check if we are using a filter which modify the response
|
212
|
-
var cooks, i, resp = parseResponse(_xdr.responseText || '');
|
213
|
-
if (debug) {
|
214
|
-
console.log('[XDR-' + reqId + '] parsing cookies for header ' + resp[2]);
|
215
|
-
}
|
216
|
-
cooks = parseCookies(resp[2]);
|
217
|
-
self.responseText = resp[1] || '';
|
218
|
-
if (debug) {
|
219
|
-
console.log('[XDR-' + _id + '] raw data:\n' + _xdr.responseText + '\n parsed response: status=' + resp[0] + ', header=' + resp[2] + ', data=\n' + resp[1]);
|
220
|
-
}
|
221
|
-
for (i = 0; i < cooks.length; i++) {
|
222
|
-
if (debug) {
|
223
|
-
console.log('[XDR-' + _id + '] installing cookie ' + cooks[i]);
|
224
|
-
}
|
225
|
-
document.cookie = cooks[i] + ";Domain=" + document.domain;
|
226
|
-
}
|
227
|
-
_done(ReadyState.DONE, resp[0]);
|
228
|
-
resp = null;
|
229
|
-
};
|
230
|
-
this.readyState = ReadyState.UNSENT;
|
231
|
-
this.status = 0;
|
232
|
-
this.statusText = '';
|
233
|
-
this.responseType = '';
|
234
|
-
this.timeout = 0;
|
235
|
-
this.withCredentials = false;
|
236
|
-
this.overrideMimeType = function (mime) {
|
237
|
-
_mime = mime;
|
238
|
-
};
|
239
|
-
this.abort = function () {
|
240
|
-
_xdr.abort();
|
241
|
-
};
|
242
|
-
this.setRequestHeader = function (k, v) {
|
243
|
-
if ($.inArray(k, headers) >= 0) {
|
244
|
-
_reqHeaders.push({k:k, v:v});
|
245
|
-
}
|
246
|
-
};
|
247
|
-
this.open = function (m, u) {
|
248
|
-
_url = u;
|
249
|
-
_method = m;
|
250
|
-
_setState(ReadyState.OPENED);
|
251
|
-
};
|
252
|
-
this.send = function (data) {
|
253
|
-
_xdr.timeout = this.timeout;
|
254
|
-
if (sessionCookie || cookies || _reqHeaders.length) {
|
255
|
-
var h, addParam = function (name, value) {
|
256
|
-
var q = _url.indexOf('?');
|
257
|
-
_url += (q == -1 ? '?' : '&') + name + '=' + encodeURIComponent(value);
|
258
|
-
if (debug) {
|
259
|
-
console.log('[XDR-' + _id + '] added parameter ' + name + "=" + value + " => " + _url);
|
260
|
-
}
|
261
|
-
};
|
262
|
-
for (h = 0; h < _reqHeaders.length; h++) {
|
263
|
-
addParam(_reqHeaders[h].k, _reqHeaders[h].v);
|
264
|
-
}
|
265
|
-
forEachCookie(sessionCookie, function (name, value) {
|
266
|
-
var q = _url.indexOf('?');
|
267
|
-
if (q == -1) {
|
268
|
-
_url += ';' + name + '=' + value;
|
269
|
-
} else {
|
270
|
-
_url = _url.substring(0, q) + ';' + name + '=' + value + _url.substring(q);
|
271
|
-
}
|
272
|
-
if (debug) {
|
273
|
-
console.log('[XDR-' + _id + '] added cookie ' + _url);
|
274
|
-
}
|
275
|
-
});
|
276
|
-
forEachCookie(cookies, addParam);
|
277
|
-
addParam('_xdr', '' + _id);
|
278
|
-
}
|
279
|
-
if (debug) {
|
280
|
-
console.log('[XDR-' + _id + '] opening ' + _url);
|
281
|
-
}
|
282
|
-
_xdr.open(_method, _url);
|
283
|
-
if (debug) {
|
284
|
-
console.log('[XDR-' + _id + '] send, timeout=' + _xdr.timeout);
|
285
|
-
}
|
286
|
-
_xdr.send(data);
|
287
|
-
};
|
288
|
-
this.getAllResponseHeaders = function () {
|
289
|
-
return '';
|
290
|
-
};
|
291
|
-
this.getResponseHeader = function () {
|
292
|
-
return null;
|
293
|
-
}
|
294
|
-
};
|
295
|
-
|
296
|
-
$.ajaxSettings.xhr = function () {
|
297
|
-
var target = parseUrl(this.url).domain;
|
298
|
-
if (target === "" || target === domain) {
|
299
|
-
return oldxhr.call($.ajaxSettings);
|
300
|
-
} else {
|
301
|
-
try {
|
302
|
-
return new XDomainRequestAdapter();
|
303
|
-
} catch (e) {
|
304
|
-
}
|
305
|
-
}
|
306
|
-
};
|
307
|
-
|
308
|
-
}
|
309
|
-
})
|
310
|
-
(jQuery);
|
@@ -1,11 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* jQuery UI Touch Punch 0.1.0
|
3
|
-
*
|
4
|
-
* Copyright 2010, Dave Furfero
|
5
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
-
*
|
7
|
-
* Depends:
|
8
|
-
* jquery.ui.widget.js
|
9
|
-
* jquery.ui.mouse.js
|
10
|
-
*/
|
11
|
-
(function(c){c.support.touch=typeof Touch==="object";if(!c.support.touch){return;}var f=c.ui.mouse.prototype,g=f._mouseInit,a=f._mouseDown,e=f._mouseUp,b={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"};function d(h){var i=h.originalEvent.changedTouches[0];return c.extend(h,{type:b[h.type],which:1,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY});}f._mouseInit=function(){var h=this;h.element.bind("touchstart."+h.widgetName,function(i){return h._mouseDown(d(i));});g.call(h);};f._mouseDown=function(j){var h=this,i=a.call(h,j);h._touchMoveDelegate=function(k){return h._mouseMove(d(k));};h._touchEndDelegate=function(k){return h._mouseUp(d(k));};c(document).bind("touchmove."+h.widgetName,h._touchMoveDelegate).bind("touchend."+h.widgetName,h._touchEndDelegate);return i;};f._mouseUp=function(i){var h=this;c(document).unbind("touchmove."+h.widgetName,h._touchMoveDelegate).unbind("touchend."+h.widgetName,h._touchEndDelegate);return e.call(h,i);};})(jQuery);
|
@@ -1,824 +0,0 @@
|
|
1
|
-
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
|
2
|
-
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-cors-json-load
|
3
|
-
*/
|
4
|
-
;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
window.Modernizr = (function( window, document, undefined ) {
|
9
|
-
|
10
|
-
var version = '2.6.2',
|
11
|
-
|
12
|
-
Modernizr = {},
|
13
|
-
|
14
|
-
enableClasses = true,
|
15
|
-
|
16
|
-
docElement = document.documentElement,
|
17
|
-
|
18
|
-
mod = 'modernizr',
|
19
|
-
modElem = document.createElement(mod),
|
20
|
-
mStyle = modElem.style,
|
21
|
-
|
22
|
-
inputElem = document.createElement('input') ,
|
23
|
-
|
24
|
-
smile = ':)',
|
25
|
-
|
26
|
-
toString = {}.toString,
|
27
|
-
|
28
|
-
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
omPrefixes = 'Webkit Moz O ms',
|
33
|
-
|
34
|
-
cssomPrefixes = omPrefixes.split(' '),
|
35
|
-
|
36
|
-
domPrefixes = omPrefixes.toLowerCase().split(' '),
|
37
|
-
|
38
|
-
ns = {'svg': 'http://www.w3.org/2000/svg'},
|
39
|
-
|
40
|
-
tests = {},
|
41
|
-
inputs = {},
|
42
|
-
attrs = {},
|
43
|
-
|
44
|
-
classes = [],
|
45
|
-
|
46
|
-
slice = classes.slice,
|
47
|
-
|
48
|
-
featureName,
|
49
|
-
|
50
|
-
|
51
|
-
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
|
52
|
-
|
53
|
-
var style, ret, node, docOverflow,
|
54
|
-
div = document.createElement('div'),
|
55
|
-
body = document.body,
|
56
|
-
fakeBody = body || document.createElement('body');
|
57
|
-
|
58
|
-
if ( parseInt(nodes, 10) ) {
|
59
|
-
while ( nodes-- ) {
|
60
|
-
node = document.createElement('div');
|
61
|
-
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
|
62
|
-
div.appendChild(node);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
style = ['­','<style id="s', mod, '">', rule, '</style>'].join('');
|
67
|
-
div.id = mod;
|
68
|
-
(body ? div : fakeBody).innerHTML += style;
|
69
|
-
fakeBody.appendChild(div);
|
70
|
-
if ( !body ) {
|
71
|
-
fakeBody.style.background = '';
|
72
|
-
fakeBody.style.overflow = 'hidden';
|
73
|
-
docOverflow = docElement.style.overflow;
|
74
|
-
docElement.style.overflow = 'hidden';
|
75
|
-
docElement.appendChild(fakeBody);
|
76
|
-
}
|
77
|
-
|
78
|
-
ret = callback(div, rule);
|
79
|
-
if ( !body ) {
|
80
|
-
fakeBody.parentNode.removeChild(fakeBody);
|
81
|
-
docElement.style.overflow = docOverflow;
|
82
|
-
} else {
|
83
|
-
div.parentNode.removeChild(div);
|
84
|
-
}
|
85
|
-
|
86
|
-
return !!ret;
|
87
|
-
|
88
|
-
},
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
isEventSupported = (function() {
|
93
|
-
|
94
|
-
var TAGNAMES = {
|
95
|
-
'select': 'input', 'change': 'input',
|
96
|
-
'submit': 'form', 'reset': 'form',
|
97
|
-
'error': 'img', 'load': 'img', 'abort': 'img'
|
98
|
-
};
|
99
|
-
|
100
|
-
function isEventSupported( eventName, element ) {
|
101
|
-
|
102
|
-
element = element || document.createElement(TAGNAMES[eventName] || 'div');
|
103
|
-
eventName = 'on' + eventName;
|
104
|
-
|
105
|
-
var isSupported = eventName in element;
|
106
|
-
|
107
|
-
if ( !isSupported ) {
|
108
|
-
if ( !element.setAttribute ) {
|
109
|
-
element = document.createElement('div');
|
110
|
-
}
|
111
|
-
if ( element.setAttribute && element.removeAttribute ) {
|
112
|
-
element.setAttribute(eventName, '');
|
113
|
-
isSupported = is(element[eventName], 'function');
|
114
|
-
|
115
|
-
if ( !is(element[eventName], 'undefined') ) {
|
116
|
-
element[eventName] = undefined;
|
117
|
-
}
|
118
|
-
element.removeAttribute(eventName);
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
element = null;
|
123
|
-
return isSupported;
|
124
|
-
}
|
125
|
-
return isEventSupported;
|
126
|
-
})(),
|
127
|
-
|
128
|
-
|
129
|
-
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
|
130
|
-
|
131
|
-
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
|
132
|
-
hasOwnProp = function (object, property) {
|
133
|
-
return _hasOwnProperty.call(object, property);
|
134
|
-
};
|
135
|
-
}
|
136
|
-
else {
|
137
|
-
hasOwnProp = function (object, property) {
|
138
|
-
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
|
139
|
-
};
|
140
|
-
}
|
141
|
-
|
142
|
-
|
143
|
-
if (!Function.prototype.bind) {
|
144
|
-
Function.prototype.bind = function bind(that) {
|
145
|
-
|
146
|
-
var target = this;
|
147
|
-
|
148
|
-
if (typeof target != "function") {
|
149
|
-
throw new TypeError();
|
150
|
-
}
|
151
|
-
|
152
|
-
var args = slice.call(arguments, 1),
|
153
|
-
bound = function () {
|
154
|
-
|
155
|
-
if (this instanceof bound) {
|
156
|
-
|
157
|
-
var F = function(){};
|
158
|
-
F.prototype = target.prototype;
|
159
|
-
var self = new F();
|
160
|
-
|
161
|
-
var result = target.apply(
|
162
|
-
self,
|
163
|
-
args.concat(slice.call(arguments))
|
164
|
-
);
|
165
|
-
if (Object(result) === result) {
|
166
|
-
return result;
|
167
|
-
}
|
168
|
-
return self;
|
169
|
-
|
170
|
-
} else {
|
171
|
-
|
172
|
-
return target.apply(
|
173
|
-
that,
|
174
|
-
args.concat(slice.call(arguments))
|
175
|
-
);
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
};
|
180
|
-
|
181
|
-
return bound;
|
182
|
-
};
|
183
|
-
}
|
184
|
-
|
185
|
-
function setCss( str ) {
|
186
|
-
mStyle.cssText = str;
|
187
|
-
}
|
188
|
-
|
189
|
-
function setCssAll( str1, str2 ) {
|
190
|
-
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
|
191
|
-
}
|
192
|
-
|
193
|
-
function is( obj, type ) {
|
194
|
-
return typeof obj === type;
|
195
|
-
}
|
196
|
-
|
197
|
-
function contains( str, substr ) {
|
198
|
-
return !!~('' + str).indexOf(substr);
|
199
|
-
}
|
200
|
-
|
201
|
-
function testProps( props, prefixed ) {
|
202
|
-
for ( var i in props ) {
|
203
|
-
var prop = props[i];
|
204
|
-
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
|
205
|
-
return prefixed == 'pfx' ? prop : true;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
return false;
|
209
|
-
}
|
210
|
-
|
211
|
-
function testDOMProps( props, obj, elem ) {
|
212
|
-
for ( var i in props ) {
|
213
|
-
var item = obj[props[i]];
|
214
|
-
if ( item !== undefined) {
|
215
|
-
|
216
|
-
if (elem === false) return props[i];
|
217
|
-
|
218
|
-
if (is(item, 'function')){
|
219
|
-
return item.bind(elem || obj);
|
220
|
-
}
|
221
|
-
|
222
|
-
return item;
|
223
|
-
}
|
224
|
-
}
|
225
|
-
return false;
|
226
|
-
}
|
227
|
-
|
228
|
-
function testPropsAll( prop, prefixed, elem ) {
|
229
|
-
|
230
|
-
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
|
231
|
-
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
|
232
|
-
|
233
|
-
if(is(prefixed, "string") || is(prefixed, "undefined")) {
|
234
|
-
return testProps(props, prefixed);
|
235
|
-
|
236
|
-
} else {
|
237
|
-
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
|
238
|
-
return testDOMProps(props, prefixed, elem);
|
239
|
-
}
|
240
|
-
} tests['flexbox'] = function() {
|
241
|
-
return testPropsAll('flexWrap');
|
242
|
-
}; tests['canvas'] = function() {
|
243
|
-
var elem = document.createElement('canvas');
|
244
|
-
return !!(elem.getContext && elem.getContext('2d'));
|
245
|
-
};
|
246
|
-
|
247
|
-
tests['canvastext'] = function() {
|
248
|
-
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
|
249
|
-
};
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
tests['webgl'] = function() {
|
254
|
-
return !!window.WebGLRenderingContext;
|
255
|
-
};
|
256
|
-
|
257
|
-
|
258
|
-
tests['touch'] = function() {
|
259
|
-
var bool;
|
260
|
-
|
261
|
-
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
|
262
|
-
bool = true;
|
263
|
-
} else {
|
264
|
-
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
|
265
|
-
bool = node.offsetTop === 9;
|
266
|
-
});
|
267
|
-
}
|
268
|
-
|
269
|
-
return bool;
|
270
|
-
};
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
tests['geolocation'] = function() {
|
275
|
-
return 'geolocation' in navigator;
|
276
|
-
};
|
277
|
-
|
278
|
-
|
279
|
-
tests['postmessage'] = function() {
|
280
|
-
return !!window.postMessage;
|
281
|
-
};
|
282
|
-
|
283
|
-
|
284
|
-
tests['websqldatabase'] = function() {
|
285
|
-
return !!window.openDatabase;
|
286
|
-
};
|
287
|
-
|
288
|
-
tests['indexedDB'] = function() {
|
289
|
-
return !!testPropsAll("indexedDB", window);
|
290
|
-
};
|
291
|
-
|
292
|
-
tests['hashchange'] = function() {
|
293
|
-
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
|
294
|
-
};
|
295
|
-
|
296
|
-
tests['history'] = function() {
|
297
|
-
return !!(window.history && history.pushState);
|
298
|
-
};
|
299
|
-
|
300
|
-
tests['draganddrop'] = function() {
|
301
|
-
var div = document.createElement('div');
|
302
|
-
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
303
|
-
};
|
304
|
-
|
305
|
-
tests['websockets'] = function() {
|
306
|
-
return 'WebSocket' in window || 'MozWebSocket' in window;
|
307
|
-
};
|
308
|
-
|
309
|
-
|
310
|
-
tests['rgba'] = function() {
|
311
|
-
setCss('background-color:rgba(150,255,150,.5)');
|
312
|
-
|
313
|
-
return contains(mStyle.backgroundColor, 'rgba');
|
314
|
-
};
|
315
|
-
|
316
|
-
tests['hsla'] = function() {
|
317
|
-
setCss('background-color:hsla(120,40%,100%,.5)');
|
318
|
-
|
319
|
-
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
|
320
|
-
};
|
321
|
-
|
322
|
-
tests['multiplebgs'] = function() {
|
323
|
-
setCss('background:url(https://),url(https://),red url(https://)');
|
324
|
-
|
325
|
-
return (/(url\s*\(.*?){3}/).test(mStyle.background);
|
326
|
-
}; tests['backgroundsize'] = function() {
|
327
|
-
return testPropsAll('backgroundSize');
|
328
|
-
};
|
329
|
-
|
330
|
-
tests['borderimage'] = function() {
|
331
|
-
return testPropsAll('borderImage');
|
332
|
-
};
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
tests['borderradius'] = function() {
|
337
|
-
return testPropsAll('borderRadius');
|
338
|
-
};
|
339
|
-
|
340
|
-
tests['boxshadow'] = function() {
|
341
|
-
return testPropsAll('boxShadow');
|
342
|
-
};
|
343
|
-
|
344
|
-
tests['textshadow'] = function() {
|
345
|
-
return document.createElement('div').style.textShadow === '';
|
346
|
-
};
|
347
|
-
|
348
|
-
|
349
|
-
tests['opacity'] = function() {
|
350
|
-
setCssAll('opacity:.55');
|
351
|
-
|
352
|
-
return (/^0.55$/).test(mStyle.opacity);
|
353
|
-
};
|
354
|
-
|
355
|
-
|
356
|
-
tests['cssanimations'] = function() {
|
357
|
-
return testPropsAll('animationName');
|
358
|
-
};
|
359
|
-
|
360
|
-
|
361
|
-
tests['csscolumns'] = function() {
|
362
|
-
return testPropsAll('columnCount');
|
363
|
-
};
|
364
|
-
|
365
|
-
|
366
|
-
tests['cssgradients'] = function() {
|
367
|
-
var str1 = 'background-image:',
|
368
|
-
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
|
369
|
-
str3 = 'linear-gradient(left top,#9f9, white);';
|
370
|
-
|
371
|
-
setCss(
|
372
|
-
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
|
373
|
-
prefixes.join(str3 + str1)).slice(0, -str1.length)
|
374
|
-
);
|
375
|
-
|
376
|
-
return contains(mStyle.backgroundImage, 'gradient');
|
377
|
-
};
|
378
|
-
|
379
|
-
|
380
|
-
tests['cssreflections'] = function() {
|
381
|
-
return testPropsAll('boxReflect');
|
382
|
-
};
|
383
|
-
|
384
|
-
|
385
|
-
tests['csstransforms'] = function() {
|
386
|
-
return !!testPropsAll('transform');
|
387
|
-
};
|
388
|
-
|
389
|
-
|
390
|
-
tests['csstransforms3d'] = function() {
|
391
|
-
|
392
|
-
var ret = !!testPropsAll('perspective');
|
393
|
-
|
394
|
-
if ( ret && 'webkitPerspective' in docElement.style ) {
|
395
|
-
|
396
|
-
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
|
397
|
-
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
|
398
|
-
});
|
399
|
-
}
|
400
|
-
return ret;
|
401
|
-
};
|
402
|
-
|
403
|
-
|
404
|
-
tests['csstransitions'] = function() {
|
405
|
-
return testPropsAll('transition');
|
406
|
-
};
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
tests['fontface'] = function() {
|
411
|
-
var bool;
|
412
|
-
|
413
|
-
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
|
414
|
-
var style = document.getElementById('smodernizr'),
|
415
|
-
sheet = style.sheet || style.styleSheet,
|
416
|
-
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
|
417
|
-
|
418
|
-
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
|
419
|
-
});
|
420
|
-
|
421
|
-
return bool;
|
422
|
-
};
|
423
|
-
|
424
|
-
tests['generatedcontent'] = function() {
|
425
|
-
var bool;
|
426
|
-
|
427
|
-
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
|
428
|
-
bool = node.offsetHeight >= 3;
|
429
|
-
});
|
430
|
-
|
431
|
-
return bool;
|
432
|
-
};
|
433
|
-
tests['video'] = function() {
|
434
|
-
var elem = document.createElement('video'),
|
435
|
-
bool = false;
|
436
|
-
|
437
|
-
try {
|
438
|
-
if ( bool = !!elem.canPlayType ) {
|
439
|
-
bool = new Boolean(bool);
|
440
|
-
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
|
441
|
-
|
442
|
-
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
|
443
|
-
|
444
|
-
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
|
445
|
-
}
|
446
|
-
|
447
|
-
} catch(e) { }
|
448
|
-
|
449
|
-
return bool;
|
450
|
-
};
|
451
|
-
|
452
|
-
tests['audio'] = function() {
|
453
|
-
var elem = document.createElement('audio'),
|
454
|
-
bool = false;
|
455
|
-
|
456
|
-
try {
|
457
|
-
if ( bool = !!elem.canPlayType ) {
|
458
|
-
bool = new Boolean(bool);
|
459
|
-
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
|
460
|
-
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
|
461
|
-
|
462
|
-
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
|
463
|
-
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
|
464
|
-
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
|
465
|
-
}
|
466
|
-
} catch(e) { }
|
467
|
-
|
468
|
-
return bool;
|
469
|
-
};
|
470
|
-
|
471
|
-
|
472
|
-
tests['localstorage'] = function() {
|
473
|
-
try {
|
474
|
-
localStorage.setItem(mod, mod);
|
475
|
-
localStorage.removeItem(mod);
|
476
|
-
return true;
|
477
|
-
} catch(e) {
|
478
|
-
return false;
|
479
|
-
}
|
480
|
-
};
|
481
|
-
|
482
|
-
tests['sessionstorage'] = function() {
|
483
|
-
try {
|
484
|
-
sessionStorage.setItem(mod, mod);
|
485
|
-
sessionStorage.removeItem(mod);
|
486
|
-
return true;
|
487
|
-
} catch(e) {
|
488
|
-
return false;
|
489
|
-
}
|
490
|
-
};
|
491
|
-
|
492
|
-
|
493
|
-
tests['webworkers'] = function() {
|
494
|
-
return !!window.Worker;
|
495
|
-
};
|
496
|
-
|
497
|
-
|
498
|
-
tests['applicationcache'] = function() {
|
499
|
-
return !!window.applicationCache;
|
500
|
-
};
|
501
|
-
|
502
|
-
|
503
|
-
tests['svg'] = function() {
|
504
|
-
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
|
505
|
-
};
|
506
|
-
|
507
|
-
tests['inlinesvg'] = function() {
|
508
|
-
var div = document.createElement('div');
|
509
|
-
div.innerHTML = '<svg/>';
|
510
|
-
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
|
511
|
-
};
|
512
|
-
|
513
|
-
tests['smil'] = function() {
|
514
|
-
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
|
515
|
-
};
|
516
|
-
|
517
|
-
|
518
|
-
tests['svgclippaths'] = function() {
|
519
|
-
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
|
520
|
-
};
|
521
|
-
|
522
|
-
function webforms() {
|
523
|
-
Modernizr['input'] = (function( props ) {
|
524
|
-
for ( var i = 0, len = props.length; i < len; i++ ) {
|
525
|
-
attrs[ props[i] ] = !!(props[i] in inputElem);
|
526
|
-
}
|
527
|
-
if (attrs.list){
|
528
|
-
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
|
529
|
-
}
|
530
|
-
return attrs;
|
531
|
-
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
|
532
|
-
Modernizr['inputtypes'] = (function(props) {
|
533
|
-
|
534
|
-
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
|
535
|
-
|
536
|
-
inputElem.setAttribute('type', inputElemType = props[i]);
|
537
|
-
bool = inputElem.type !== 'text';
|
538
|
-
|
539
|
-
if ( bool ) {
|
540
|
-
|
541
|
-
inputElem.value = smile;
|
542
|
-
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
|
543
|
-
|
544
|
-
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
|
545
|
-
|
546
|
-
docElement.appendChild(inputElem);
|
547
|
-
defaultView = document.defaultView;
|
548
|
-
|
549
|
-
bool = defaultView.getComputedStyle &&
|
550
|
-
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
|
551
|
-
(inputElem.offsetHeight !== 0);
|
552
|
-
|
553
|
-
docElement.removeChild(inputElem);
|
554
|
-
|
555
|
-
} else if ( /^(search|tel)$/.test(inputElemType) ){
|
556
|
-
} else if ( /^(url|email)$/.test(inputElemType) ) {
|
557
|
-
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
|
558
|
-
|
559
|
-
} else {
|
560
|
-
bool = inputElem.value != smile;
|
561
|
-
}
|
562
|
-
}
|
563
|
-
|
564
|
-
inputs[ props[i] ] = !!bool;
|
565
|
-
}
|
566
|
-
return inputs;
|
567
|
-
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
|
568
|
-
}
|
569
|
-
for ( var feature in tests ) {
|
570
|
-
if ( hasOwnProp(tests, feature) ) {
|
571
|
-
featureName = feature.toLowerCase();
|
572
|
-
Modernizr[featureName] = tests[feature]();
|
573
|
-
|
574
|
-
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
|
575
|
-
}
|
576
|
-
}
|
577
|
-
|
578
|
-
Modernizr.input || webforms();
|
579
|
-
|
580
|
-
|
581
|
-
Modernizr.addTest = function ( feature, test ) {
|
582
|
-
if ( typeof feature == 'object' ) {
|
583
|
-
for ( var key in feature ) {
|
584
|
-
if ( hasOwnProp( feature, key ) ) {
|
585
|
-
Modernizr.addTest( key, feature[ key ] );
|
586
|
-
}
|
587
|
-
}
|
588
|
-
} else {
|
589
|
-
|
590
|
-
feature = feature.toLowerCase();
|
591
|
-
|
592
|
-
if ( Modernizr[feature] !== undefined ) {
|
593
|
-
return Modernizr;
|
594
|
-
}
|
595
|
-
|
596
|
-
test = typeof test == 'function' ? test() : test;
|
597
|
-
|
598
|
-
if (typeof enableClasses !== "undefined" && enableClasses) {
|
599
|
-
docElement.className += ' ' + (test ? '' : 'no-') + feature;
|
600
|
-
}
|
601
|
-
Modernizr[feature] = test;
|
602
|
-
|
603
|
-
}
|
604
|
-
|
605
|
-
return Modernizr;
|
606
|
-
};
|
607
|
-
|
608
|
-
|
609
|
-
setCss('');
|
610
|
-
modElem = inputElem = null;
|
611
|
-
|
612
|
-
;(function(window, document) {
|
613
|
-
var options = window.html5 || {};
|
614
|
-
|
615
|
-
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
616
|
-
|
617
|
-
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
618
|
-
|
619
|
-
var supportsHtml5Styles;
|
620
|
-
|
621
|
-
var expando = '_html5shiv';
|
622
|
-
|
623
|
-
var expanID = 0;
|
624
|
-
|
625
|
-
var expandoData = {};
|
626
|
-
|
627
|
-
var supportsUnknownElements;
|
628
|
-
|
629
|
-
(function() {
|
630
|
-
try {
|
631
|
-
var a = document.createElement('a');
|
632
|
-
a.innerHTML = '<xyz></xyz>';
|
633
|
-
supportsHtml5Styles = ('hidden' in a);
|
634
|
-
|
635
|
-
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
636
|
-
(document.createElement)('a');
|
637
|
-
var frag = document.createDocumentFragment();
|
638
|
-
return (
|
639
|
-
typeof frag.cloneNode == 'undefined' ||
|
640
|
-
typeof frag.createDocumentFragment == 'undefined' ||
|
641
|
-
typeof frag.createElement == 'undefined'
|
642
|
-
);
|
643
|
-
}());
|
644
|
-
} catch(e) {
|
645
|
-
supportsHtml5Styles = true;
|
646
|
-
supportsUnknownElements = true;
|
647
|
-
}
|
648
|
-
|
649
|
-
}()); function addStyleSheet(ownerDocument, cssText) {
|
650
|
-
var p = ownerDocument.createElement('p'),
|
651
|
-
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
652
|
-
|
653
|
-
p.innerHTML = 'x<style>' + cssText + '</style>';
|
654
|
-
return parent.insertBefore(p.lastChild, parent.firstChild);
|
655
|
-
}
|
656
|
-
|
657
|
-
function getElements() {
|
658
|
-
var elements = html5.elements;
|
659
|
-
return typeof elements == 'string' ? elements.split(' ') : elements;
|
660
|
-
}
|
661
|
-
|
662
|
-
function getExpandoData(ownerDocument) {
|
663
|
-
var data = expandoData[ownerDocument[expando]];
|
664
|
-
if (!data) {
|
665
|
-
data = {};
|
666
|
-
expanID++;
|
667
|
-
ownerDocument[expando] = expanID;
|
668
|
-
expandoData[expanID] = data;
|
669
|
-
}
|
670
|
-
return data;
|
671
|
-
}
|
672
|
-
|
673
|
-
function createElement(nodeName, ownerDocument, data){
|
674
|
-
if (!ownerDocument) {
|
675
|
-
ownerDocument = document;
|
676
|
-
}
|
677
|
-
if(supportsUnknownElements){
|
678
|
-
return ownerDocument.createElement(nodeName);
|
679
|
-
}
|
680
|
-
if (!data) {
|
681
|
-
data = getExpandoData(ownerDocument);
|
682
|
-
}
|
683
|
-
var node;
|
684
|
-
|
685
|
-
if (data.cache[nodeName]) {
|
686
|
-
node = data.cache[nodeName].cloneNode();
|
687
|
-
} else if (saveClones.test(nodeName)) {
|
688
|
-
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
689
|
-
} else {
|
690
|
-
node = data.createElem(nodeName);
|
691
|
-
}
|
692
|
-
|
693
|
-
return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node;
|
694
|
-
}
|
695
|
-
|
696
|
-
function createDocumentFragment(ownerDocument, data){
|
697
|
-
if (!ownerDocument) {
|
698
|
-
ownerDocument = document;
|
699
|
-
}
|
700
|
-
if(supportsUnknownElements){
|
701
|
-
return ownerDocument.createDocumentFragment();
|
702
|
-
}
|
703
|
-
data = data || getExpandoData(ownerDocument);
|
704
|
-
var clone = data.frag.cloneNode(),
|
705
|
-
i = 0,
|
706
|
-
elems = getElements(),
|
707
|
-
l = elems.length;
|
708
|
-
for(;i<l;i++){
|
709
|
-
clone.createElement(elems[i]);
|
710
|
-
}
|
711
|
-
return clone;
|
712
|
-
}
|
713
|
-
|
714
|
-
function shivMethods(ownerDocument, data) {
|
715
|
-
if (!data.cache) {
|
716
|
-
data.cache = {};
|
717
|
-
data.createElem = ownerDocument.createElement;
|
718
|
-
data.createFrag = ownerDocument.createDocumentFragment;
|
719
|
-
data.frag = data.createFrag();
|
720
|
-
}
|
721
|
-
|
722
|
-
|
723
|
-
ownerDocument.createElement = function(nodeName) {
|
724
|
-
if (!html5.shivMethods) {
|
725
|
-
return data.createElem(nodeName);
|
726
|
-
}
|
727
|
-
return createElement(nodeName, ownerDocument, data);
|
728
|
-
};
|
729
|
-
|
730
|
-
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
731
|
-
'var n=f.cloneNode(),c=n.createElement;' +
|
732
|
-
'h.shivMethods&&(' +
|
733
|
-
getElements().join().replace(/\w+/g, function(nodeName) {
|
734
|
-
data.createElem(nodeName);
|
735
|
-
data.frag.createElement(nodeName);
|
736
|
-
return 'c("' + nodeName + '")';
|
737
|
-
}) +
|
738
|
-
');return n}'
|
739
|
-
)(html5, data.frag);
|
740
|
-
} function shivDocument(ownerDocument) {
|
741
|
-
if (!ownerDocument) {
|
742
|
-
ownerDocument = document;
|
743
|
-
}
|
744
|
-
var data = getExpandoData(ownerDocument);
|
745
|
-
|
746
|
-
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
747
|
-
data.hasCSS = !!addStyleSheet(ownerDocument,
|
748
|
-
'article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}' +
|
749
|
-
'mark{background:#FF0;color:#000}'
|
750
|
-
);
|
751
|
-
}
|
752
|
-
if (!supportsUnknownElements) {
|
753
|
-
shivMethods(ownerDocument, data);
|
754
|
-
}
|
755
|
-
return ownerDocument;
|
756
|
-
} var html5 = {
|
757
|
-
|
758
|
-
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video',
|
759
|
-
|
760
|
-
'shivCSS': (options.shivCSS !== false),
|
761
|
-
|
762
|
-
'supportsUnknownElements': supportsUnknownElements,
|
763
|
-
|
764
|
-
'shivMethods': (options.shivMethods !== false),
|
765
|
-
|
766
|
-
'type': 'default',
|
767
|
-
|
768
|
-
'shivDocument': shivDocument,
|
769
|
-
|
770
|
-
createElement: createElement,
|
771
|
-
|
772
|
-
createDocumentFragment: createDocumentFragment
|
773
|
-
}; window.html5 = html5;
|
774
|
-
|
775
|
-
shivDocument(document);
|
776
|
-
|
777
|
-
}(this, document));
|
778
|
-
|
779
|
-
Modernizr._version = version;
|
780
|
-
|
781
|
-
Modernizr._prefixes = prefixes;
|
782
|
-
Modernizr._domPrefixes = domPrefixes;
|
783
|
-
Modernizr._cssomPrefixes = cssomPrefixes;
|
784
|
-
|
785
|
-
|
786
|
-
Modernizr.hasEvent = isEventSupported;
|
787
|
-
|
788
|
-
Modernizr.testProp = function(prop){
|
789
|
-
return testProps([prop]);
|
790
|
-
};
|
791
|
-
|
792
|
-
Modernizr.testAllProps = testPropsAll;
|
793
|
-
|
794
|
-
|
795
|
-
Modernizr.testStyles = injectElementWithStyles;
|
796
|
-
Modernizr.prefixed = function(prop, obj, elem){
|
797
|
-
if(!obj) {
|
798
|
-
return testPropsAll(prop, 'pfx');
|
799
|
-
} else {
|
800
|
-
return testPropsAll(prop, obj, elem);
|
801
|
-
}
|
802
|
-
};
|
803
|
-
|
804
|
-
|
805
|
-
docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
|
806
|
-
|
807
|
-
(enableClasses ? ' js ' + classes.join(' ') : '');
|
808
|
-
|
809
|
-
return Modernizr;
|
810
|
-
|
811
|
-
})(this, this.document);
|
812
|
-
/*yepnope1.5.4|WTFPL*/
|
813
|
-
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document);
|
814
|
-
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
|
815
|
-
// cors
|
816
|
-
// By Theodoor van Donge
|
817
|
-
Modernizr.addTest('cors', !!(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()));// native JSON support.
|
818
|
-
// developer.mozilla.org/en/JSON
|
819
|
-
|
820
|
-
// this will also succeed if you've loaded the JSON2.js polyfill ahead of time
|
821
|
-
// ... but that should be obvious. :)
|
822
|
-
|
823
|
-
Modernizr.addTest('json', !!window.JSON && !!JSON.parse);
|
824
|
-
;
|