@haxtheweb/create 0.1.2 → 0.1.3
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.
- package/{LICENSE → LICENSE.md} +2 -2
- package/dist/art.js +47 -0
- package/dist/create.js +398 -171
- package/dist/templates/webcomponent/hax/src/webcomponent.js +1 -1
- package/dist/utils.js +44 -0
- package/package.json +7 -7
- package/dist/templates/haxsite/default/.htaccess +0 -79
- package/dist/templates/haxsite/default/.nojekyll +0 -0
- package/dist/templates/haxsite/default/404.html +0 -43
- package/dist/templates/haxsite/default/CNAME +0 -0
- package/dist/templates/haxsite/default/Dockerfile +0 -15
- package/dist/templates/haxsite/default/LICENSE.md +0 -201
- package/dist/templates/haxsite/default/README.md +0 -38
- package/dist/templates/haxsite/default/adlcp_rootv1p2.xsd +0 -110
- package/dist/templates/haxsite/default/assets/banner.jpg +0 -0
- package/dist/templates/haxsite/default/assets/build-legacy.js +0 -1
- package/dist/templates/haxsite/default/assets/build-polyfills.js +0 -1
- package/dist/templates/haxsite/default/assets/favicon.ico +0 -0
- package/dist/templates/haxsite/default/assets/favicon.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-144x144.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-192x192.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-256x256.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-48x48.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-512x512.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-72x72.png +0 -0
- package/dist/templates/haxsite/default/assets/icon-96x96.png +0 -0
- package/dist/templates/haxsite/default/assets/legacy-outline.css +0 -25
- package/dist/templates/haxsite/default/assets/upgrade-browser.html +0 -136
- package/dist/templates/haxsite/default/browserconfig.xml +0 -11
- package/dist/templates/haxsite/default/build-haxcms.js +0 -123
- package/dist/templates/haxsite/default/build.js +0 -1
- package/dist/templates/haxsite/default/custom/Dockerfile +0 -15
- package/dist/templates/haxsite/default/custom/README.md +0 -20
- package/dist/templates/haxsite/default/custom/package.json +0 -27
- package/dist/templates/haxsite/default/custom/rollup.config.js +0 -20
- package/dist/templates/haxsite/default/custom/src/custom.js +0 -8
- package/dist/templates/haxsite/default/false +0 -0
- package/dist/templates/haxsite/default/files/.gitkeep +0 -0
- package/dist/templates/haxsite/default/ims_xml.xsd +0 -1
- package/dist/templates/haxsite/default/imscp_rootv1p1p2.xsd +0 -345
- package/dist/templates/haxsite/default/imsmanifest.xml +0 -57
- package/dist/templates/haxsite/default/imsmd_rootv1p2p1.xsd +0 -573
- package/dist/templates/haxsite/default/index.html +0 -211
- package/dist/templates/haxsite/default/index.php +0 -166
- package/dist/templates/haxsite/default/manifest.json +0 -65
- package/dist/templates/haxsite/default/offline.html +0 -11
- package/dist/templates/haxsite/default/package.json +0 -38
- package/dist/templates/haxsite/default/pages/.gitkeep +0 -0
- package/dist/templates/haxsite/default/polymer.json +0 -126
- package/dist/templates/haxsite/default/push-manifest.json +0 -8
- package/dist/templates/haxsite/default/robots.txt +0 -27
- package/dist/templates/haxsite/default/service-worker.js +0 -283
- package/dist/templates/haxsite/default/site.json +0 -39
- package/dist/templates/haxsite/default/theme/theme.css +0 -13
- package/dist/templates/haxsite/default/theme/theme.html +0 -46
- package/dist/templates/haxsite/default/web-dev-server.haxcms.config.cjs +0 -10
package/dist/utils.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SITE_FILE_NAME = void 0;
|
|
7
|
+
exports.dashToCamel = dashToCamel;
|
|
8
|
+
exports.generateUUID = generateUUID;
|
|
9
|
+
exports.readAllFiles = readAllFiles;
|
|
10
|
+
var fs = _interopRequireWildcard(require("node:fs"));
|
|
11
|
+
var path = _interopRequireWildcard(require("node:path"));
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const SITE_FILE_NAME = exports.SITE_FILE_NAME = "site.json";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Helper to convert dash to camel; important when reading attributes.
|
|
18
|
+
*/
|
|
19
|
+
function dashToCamel(str) {
|
|
20
|
+
return str.replace(/-([a-z])/g, function (g) {
|
|
21
|
+
return g[1].toUpperCase();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// generate unique-enough id
|
|
25
|
+
function generateUUID() {
|
|
26
|
+
return "ss-s-s-s-sss".replace(/s/g, _uuidPart);
|
|
27
|
+
}
|
|
28
|
+
function _uuidPart() {
|
|
29
|
+
return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// read in all files recursively for rewriting
|
|
33
|
+
function* readAllFiles(dir) {
|
|
34
|
+
const files = fs.readdirSync(dir, {
|
|
35
|
+
withFileTypes: true
|
|
36
|
+
});
|
|
37
|
+
for (const file of files) {
|
|
38
|
+
if (file.isDirectory()) {
|
|
39
|
+
yield* readAllFiles(path.join(dir, file.name));
|
|
40
|
+
} else {
|
|
41
|
+
yield path.join(dir, file.name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haxtheweb/create",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "CLI for all things HAX the web",
|
|
8
8
|
"author": "HAXTheWeb core team",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"engines": {
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"homepage": "https://hax.psu.edu/",
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "rm -rf dist && babel src --out-dir dist --copy-files --include-dotfiles",
|
|
23
|
-
"start": "npm run build && node ./dist/create.js",
|
|
24
|
-
"release": "commit-and-tag-version && git push --follow-tags origin main && npm publish"
|
|
22
|
+
"build": "rm -rf dist && babel src --out-dir dist --copy-files --include-dotfiles && chmod 774 dist/create.js",
|
|
23
|
+
"start": "npm run build && node ./dist/create.js && chmod 774 dist/create.js",
|
|
24
|
+
"release": "npm run build && commit-and-tag-version && git push --follow-tags origin main && npm publish"
|
|
25
25
|
},
|
|
26
26
|
"bin": {
|
|
27
27
|
"create-haxtheweb": "./dist/create.js"
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@clack/core": "0.3.4",
|
|
44
44
|
"@clack/prompts": "0.7.0",
|
|
45
45
|
"picocolors": "1.0.1",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
46
|
+
"ejs": "3.1.10",
|
|
47
|
+
"@haxtheweb/haxcms-nodejs": "0.0.13"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/cli": "^7.24.6",
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# Protect files and directories from prying eyes.
|
|
2
|
-
<FilesMatch "\.(make|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
|
|
3
|
-
<IfModule mod_authz_core.c>
|
|
4
|
-
Require all denied
|
|
5
|
-
</IfModule>
|
|
6
|
-
<IfModule !mod_authz_core.c>
|
|
7
|
-
Order allow,deny
|
|
8
|
-
</IfModule>
|
|
9
|
-
</FilesMatch>
|
|
10
|
-
# Don't show directory listings for URLs which map to a directory.
|
|
11
|
-
Options -Indexes
|
|
12
|
-
# Follow symbolic links in this directory.
|
|
13
|
-
Options +FollowSymLinks
|
|
14
|
-
# Set the default handler.
|
|
15
|
-
DirectoryIndex index.php index.html
|
|
16
|
-
# Override PHP settings that cannot be changed at runtime. See
|
|
17
|
-
<IfModule mod_php5.c>
|
|
18
|
-
php_flag magic_quotes_gpc off
|
|
19
|
-
php_flag magic_quotes_sybase off
|
|
20
|
-
php_flag register_globals off
|
|
21
|
-
php_flag session.auto_start off
|
|
22
|
-
php_value mbstring.http_input pass
|
|
23
|
-
php_value mbstring.http_output pass
|
|
24
|
-
php_flag mbstring.encoding_translation off
|
|
25
|
-
</IfModule>
|
|
26
|
-
# Requires mod_expires to be enabled.
|
|
27
|
-
<IfModule mod_expires.c>
|
|
28
|
-
# Enable expirations.
|
|
29
|
-
ExpiresActive On
|
|
30
|
-
# Cache all files for 2 weeks after access (A).
|
|
31
|
-
ExpiresDefault A1209600
|
|
32
|
-
<FilesMatch \.php$>
|
|
33
|
-
ExpiresActive Off
|
|
34
|
-
</FilesMatch>
|
|
35
|
-
</IfModule>
|
|
36
|
-
# Various rewrite rules.
|
|
37
|
-
<IfModule mod_rewrite.c>
|
|
38
|
-
RewriteEngine on
|
|
39
|
-
# Set "protossl" to "s" if we were accessed via https://. This is used later
|
|
40
|
-
# if you enable "www." stripping or enforcement, in order to ensure that
|
|
41
|
-
# you don't bounce between http and https.
|
|
42
|
-
RewriteRule ^ - [E=protossl]
|
|
43
|
-
RewriteCond %{HTTPS} on
|
|
44
|
-
RewriteRule ^ - [E=protossl:s]
|
|
45
|
-
# Make sure Authorization HTTP header is available to PHP
|
|
46
|
-
# even when running as CGI or FastCGI.
|
|
47
|
-
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
48
|
-
# Pass all requests not referring directly to files in the filesystem to
|
|
49
|
-
RewriteCond %{REQUEST_FILENAME} !-f
|
|
50
|
-
RewriteCond %{REQUEST_FILENAME} !-d
|
|
51
|
-
RewriteRule ^ . [L]
|
|
52
|
-
|
|
53
|
-
# Rules to correctly serve gzip compressed CSS and JS files.
|
|
54
|
-
# Requires both mod_rewrite and mod_headers to be enabled.
|
|
55
|
-
<IfModule mod_headers.c>
|
|
56
|
-
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
|
|
57
|
-
RewriteCond %{HTTP:Accept-encoding} gzip
|
|
58
|
-
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
|
59
|
-
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
|
|
60
|
-
# Serve gzip compressed JS files if they exist and the client accepts gzip.
|
|
61
|
-
RewriteCond %{HTTP:Accept-encoding} gzip
|
|
62
|
-
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
|
63
|
-
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
|
|
64
|
-
# Serve correct content types, and prevent mod_deflate double gzip.
|
|
65
|
-
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
|
|
66
|
-
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
|
|
67
|
-
<FilesMatch "(\.js\.gz|\.css\.gz)$">
|
|
68
|
-
# Serve correct encoding type.
|
|
69
|
-
Header set Content-Encoding gzip
|
|
70
|
-
# Force proxies to cache gzipped & non-gzipped css/js files separately.
|
|
71
|
-
Header append Vary Accept-Encoding
|
|
72
|
-
</FilesMatch>
|
|
73
|
-
</IfModule>
|
|
74
|
-
</IfModule>
|
|
75
|
-
# Add headers to all responses.
|
|
76
|
-
<IfModule mod_headers.c>
|
|
77
|
-
# Disable content sniffing, since it's an attack vector.
|
|
78
|
-
Header always set X-Content-Type-Options nosniff
|
|
79
|
-
</IfModule>
|
|
File without changes
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>Single Page Apps for GitHub Pages</title>
|
|
6
|
-
<script type="text/javascript">
|
|
7
|
-
// Single Page Apps for GitHub Pages
|
|
8
|
-
// https://github.com/rafrex/spa-github-pages
|
|
9
|
-
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
|
|
10
|
-
// ----------------------------------------------------------------------
|
|
11
|
-
// This script takes the current url and converts the path and query
|
|
12
|
-
// string into just a query string, and then redirects the browser
|
|
13
|
-
// to the new url with only a query string and hash fragment,
|
|
14
|
-
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
|
|
15
|
-
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
|
|
16
|
-
// Note: this 404.html file must be at least 512 bytes for it to work
|
|
17
|
-
// with Internet Explorer (it is currently > 512 bytes)
|
|
18
|
-
|
|
19
|
-
// If you're creating a Project Pages site and NOT using a custom domain,
|
|
20
|
-
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
|
|
21
|
-
// This way the code will only replace the route part of the path, and not
|
|
22
|
-
// the real directory in which the app resides, for example:
|
|
23
|
-
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
|
|
24
|
-
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
|
|
25
|
-
// Otherwise, leave segmentCount as 0.
|
|
26
|
-
var segmentCount = 0;
|
|
27
|
-
if (window.location.host.indexOf('github.io') != -1 && window.location.pathname.split('/').length > 1) {
|
|
28
|
-
segmentCount = 1;
|
|
29
|
-
}
|
|
30
|
-
var l = window.location;
|
|
31
|
-
l.replace(
|
|
32
|
-
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
|
33
|
-
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
|
|
34
|
-
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
|
|
35
|
-
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
|
36
|
-
l.hash
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
</script>
|
|
40
|
-
</head>
|
|
41
|
-
<body>
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
FROM haxtheweb/haxcms:2.0.9 as haxcms
|
|
2
|
-
|
|
3
|
-
FROM php:7.3-apache
|
|
4
|
-
|
|
5
|
-
RUN a2enmod rewrite
|
|
6
|
-
COPY ./services/haxcms/apache2.conf /etc/apache2/apache2.conf
|
|
7
|
-
|
|
8
|
-
COPY . /var/www/html
|
|
9
|
-
COPY --from=haxcms /var/www/html/build /var/www/html/build
|
|
10
|
-
COPY --from=haxcms /var/www/html/dist /var/www/html/dist
|
|
11
|
-
COPY --from=haxcms /var/www/html/system /var/www/html/system
|
|
12
|
-
COPY --from=haxcms /var/www/html/assets/babel-top.js /var/www/html/assets/babel-top.js
|
|
13
|
-
COPY --from=haxcms /var/www/html/assets/babel-bottom.js /var/www/html/assets/babel-bottom.js
|
|
14
|
-
COPY --from=haxcms /var/www/html/wc-registry.json /var/www/html/wc-registry.json
|
|
15
|
-
RUN chown -R www-data:www-data /var/www/html
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2018 The Pennsylvania State University
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# HAXsite
|
|
2
|
-
This is a HAXcms generated and managed micro-site. It can run on it's own but it was generated by a HAXcms system somewhere.
|
|
3
|
-
|
|
4
|
-
## Developer mode
|
|
5
|
-
HAXcms primary audience is people doing things entirely through the UI. It is however creating everything in a way that's very developer friendly though. This means you can peal this off from the original place it came from and run this as a stand alone repo by:
|
|
6
|
-
|
|
7
|
-
- leveraging the included package.json
|
|
8
|
-
- removing the symlinks to dist / node_modules / build
|
|
9
|
-
- copying the dist directory from the project root into your local setup: https://github.com/haxtheweb/haxcms/tree/master/dist
|
|
10
|
-
|
|
11
|
-
Using this approach you'll have to manage dependencies on your own but you'll be able to utilize custom themes / elements that you can to show up. If you do add any new elements or themes you'll need to ship this repo with the `polymer build` command executed in order to bundle / compile everything together for usage.
|
|
12
|
-
|
|
13
|
-
### special note
|
|
14
|
-
The CDN mirrors for HAXcms may or may not include the elements you wish to extend your project with so those options for rapid distributed publishing may not be availble.
|
|
15
|
-
|
|
16
|
-
# HAXcms
|
|
17
|
-
HAX CMS seeks to be the smallest possible back-end CMS to make HAX work and be able to build websites with it. Leveraging JSON Outline Schema, HAX is able to author multiple pages, which it then writes onto the file system.
|
|
18
|
-
|
|
19
|
-
# Customization capabilities as a developer
|
|
20
|
-
|
|
21
|
-
## Want to customize the theme via global CSS
|
|
22
|
-
- make changes to `theme/theme.css`
|
|
23
|
-
- This CSS loads on initial system load and CSS variables / ::part selectors can help override values
|
|
24
|
-
|
|
25
|
-
## Want to customize the JS that's run globally?
|
|
26
|
-
- make changes to `custom/build/custom.es6.js`
|
|
27
|
-
- This can also be modified as part of a built in build routine layed out in `custom/build`
|
|
28
|
-
- Assets can be built using the yarn / rollup routine that's included or manually writing JS into the files
|
|
29
|
-
|
|
30
|
-
Global JS could be used to load tracking code or inject your own custom element definitions so you can add your own web components in.
|
|
31
|
-
|
|
32
|
-
This can also be used to make a custom theme (modifying details in site.json to point to your theme element can make it load then)
|
|
33
|
-
|
|
34
|
-
## Need to customize something else?
|
|
35
|
-
https://github.com/elmsln/issues/issues or join the community on discord https://bit.ly/hax-discord and ask!
|
|
36
|
-
|
|
37
|
-
## License
|
|
38
|
-
[Apache 2.0](LICENSE.md)
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0"?>
|
|
2
|
-
<!-- filename=adlcp_rootv1p2.xsd -->
|
|
3
|
-
<!-- Conforms to w3c http://www.w3.org/TR/xmlschema-1/ 2000-10-24-->
|
|
4
|
-
|
|
5
|
-
<xsd:schema xmlns="http://www.adlnet.org/xsd/adlcp_rootv1p2"
|
|
6
|
-
targetNamespace="http://www.adlnet.org/xsd/adlcp_rootv1p2"
|
|
7
|
-
xmlns:xml="http://www.w3.org/XML/1998/namespace"
|
|
8
|
-
xmlns:imscp="http://www.imsproject.org/xsd/imscp_rootv1p1p2"
|
|
9
|
-
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
|
10
|
-
elementFormDefault="unqualified"
|
|
11
|
-
version="ADL Version 1.2">
|
|
12
|
-
|
|
13
|
-
<xsd:import namespace="http://www.imsproject.org/xsd/imscp_rootv1p1p2"
|
|
14
|
-
schemaLocation="imscp_rootv1p1p2.xsd"/>
|
|
15
|
-
|
|
16
|
-
<xsd:element name="location" type="locationType"/>
|
|
17
|
-
<xsd:element name="prerequisites" type="prerequisitesType"/>
|
|
18
|
-
<xsd:element name="maxtimeallowed" type="maxtimeallowedType"/>
|
|
19
|
-
<xsd:element name="timelimitaction" type="timelimitactionType"/>
|
|
20
|
-
<xsd:element name="datafromlms" type="datafromlmsType"/>
|
|
21
|
-
<xsd:element name="masteryscore" type="masteryscoreType"/>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<xsd:element name="schema" type="newSchemaType"/>
|
|
25
|
-
<xsd:simpleType name="newSchemaType">
|
|
26
|
-
<xsd:restriction base="imscp:schemaType">
|
|
27
|
-
<xsd:enumeration value="ADL SCORM"/>
|
|
28
|
-
</xsd:restriction>
|
|
29
|
-
</xsd:simpleType>
|
|
30
|
-
|
|
31
|
-
<xsd:element name="schemaversion" type="newSchemaversionType"/>
|
|
32
|
-
<xsd:simpleType name="newSchemaversionType">
|
|
33
|
-
<xsd:restriction base="imscp:schemaversionType">
|
|
34
|
-
<xsd:enumeration value="1.2"/>
|
|
35
|
-
</xsd:restriction>
|
|
36
|
-
</xsd:simpleType>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<xsd:attribute name="scormtype">
|
|
40
|
-
<xsd:simpleType>
|
|
41
|
-
<xsd:restriction base="xsd:string">
|
|
42
|
-
<xsd:enumeration value="asset"/>
|
|
43
|
-
<xsd:enumeration value="sco"/>
|
|
44
|
-
</xsd:restriction>
|
|
45
|
-
</xsd:simpleType>
|
|
46
|
-
</xsd:attribute>
|
|
47
|
-
|
|
48
|
-
<xsd:simpleType name="locationType">
|
|
49
|
-
<xsd:restriction base="xsd:string">
|
|
50
|
-
<xsd:maxLength value="2000"/>
|
|
51
|
-
</xsd:restriction>
|
|
52
|
-
</xsd:simpleType>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<xsd:complexType name="prerequisitesType">
|
|
56
|
-
<xsd:simpleContent>
|
|
57
|
-
<xsd:extension base="prerequisiteStringType">
|
|
58
|
-
<xsd:attributeGroup ref="attr.prerequisitetype"/>
|
|
59
|
-
</xsd:extension>
|
|
60
|
-
</xsd:simpleContent>
|
|
61
|
-
</xsd:complexType>
|
|
62
|
-
|
|
63
|
-
<xsd:attributeGroup name="attr.prerequisitetype">
|
|
64
|
-
<xsd:attribute name="type" use="required">
|
|
65
|
-
<xsd:simpleType>
|
|
66
|
-
<xsd:restriction base="xsd:string">
|
|
67
|
-
<xsd:enumeration value="aicc_script"/>
|
|
68
|
-
</xsd:restriction>
|
|
69
|
-
</xsd:simpleType>
|
|
70
|
-
</xsd:attribute>
|
|
71
|
-
</xsd:attributeGroup>
|
|
72
|
-
|
|
73
|
-
<xsd:simpleType name="maxtimeallowedType">
|
|
74
|
-
<xsd:restriction base="xsd:string">
|
|
75
|
-
<xsd:maxLength value="13"/>
|
|
76
|
-
</xsd:restriction>
|
|
77
|
-
</xsd:simpleType>
|
|
78
|
-
|
|
79
|
-
<xsd:simpleType name="timelimitactionType">
|
|
80
|
-
<xsd:restriction base="stringType">
|
|
81
|
-
<xsd:enumeration value="exit,no message"/>
|
|
82
|
-
<xsd:enumeration value="exit,message"/>
|
|
83
|
-
<xsd:enumeration value="continue,no message"/>
|
|
84
|
-
<xsd:enumeration value="continue,message"/>
|
|
85
|
-
</xsd:restriction>
|
|
86
|
-
</xsd:simpleType>
|
|
87
|
-
|
|
88
|
-
<xsd:simpleType name="datafromlmsType">
|
|
89
|
-
<xsd:restriction base="xsd:string">
|
|
90
|
-
<xsd:maxLength value="255"/>
|
|
91
|
-
</xsd:restriction>
|
|
92
|
-
</xsd:simpleType>
|
|
93
|
-
|
|
94
|
-
<xsd:simpleType name="masteryscoreType">
|
|
95
|
-
<xsd:restriction base="xsd:string">
|
|
96
|
-
<xsd:maxLength value="200"/>
|
|
97
|
-
</xsd:restriction>
|
|
98
|
-
</xsd:simpleType>
|
|
99
|
-
|
|
100
|
-
<xsd:simpleType name="stringType">
|
|
101
|
-
<xsd:restriction base="xsd:string"/>
|
|
102
|
-
</xsd:simpleType>
|
|
103
|
-
|
|
104
|
-
<xsd:simpleType name="prerequisiteStringType">
|
|
105
|
-
<xsd:restriction base="xsd:string">
|
|
106
|
-
<xsd:maxLength value="200"/>
|
|
107
|
-
</xsd:restriction>
|
|
108
|
-
</xsd:simpleType>
|
|
109
|
-
|
|
110
|
-
</xsd:schema>
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var ancient=!1;window.WCGlobalCDNPath&&window.WCGlobalCDNPath,window.__appCDN&&window.__appCDN;try{"undefined"==typeof Symbol&&(ancient=!0),new Function("let a;")}catch(err){ancient=!0}(window.__appForceUpgrade||window.WCForceUpgrade)&&ancient&&(window.location="assets/upgrade-browser.html");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t,e,n,o,r;t=window,e=document,!t.getSelection&&e.selection&&(n=null,t.getSelection=function(){return null!=n?n:n=new o},e.createRange=function(){return new Range},e.attachEvent("onkeydown",(function(){return t.getSelection().setRangeAt(0,new Range(!0))})),e.attachEvent("onselectionchange",(function(){var n,o;return t.getSelection().setRangeAt(0,new Range(!0)),"INPUT"===(n=e.selection.createRange().parentElement()).tagName||"TEXTAREA"===n.tagName?(o=t.getSelection().getRangeAt(0),n.selectionStart=o.selectionStart,n.selectionEnd=o.selectionEnd):void 0})),t.Range=function(){function t(t){t?this.range=e.selection.createRange():(this.range=e.body.createTextRange(),this.collapse(!0)),this.init()}return t.END_TO_END="EndToEnd",t.END_TO_START="EndToStart",t.START_TO_END="StartToEnd",t.START_TO_START="StartToStart",t.prototype.init=function(){var t,e,n,o,i,a;return e=this.range.parentElement(),this.commonAncestorContainer=e,this.collapsed=0===this.compareBoundaryPoints("StartToEnd",this),(a=this.range.duplicate()).moveToElementText(e),t=this.range.text.length>0?0:1,i=r.findLength("StartToStart",a,this.range),n=r.findNodeByPos(e,i,t),this.startContainer=n.el,this.startOffset=n.offset,o=r.findLength("StartToEnd",a,this.range),n=r.findNodeByPos(e,o,1),this.endContainer=n.el,this.endOffset=n.offset,this.selectionStart=r.findLength("StartToStart",a,this.range,!0),this.selectionEnd=r.findLength("StartToEnd",a,this.range,!0)},t.prototype.select=function(){return this.range.select()},t.prototype.setStart=function(t,e){var n,o;return r.getText(t).length>=e&&e>=0?(o=this.range.duplicate(),3===t.nodeType&&(n=r.findPosFromNode(t),o.moveToElementText(t.parentNode),o.moveStart("character",n+e)),-1===this.range.compareEndPoints("StartToEnd",o)&&this.range.setEndPoint("EndToStart",o),this.range.setEndPoint("StartToStart",o)):void 0},t.prototype.setEnd=function(t,e){var n,o;return r.getText(t).length>=e&&e>=0?(o=this.range.duplicate(),3===t.nodeType&&(n=r.findPosFromNode(t),o.moveToElementText(t.parentNode),o.moveStart("character",n+e)),this.range.setEndPoint("EndToStart",o)):void 0},t.prototype.selectNodeContents=function(t){return this.range.moveToElementText(t)},t.prototype.collapse=function(t){return t?this.range.setEndPoint("EndToStart",this.range):this.range.setEndPoint("StartToEnd",this.range)},t.prototype.compareBoundaryPoints=function(t,e){return this.range.compareEndPoints(t,e.range)},t.prototype.cloneRange=function(){var e;return(e=new t).range=this.range.duplicate(),e.init(),e},t.prototype.detach=function(){return delete this.range},t.prototype.getBoundingClientRect=function(){var e;return{width:(e=this.range.getBoundingClientRect()).right-e.left,height:e.bottom-e.top,left:e.left,right:e.right,bottom:e.bottom,top:e.top}},t.prototype.toString=function(){return this.range.text||""},t}(),o=function(){function t(){this.selection=e.selection,this.ranges=[],this.init()}return t.prototype.init=function(){var t,e,n,o,r;return this.rangeCount=this.ranges.length,this.rangeCount?(e=this.ranges[0],null==this.prev&&(this.prev=e),0===e.compareBoundaryPoints(Range.END_TO_END,this.prev)?(t=(o=["end","start"])[0],n=o[1]):(t=(r=["start","end"])[0],n=r[1]),this.anchorNode=e[t+"Container"],this.anchorOffset=e[t+"Offset"],this.focusNode=e[n+"Container"],this.focusOffset=e[n+"Offset"],this.isCollapsed=this.anchorNode===this.focusNode):void 0},t.prototype.getRangeAt=function(t){return this.ranges[t]},t.prototype.setRangeAt=function(t,e){return this.prev=this.ranges[t],this.ranges[t]=e,this.init()},t.prototype.removeAllRanges=function(){return this.ranges=[],this.init()},t.prototype.addRange=function(t){var e,n,o,r,i;for(this.ranges.push(t),this.init(),i=[],n=0,o=(r=this.ranges).length;o>n;n++)e=r[n],i.push(e.select());return i},t.prototype.deleteFromDocument=function(){return this.selection.clear()},t.prototype.toString=function(){return this.ranges[0].toString()},t}(),r={convertLineBreaks:function(t){return t.replace(/\r\n/g,"\n")},stripLineBreaks:function(t){return t.replace(/\r\n/g,"")},getText:function(t){return t.innerText||t.nodeValue},findLength:function(t,e,n,o){var i;switch(i=e.duplicate(),t){case"StartToStart":i.setEndPoint("EndToStart",n);break;case"StartToEnd":i.setEndPoint("EndToEnd",n)}return o?r.convertLineBreaks(i.text).length:r.stripLineBreaks(i.text).length},findNodeByPos:function(t,e,n){var o,r;return null==n&&(n=0),(o=function(t,e,n,r){var i,a,s,h,c;for(c=[],a=0,s=(h=t.childNodes).length;s>a;a++)if(i=h[a],!r.found)if(3===i.nodeType){if(r.length+i.length+n>e){r.found=!0,r.el=i,r.offset=e-r.length;break}c.push(r.length+=i.length)}else c.push(o(i,e,n,r));return c})(t,e,n,r={length:0,el:t,offset:0}),r},findPosFromNode:function(t){var e,n,o;return n={pos:0},o=t.parentNode,(e=function(t,n,o){var r,i,a,s,h;for(h=[],i=0,a=(s=t.childNodes).length;a>i;i++)if(r=s[i],!o.found){if(r===n){o.found=!0;break}3===r.nodeType?h.push(o.pos+=r.length):r.hasChildNodes()?h.push(e(r,n,o)):h.push(void 0)}return h})(o,t,n),n.pos}}),"NodeList"in window&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(callback,thisArg){thisArg=thisArg||window;for(var i=0;i<this.length;i++)callback.call(thisArg,this[i],i,this)}),Object.entries||(Object.entries=function(obj){for(var ownProps=Object.keys(obj),i=ownProps.length,resArray=new Array(i);i--;)resArray[i]=[ownProps[i],obj[ownProps[i]]];return resArray}),Object.is||Object.defineProperty(Object,"is",{value:function(x,y){return x===y?0!==x||1/x==1/y:x!=x&&y!=y}}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(predicate){if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if("function"!=typeof predicate)throw new TypeError("predicate must be a function");for(var thisArg=arguments[1],k=0;k<len;){var kValue=o[k];if(predicate.call(thisArg,kValue,k,o))return kValue;k++}}}),String.prototype.includes||(String.prototype.includes=function(search,start){return"number"!=typeof start&&(start=0),!(start+search.length>this.length)&&-1!==this.indexOf(search,start)}),Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(searchElement,fromIndex){if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if(0===len)return!1;var x,y,n=0|fromIndex,k=Math.max(n>=0?n:len-Math.abs(n),0);for(;k<len;){if((x=o[k])===(y=searchElement)||"number"==typeof x&&"number"==typeof y&&isNaN(x)&&isNaN(y))return!0;k++}return!1}}),function(){if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var document=function(startDoc){for(var doc=window.document,frame=getFrameElement(doc);frame;)frame=getFrameElement(doc=frame.ownerDocument);return doc}(),registry=[],crossOriginUpdater=null,crossOriginRect=null;IntersectionObserver.prototype.THROTTLE_TIMEOUT=100,IntersectionObserver.prototype.POLL_INTERVAL=null,IntersectionObserver.prototype.USE_MUTATION_OBSERVER=!0,IntersectionObserver._setupCrossOriginUpdater=function(){return crossOriginUpdater||(crossOriginUpdater=function(boundingClientRect,intersectionRect){crossOriginRect=boundingClientRect&&intersectionRect?convertFromParentRect(boundingClientRect,intersectionRect):{top:0,bottom:0,left:0,right:0,width:0,height:0},registry.forEach((function(observer){observer._checkForIntersections()}))}),crossOriginUpdater},IntersectionObserver._resetCrossOriginUpdater=function(){crossOriginUpdater=null,crossOriginRect=null},IntersectionObserver.prototype.observe=function(target){if(!this._observationTargets.some((function(item){return item.element==target}))){if(!target||1!=target.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:target,entry:null}),this._monitorIntersections(target.ownerDocument),this._checkForIntersections()}},IntersectionObserver.prototype.unobserve=function(target){this._observationTargets=this._observationTargets.filter((function(item){return item.element!=target})),this._unmonitorIntersections(target.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},IntersectionObserver.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},IntersectionObserver.prototype.takeRecords=function(){var records=this._queuedEntries.slice();return this._queuedEntries=[],records},IntersectionObserver.prototype._initThresholds=function(opt_threshold){var threshold=opt_threshold||[0];return Array.isArray(threshold)||(threshold=[threshold]),threshold.sort().filter((function(t,i,a){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==a[i-1]}))},IntersectionObserver.prototype._parseRootMargin=function(opt_rootMargin){var margins=(opt_rootMargin||"0px").split(/\s+/).map((function(margin){var parts=/^(-?\d*\.?\d+)(px|%)$/.exec(margin);if(!parts)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(parts[1]),unit:parts[2]}}));return margins[1]=margins[1]||margins[0],margins[2]=margins[2]||margins[0],margins[3]=margins[3]||margins[1],margins},IntersectionObserver.prototype._monitorIntersections=function(doc){var win=doc.defaultView;if(win&&-1==this._monitoringDocuments.indexOf(doc)){var callback=this._checkForIntersections,monitoringInterval=null,domObserver=null;this.POLL_INTERVAL?monitoringInterval=win.setInterval(callback,this.POLL_INTERVAL):(addEvent(win,"resize",callback,!0),addEvent(doc,"scroll",callback,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in win&&(domObserver=new win.MutationObserver(callback)).observe(doc,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(doc),this._monitoringUnsubscribes.push((function(){var win=doc.defaultView;win&&(monitoringInterval&&win.clearInterval(monitoringInterval),removeEvent(win,"resize",callback,!0)),removeEvent(doc,"scroll",callback,!0),domObserver&&domObserver.disconnect()}));var rootDoc=this.root&&(this.root.ownerDocument||this.root)||document;if(doc!=rootDoc){var frame=getFrameElement(doc);frame&&this._monitorIntersections(frame.ownerDocument)}}},IntersectionObserver.prototype._unmonitorIntersections=function(doc){var index=this._monitoringDocuments.indexOf(doc);if(-1!=index){var rootDoc=this.root&&(this.root.ownerDocument||this.root)||document;if(!this._observationTargets.some((function(item){var itemDoc=item.element.ownerDocument;if(itemDoc==doc)return!0;for(;itemDoc&&itemDoc!=rootDoc;){var frame=getFrameElement(itemDoc);if((itemDoc=frame&&frame.ownerDocument)==doc)return!0}return!1}))){var unsubscribe=this._monitoringUnsubscribes[index];if(this._monitoringDocuments.splice(index,1),this._monitoringUnsubscribes.splice(index,1),unsubscribe(),doc!=rootDoc){var frame=getFrameElement(doc);frame&&this._unmonitorIntersections(frame.ownerDocument)}}}},IntersectionObserver.prototype._unmonitorAllIntersections=function(){var unsubscribes=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var i=0;i<unsubscribes.length;i++)unsubscribes[i]()},IntersectionObserver.prototype._checkForIntersections=function(){if(this.root||!crossOriginUpdater||crossOriginRect){var rootIsInDom=this._rootIsInDom(),rootRect=rootIsInDom?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(item){var target=item.element,targetRect=getBoundingClientRect(target),rootContainsTarget=this._rootContainsTarget(target),oldEntry=item.entry,intersectionRect=rootIsInDom&&rootContainsTarget&&this._computeTargetAndRootIntersection(target,targetRect,rootRect),rootBounds=null;this._rootContainsTarget(target)?crossOriginUpdater&&!this.root||(rootBounds=rootRect):rootBounds={top:0,bottom:0,left:0,right:0,width:0,height:0};var newEntry=item.entry=new IntersectionObserverEntry({time:window.performance&&performance.now&&performance.now(),target,boundingClientRect:targetRect,rootBounds,intersectionRect});oldEntry?rootIsInDom&&rootContainsTarget?this._hasCrossedThreshold(oldEntry,newEntry)&&this._queuedEntries.push(newEntry):oldEntry&&oldEntry.isIntersecting&&this._queuedEntries.push(newEntry):this._queuedEntries.push(newEntry)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},IntersectionObserver.prototype._computeTargetAndRootIntersection=function(target,targetRect,rootRect){if("none"!=window.getComputedStyle(target).display){for(var rect1,rect2,top,bottom,left,right,width,height,intersectionRect=targetRect,parent=getParentNode(target),atRoot=!1;!atRoot&&parent;){var parentRect=null,parentComputedStyle=1==parent.nodeType?window.getComputedStyle(parent):{};if("none"==parentComputedStyle.display)return null;if(parent==this.root||9==parent.nodeType)if(atRoot=!0,parent==this.root||parent==document)crossOriginUpdater&&!this.root?!crossOriginRect||0==crossOriginRect.width&&0==crossOriginRect.height?(parent=null,parentRect=null,intersectionRect=null):parentRect=crossOriginRect:parentRect=rootRect;else{var frame=getParentNode(parent),frameRect=frame&&getBoundingClientRect(frame),frameIntersect=frame&&this._computeTargetAndRootIntersection(frame,frameRect,rootRect);frameRect&&frameIntersect?(parent=frame,parentRect=convertFromParentRect(frameRect,frameIntersect)):(parent=null,intersectionRect=null)}else{var doc=parent.ownerDocument;parent!=doc.body&&parent!=doc.documentElement&&"visible"!=parentComputedStyle.overflow&&(parentRect=getBoundingClientRect(parent))}if(parentRect&&(rect1=parentRect,rect2=intersectionRect,top=void 0,bottom=void 0,left=void 0,right=void 0,width=void 0,height=void 0,top=Math.max(rect1.top,rect2.top),bottom=Math.min(rect1.bottom,rect2.bottom),left=Math.max(rect1.left,rect2.left),right=Math.min(rect1.right,rect2.right),height=bottom-top,intersectionRect=(width=right-left)>=0&&height>=0&&{top,bottom,left,right,width,height}||null),!intersectionRect)break;parent=parent&&getParentNode(parent)}return intersectionRect}},IntersectionObserver.prototype._getRootRect=function(){var rootRect;if(this.root&&!isDoc(this.root))rootRect=getBoundingClientRect(this.root);else{var doc=isDoc(this.root)?this.root:document,html=doc.documentElement,body=doc.body;rootRect={top:0,left:0,right:html.clientWidth||body.clientWidth,width:html.clientWidth||body.clientWidth,bottom:html.clientHeight||body.clientHeight,height:html.clientHeight||body.clientHeight}}return this._expandRectByRootMargin(rootRect)},IntersectionObserver.prototype._expandRectByRootMargin=function(rect){var margins=this._rootMarginValues.map((function(margin,i){return"px"==margin.unit?margin.value:margin.value*(i%2?rect.width:rect.height)/100})),newRect={top:rect.top-margins[0],right:rect.right+margins[1],bottom:rect.bottom+margins[2],left:rect.left-margins[3]};return newRect.width=newRect.right-newRect.left,newRect.height=newRect.bottom-newRect.top,newRect},IntersectionObserver.prototype._hasCrossedThreshold=function(oldEntry,newEntry){var oldRatio=oldEntry&&oldEntry.isIntersecting?oldEntry.intersectionRatio||0:-1,newRatio=newEntry.isIntersecting?newEntry.intersectionRatio||0:-1;if(oldRatio!==newRatio)for(var i=0;i<this.thresholds.length;i++){var threshold=this.thresholds[i];if(threshold==oldRatio||threshold==newRatio||threshold<oldRatio!=threshold<newRatio)return!0}},IntersectionObserver.prototype._rootIsInDom=function(){return!this.root||containsDeep(document,this.root)},IntersectionObserver.prototype._rootContainsTarget=function(target){var rootDoc=this.root&&(this.root.ownerDocument||this.root)||document;return containsDeep(rootDoc,target)&&(!this.root||rootDoc==target.ownerDocument)},IntersectionObserver.prototype._registerInstance=function(){registry.indexOf(this)<0&®istry.push(this)},IntersectionObserver.prototype._unregisterInstance=function(){var index=registry.indexOf(this);-1!=index&®istry.splice(index,1)},window.IntersectionObserver=IntersectionObserver,window.IntersectionObserverEntry=IntersectionObserverEntry}function getFrameElement(doc){try{return doc.defaultView&&doc.defaultView.frameElement||null}catch(e){return null}}function IntersectionObserverEntry(entry){this.time=entry.time,this.target=entry.target,this.rootBounds=ensureDOMRect(entry.rootBounds),this.boundingClientRect=ensureDOMRect(entry.boundingClientRect),this.intersectionRect=ensureDOMRect(entry.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!entry.intersectionRect;var targetRect=this.boundingClientRect,targetArea=targetRect.width*targetRect.height,intersectionRect=this.intersectionRect,intersectionArea=intersectionRect.width*intersectionRect.height;this.intersectionRatio=targetArea?Number((intersectionArea/targetArea).toFixed(4)):this.isIntersecting?1:0}function IntersectionObserver(callback,opt_options){var options=opt_options||{};if("function"!=typeof callback)throw new Error("callback must be a function");if(options.root&&1!=options.root.nodeType&&9!=options.root.nodeType)throw new Error("root must be a Document or Element");this._checkForIntersections=function throttle(fn,timeout){var timer=null;return function(){timer||(timer=setTimeout((function(){fn(),timer=null}),timeout))}}(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=callback,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(options.rootMargin),this.thresholds=this._initThresholds(options.threshold),this.root=options.root||null,this.rootMargin=this._rootMarginValues.map((function(margin){return margin.value+margin.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function addEvent(node,event,fn,opt_useCapture){"function"==typeof node.addEventListener?node.addEventListener(event,fn,opt_useCapture||!1):"function"==typeof node.attachEvent&&node.attachEvent("on"+event,fn)}function removeEvent(node,event,fn,opt_useCapture){"function"==typeof node.removeEventListener?node.removeEventListener(event,fn,opt_useCapture||!1):"function"==typeof node.detatchEvent&&node.detatchEvent("on"+event,fn)}function getBoundingClientRect(el){var rect;try{rect=el.getBoundingClientRect()}catch(err){}return rect?(rect.width&&rect.height||(rect={top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left,width:rect.right-rect.left,height:rect.bottom-rect.top}),rect):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function ensureDOMRect(rect){return!rect||"x"in rect?rect:{top:rect.top,y:rect.top,bottom:rect.bottom,left:rect.left,x:rect.left,right:rect.right,width:rect.width,height:rect.height}}function convertFromParentRect(parentBoundingRect,parentIntersectionRect){var top=parentIntersectionRect.top-parentBoundingRect.top,left=parentIntersectionRect.left-parentBoundingRect.left;return{top,left,height:parentIntersectionRect.height,width:parentIntersectionRect.width,bottom:top+parentIntersectionRect.height,right:left+parentIntersectionRect.width}}function containsDeep(parent,child){for(var node=child;node;){if(node==parent)return!0;node=getParentNode(node)}return!1}function getParentNode(node){var parent=node.parentNode;return 9==node.nodeType&&node!=document?getFrameElement(node):(parent&&parent.assignedSlot&&(parent=parent.assignedSlot.parentNode),parent&&11==parent.nodeType&&parent.host?parent.host:parent)}function isDoc(node){return node&&9===node.nodeType}}();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|