mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
2a4b879c21
commit
63664e6c1c
1155 changed files with 62261 additions and 84 deletions
45
dashboard-ui/bower_components/marked-element/.bower.json
vendored
Normal file
45
dashboard-ui/bower_components/marked-element/.bower.json
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "marked-element",
|
||||
"version": "1.1.2",
|
||||
"description": "Element wrapper for the marked library",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"marked",
|
||||
"markdown",
|
||||
"container",
|
||||
"wrapper"
|
||||
],
|
||||
"dependencies": {
|
||||
"marked": "~0.3.3",
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"license": "https://polymer.github.io/LICENSE.txt",
|
||||
"main": "marked-element.html",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/marked-element.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/polymerelements/marked-element",
|
||||
"_release": "1.1.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.1.2",
|
||||
"commit": "6e55c2290ad89a520a25a88f3fafc49b8d654c68"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/marked-element.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/marked-element"
|
||||
}
|
1
dashboard-ui/bower_components/marked-element/.gitignore
vendored
Normal file
1
dashboard-ui/bower_components/marked-element/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bower_components/
|
25
dashboard-ui/bower_components/marked-element/.travis.yml
vendored
Normal file
25
dashboard-ui/bower_components/marked-element/.travis.yml
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
node_js: stable
|
||||
addons:
|
||||
firefox: latest
|
||||
sauce_connect: true
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- google-chrome-stable
|
||||
- g++-4.8
|
||||
before_script:
|
||||
- npm install -g bower polylint web-component-tester
|
||||
- bower install
|
||||
- polylint
|
||||
script:
|
||||
- xvfb-run wct
|
||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
||||
env:
|
||||
global:
|
||||
- CXX=g++-4.8
|
||||
- secure: DUM7LFRJH7Ji78bVRep6D3rJ+RH8F1Y15gSaCZ5SvlJ8lMuTYmpCVZ876LHVHdOv28d5dyPDn3U3slvssDO5UldTzZDNALX6/mOncY6QxRIbz+0E6Fm5Vn3PUXkBop/k/ELgCwmSDBfXGeKeRIu7nc/nDBldiMiwrHtyXTeuE+c=
|
||||
- secure: DqAN8qB45TWPfGVtrttAUV3fOu97j3qOnAUj+QxawlqBySqj3fcAD49HZFgQuBNMi0gxGYqrAAYj6AAyqIxH+K8P3PHPRfVegyRfYA4dcohnG9zYKmV5M+SaZEYpFp1FBXl3aKGbk0qiBmMsHWM2trkdRNNVAUl09Ywozapdpq8=
|
72
dashboard-ui/bower_components/marked-element/CONTRIBUTING.md
vendored
Normal file
72
dashboard-ui/bower_components/marked-element/CONTRIBUTING.md
vendored
Normal file
|
@ -0,0 +1,72 @@
|
|||
|
||||
<!--
|
||||
This file is autogenerated based on
|
||||
https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md
|
||||
|
||||
If you edit that file, it will get updated everywhere else.
|
||||
If you edit this file, your changes will get overridden :)
|
||||
-->
|
||||
# Polymer Elements
|
||||
## Guide for Contributors
|
||||
|
||||
Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
|
||||
|
||||
### Filing Issues
|
||||
|
||||
**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
|
||||
|
||||
1. **Who will use the feature?** _“As someone filling out a form…”_
|
||||
2. **When will they use the feature?** _“When I enter an invalid value…”_
|
||||
3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
|
||||
|
||||
**If you are filing an issue to report a bug**, please provide:
|
||||
|
||||
1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
|
||||
|
||||
```markdown
|
||||
The `paper-foo` element causes the page to turn pink when clicked.
|
||||
|
||||
## Expected outcome
|
||||
|
||||
The page stays the same color.
|
||||
|
||||
## Actual outcome
|
||||
|
||||
The page turns pink.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. Put a `paper-foo` element in the page.
|
||||
2. Open the page in a web browser.
|
||||
3. Click the `paper-foo` element.
|
||||
```
|
||||
|
||||
2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output).
|
||||
|
||||
3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
|
||||
|
||||
### Submitting Pull Requests
|
||||
|
||||
**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
|
||||
|
||||
When submitting pull requests, please provide:
|
||||
|
||||
1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax:
|
||||
|
||||
```markdown
|
||||
(For a single issue)
|
||||
Fixes #20
|
||||
|
||||
(For multiple issues)
|
||||
Fixes #32, #40
|
||||
```
|
||||
|
||||
2. **A succinct description of the design** used to fix any related issues. For example:
|
||||
|
||||
```markdown
|
||||
This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
|
||||
```
|
||||
|
||||
3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
|
||||
|
||||
If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
|
35
dashboard-ui/bower_components/marked-element/bower.json
vendored
Normal file
35
dashboard-ui/bower_components/marked-element/bower.json
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "marked-element",
|
||||
"version": "1.1.2",
|
||||
"description": "Element wrapper for the marked library",
|
||||
"private": true,
|
||||
"authors": [
|
||||
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"marked",
|
||||
"markdown",
|
||||
"container",
|
||||
"wrapper"
|
||||
],
|
||||
"dependencies": {
|
||||
"marked": "~0.3.3",
|
||||
"polymer": "Polymer/polymer#^1.1.0"
|
||||
},
|
||||
"license": "https://polymer.github.io/LICENSE.txt",
|
||||
"main": "marked-element.html",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/marked-element.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "PolymerElements/paper-styles#^1.0.4",
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "^4.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"ignore": []
|
||||
}
|
89
dashboard-ui/bower_components/marked-element/demo/index.html
vendored
Normal file
89
dashboard-ui/bower_components/marked-element/demo/index.html
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>marked-element demo</title>
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
||||
<link rel="import" href="../marked-element.html">
|
||||
|
||||
<style is="custom-style">
|
||||
|
||||
.centered {
|
||||
max-width: 550px;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
color: var(--google-grey-700);
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
marked-element {
|
||||
display: block;
|
||||
background-color: var(--google-grey-100);
|
||||
padding: 10px 30px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.markdown-html.custom p {
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body unresolved>
|
||||
|
||||
<div class="vertical-section vertical-section-container centered">
|
||||
<h1><marked-element></h1>
|
||||
|
||||
<section>
|
||||
<h3>Inline Text</h3>
|
||||
<marked-element>
|
||||
<div class="markdown-html"></div>
|
||||
<script type="text/markdown">
|
||||
## Markdown Renderer
|
||||
|
||||
Example:
|
||||
|
||||
```html
|
||||
<paper-toolbar>
|
||||
<paper-icon-button icon="menu"></paper-icon-button>
|
||||
<div class="title">Title</div>
|
||||
<paper-icon-button icon="more"></paper-icon-button>
|
||||
</paper-toolbar>
|
||||
```
|
||||
|
||||
_Nifty_ features.
|
||||
</script>
|
||||
</marked-element>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3>Text via Attribute, with custom styling</h3>
|
||||
<marked-element markdown="***Bold and italic***">
|
||||
<div class="markdown-html custom"></div>
|
||||
</marked-element>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
27
dashboard-ui/bower_components/marked-element/hero.svg
vendored
Normal file
27
dashboard-ui/bower_components/marked-element/hero.svg
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<circle cx="109" cy="33" r="4"/>
|
||||
<polygon points="100,92.7 94,84.7 88,92.7 81.2,83.6 82.8,82.4 88,89.3 94,81.3 100,89.3 106.1,81.3 112.9,90.4 111.3,91.6
|
||||
106.1,84.7 "/>
|
||||
<circle cx="140" cy="91" r="4"/>
|
||||
<g>
|
||||
<path d="M80.6,57.8l-8.2-2.1l1.3-4.1l8,3.4L81,45.7h4.2l-0.7,9.4l7.9-3.3l1.3,4.2l-8.4,2l5.6,7.1l-3.4,2.6l-4.6-8l-4.5,7.8
|
||||
L74.9,65L80.6,57.8z"/>
|
||||
<path d="M138.4,63.2h-5.6l-1.8,9h-3.4l1.8-9h-5.2V60h5.8l1.5-7.4H126v-3.2h6.2l1.8-9.1h3.4l-1.8,9.1h5.6l1.8-9.1h3.4l-1.8,9.1h4.4
|
||||
v3.2h-5l-1.5,7.4h4.8v3.2h-5.4l-1.8,9h-3.4L138.4,63.2z M133.5,60h5.6l1.5-7.4H135L133.5,60z"/>
|
||||
</g>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
26
dashboard-ui/bower_components/marked-element/index.html
vendored
Normal file
26
dashboard-ui/bower_components/marked-element/index.html
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
219
dashboard-ui/bower_components/marked-element/marked-element.html
vendored
Normal file
219
dashboard-ui/bower_components/marked-element/marked-element.html
vendored
Normal file
|
@ -0,0 +1,219 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="marked-import.html">
|
||||
|
||||
<!--
|
||||
Element wrapper for the [marked](https://github.com/chjj/marked) library.
|
||||
|
||||
`<marked-element>` accepts Markdown source, and renders it to a child
|
||||
element with the class `markdown-html`. This child element can be styled
|
||||
as you would a normal DOM element. If you do not provide a child element
|
||||
with the `markdown-html` class, the Markdown source will still be rendered,
|
||||
but to a shadow DOM child that cannot be styled.
|
||||
|
||||
The Markdown source can be specified either via the `markdown` attribute:
|
||||
|
||||
<marked-element markdown="`Markdown` is _awesome_!">
|
||||
<div class="markdown-html"></div>
|
||||
</marked-element>
|
||||
|
||||
Or, you can provide it via a `<script type="text/markdown">` element child:
|
||||
|
||||
<marked-element>
|
||||
<div class="markdown-html"></div>
|
||||
<script type="text/markdown">
|
||||
Check out my markdown!
|
||||
|
||||
We can even embed elements without fear of the HTML parser mucking up their
|
||||
textual representation:
|
||||
|
||||
```html
|
||||
<awesome-sauce>
|
||||
<div>Oops, I'm about to forget to close this div.
|
||||
</awesome-sauce>
|
||||
```
|
||||
</script>
|
||||
</marked-element>
|
||||
|
||||
Note that the `<script type="text/markdown">` approach is _static_. Changes to
|
||||
the script content will _not_ update the rendered markdown!
|
||||
|
||||
### Styling
|
||||
If you are using a child with the `markdown-html` class, you can style it
|
||||
as you would a regular DOM element:
|
||||
|
||||
.markdown-html p {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.markdown-html td:first-child {
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
@element marked-element
|
||||
@group Molecules
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
-->
|
||||
<dom-module id="marked-element">
|
||||
<template>
|
||||
<style>
|
||||
/* Thanks IE 10. */
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<content select=".markdown-html"></content>
|
||||
<div id="content" class="hidden"></div>
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
'use strict';
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'marked-element',
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* The markdown source that should be rendered by this element.
|
||||
*/
|
||||
markdown: {
|
||||
observer: 'render',
|
||||
type: String,
|
||||
value: null
|
||||
},
|
||||
/**
|
||||
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
|
||||
*/
|
||||
pedantic: {
|
||||
observer: 'render',
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
/**
|
||||
* Sanitize the output. Ignore any HTML that has been input.
|
||||
*/
|
||||
sanitize: {
|
||||
observer: 'render',
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
/**
|
||||
* Use "smart" typographic punctuation for things like quotes and dashes.
|
||||
*/
|
||||
smartypants: {
|
||||
observer: 'render',
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
},
|
||||
|
||||
ready: function() {
|
||||
if (!this.markdown) {
|
||||
// Use the Markdown from the first `<script>` descendant whose MIME type starts with
|
||||
// "text/markdown". Script elements beyond the first are ignored.
|
||||
var markdownElement = Polymer.dom(this).querySelector('[type^="text/markdown"]');
|
||||
if (markdownElement != null) {
|
||||
this.markdown = this._unindent(markdownElement.textContent);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders `markdown` to HTML when the element is attached.
|
||||
*
|
||||
* This serves a dual purpose:
|
||||
*
|
||||
* * Prevents unnecessary work (no need to render when not visible).
|
||||
*
|
||||
* * `attached` fires top-down, so we can give ancestors a chance to
|
||||
* register listeners for the `syntax-highlight` event _before_ we render
|
||||
* any markdown.
|
||||
*
|
||||
*/
|
||||
attached: function() {
|
||||
this._attached = true;
|
||||
this._outputElement = this.outputElement;
|
||||
this.render();
|
||||
},
|
||||
|
||||
detached: function() {
|
||||
this._attached = false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Unindents the markdown source that will be rendered.
|
||||
*/
|
||||
unindent: function(text) {
|
||||
this._unindent(text);
|
||||
},
|
||||
|
||||
get outputElement () {
|
||||
var child = Polymer.dom(this).queryDistributedElements('.markdown-html')[0];
|
||||
|
||||
if (child)
|
||||
return child;
|
||||
|
||||
this.toggleClass('hidden', false, this.$.content);
|
||||
return this.$.content;
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders `markdown` into this element's DOM.
|
||||
*
|
||||
* This is automatically called whenever the `markdown` property is changed.
|
||||
*
|
||||
* The only case where you should be calling this is if you are providing
|
||||
* markdown via `<script type="text/markdown">` after this element has been
|
||||
* constructed (or updating that markdown).
|
||||
*/
|
||||
render: function() {
|
||||
if (!this._attached) return;
|
||||
if (!this.markdown) {
|
||||
Polymer.dom(this._outputElement).innerHTML = '';
|
||||
return;
|
||||
}
|
||||
var opts = {
|
||||
highlight: this._highlight.bind(this),
|
||||
sanitize: this.sanitize,
|
||||
pedantic: this.pedantic,
|
||||
smartypants: this.smartypants
|
||||
};
|
||||
Polymer.dom(this._outputElement).innerHTML = marked(this.markdown, opts);
|
||||
},
|
||||
|
||||
_highlight: function(code, lang) {
|
||||
var event = this.fire('syntax-highlight', {code: code, lang: lang});
|
||||
return event.detail.code || code;
|
||||
},
|
||||
|
||||
_unindent: function(text) {
|
||||
if (!text) return text;
|
||||
var lines = text.replace(/\t/g, ' ').split('\n');
|
||||
var indent = lines.reduce(function(prev, line) {
|
||||
if (/^\s*$/.test(line)) return prev; // Completely ignore blank lines.
|
||||
|
||||
var lineIndent = line.match(/^(\s*)/)[0].length;
|
||||
if (prev === null) return lineIndent;
|
||||
return lineIndent < prev ? lineIndent : prev;
|
||||
}, null);
|
||||
|
||||
return lines.map(function(l) { return l.substr(indent); }).join('\n');
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
</script>
|
10
dashboard-ui/bower_components/marked-element/marked-import.html
vendored
Normal file
10
dashboard-ui/bower_components/marked-element/marked-import.html
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<script src='../marked/lib/marked.js'></script>
|
25
dashboard-ui/bower_components/marked-element/test/index.html
vendored
Normal file
25
dashboard-ui/bower_components/marked-element/test/index.html
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
WCT.loadSuites([
|
||||
'marked-element.html'
|
||||
]);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
247
dashboard-ui/bower_components/marked-element/test/marked-element.html
vendored
Normal file
247
dashboard-ui/bower_components/marked-element/test/marked-element.html
vendored
Normal file
|
@ -0,0 +1,247 @@
|
|||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>marked-element basic tests</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../marked-element.html">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="SmartyPants">
|
||||
<template>
|
||||
<marked-element smartypants>
|
||||
<div id="output" class="markdown-html"></div>
|
||||
<script type="text/markdown">
|
||||
# foo
|
||||
...
|
||||
</script>
|
||||
</marked-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="CamelCaseHTML">
|
||||
<template>
|
||||
<marked-element>
|
||||
<div id="output" class="markdown-html"></div>
|
||||
<script type="text/markdown">
|
||||
```html
|
||||
<div camelCase></div>
|
||||
```
|
||||
</script>
|
||||
</marked-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="BadHTML">
|
||||
<template>
|
||||
<marked-element>
|
||||
<div id="output" class="markdown-html"></div>
|
||||
<script type="text/markdown">
|
||||
```html
|
||||
<p><div></p></div>
|
||||
```
|
||||
</script>
|
||||
</marked-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="CamelCaseHTMLWithoutChild">
|
||||
<template>
|
||||
<marked-element>
|
||||
<script type="text/markdown">
|
||||
```html
|
||||
<div camelCase></div>
|
||||
```
|
||||
</script>
|
||||
</marked-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="BadHTMLWithoutChild">
|
||||
<template>
|
||||
<marked-element>
|
||||
<script type="text/markdown">
|
||||
```html
|
||||
<p><div></p></div>
|
||||
```
|
||||
</script>
|
||||
</marked-element>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
// Thanks IE10.
|
||||
function isHidden(element) {
|
||||
var rect = element.getBoundingClientRect();
|
||||
return (rect.width == 0 && rect.height == 0);
|
||||
}
|
||||
|
||||
// Replace reserved HTML characters with their character entity equivalents to match the
|
||||
// transform done by Markdown.
|
||||
//
|
||||
// The Marked library itself is not used because it wraps code blocks in `<code><pre>`, which is
|
||||
// superfluous for testing purposes.
|
||||
function escapeHTML(string) {
|
||||
var span = document.createElement('span');
|
||||
span.textContent = string;
|
||||
return span.innerHTML;
|
||||
}
|
||||
|
||||
suite('<marked-element> has some options of marked available', function( ){
|
||||
var markedElement;
|
||||
var outputElement;
|
||||
setup(function() {
|
||||
markedElement = fixture('SmartyPants');
|
||||
outputElement = document.getElementById('output');
|
||||
});
|
||||
test('has sanitize', function() {
|
||||
expect(markedElement.sanitize).to.equal(false);
|
||||
});
|
||||
test('has pedantic', function() {
|
||||
expect(markedElement.sanitize).to.equal(false);
|
||||
});
|
||||
test('has smartypants', function() {
|
||||
expect(markedElement.sanitize).to.equal(false);
|
||||
console.log(outputElement.innerHTML)
|
||||
});
|
||||
});
|
||||
|
||||
suite('<marked-element> with .markdown-html child', function() {
|
||||
|
||||
suite('respects camelCased HTML', function() {
|
||||
var markedElement;
|
||||
var proofElement;
|
||||
var outputElement;
|
||||
|
||||
setup(function() {
|
||||
markedElement = fixture('CamelCaseHTML');
|
||||
proofElement = document.createElement('div');
|
||||
outputElement = document.getElementById('output');
|
||||
});
|
||||
|
||||
test('in code blocks', function() {
|
||||
proofElement.innerHTML = '<div camelCase></div>';
|
||||
expect(outputElement).to.equal(markedElement.outputElement);
|
||||
expect(isHidden(markedElement.$.content)).to.be.true;
|
||||
|
||||
// If Markdown content were put into a `<template>` or directly into the DOM, it would be
|
||||
// rendered as DOM and be converted from camelCase to lowercase per HTML parsing rules. By
|
||||
// using `<script>` descendants, content is interpreted as plain text.
|
||||
expect(proofElement.innerHTML).to.eql('<div camelcase=""></div>')
|
||||
expect(outputElement.innerHTML).to.include(escapeHTML('<div camelCase>'));
|
||||
});
|
||||
});
|
||||
|
||||
suite('respects bad HTML', function() {
|
||||
var markedElement;
|
||||
var proofElement;
|
||||
var outputElement;
|
||||
|
||||
setup(function() {
|
||||
markedElement = fixture('BadHTML');
|
||||
proofElement = document.createElement('div');
|
||||
outputElement = document.getElementById('output');
|
||||
});
|
||||
|
||||
test('in code blocks', function() {
|
||||
proofElement.innerHTML = '<p><div></p></div>';
|
||||
expect(outputElement).to.equal(markedElement.outputElement);
|
||||
expect(isHidden(markedElement.$.content)).to.be.true;
|
||||
|
||||
// If Markdown content were put into a `<template>` or directly into the DOM, it would be
|
||||
// rendered as DOM and close unbalanced tags. Because they are in code blocks they should
|
||||
// remain as typed.
|
||||
// Turns out, however IE and everybody else have slightly different opinions
|
||||
// about how the incorrect HTML should be fixed. It seems that:
|
||||
// IE says: <p><div></p></div> -> <p><div><p></p></div>
|
||||
// Chrome/FF say: <p><div></p></div> -> <p></p><div><p></p></div>.
|
||||
// So that's cool.
|
||||
var isEqualToOneOfThem =
|
||||
proofElement.innerHTML === '<p><div><p></p></div>' ||
|
||||
proofElement.innerHTML === '<p></p><div><p></p></div>';
|
||||
expect(isEqualToOneOfThem).be.true;
|
||||
expect(outputElement.innerHTML).to.include(escapeHTML('<p><div></p></div>'));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('<marked-element> without .markdown-html child', function() {
|
||||
|
||||
suite('respects camelCased HTML', function() {
|
||||
var markedElement;
|
||||
var proofElement;
|
||||
|
||||
setup(function() {
|
||||
markedElement = fixture('CamelCaseHTMLWithoutChild');
|
||||
proofElement = document.createElement('div');
|
||||
});
|
||||
|
||||
test('in code blocks', function() {
|
||||
proofElement.innerHTML = '<div camelCase></div>';
|
||||
expect(markedElement.$.content).to.equal(markedElement.outputElement);
|
||||
expect(isHidden(markedElement.$.content)).to.be.false;
|
||||
|
||||
// If Markdown content were put into a `<template>` or directly into the DOM, it would be
|
||||
// rendered as DOM and be converted from camelCase to lowercase per HTML parsing rules. By
|
||||
// using `<script>` descendants, content is interpreted as plain text.
|
||||
expect(proofElement.innerHTML).to.eql('<div camelcase=""></div>')
|
||||
expect(markedElement.$.content.innerHTML).to.include(escapeHTML('<div camelCase>'));
|
||||
});
|
||||
});
|
||||
|
||||
suite('respects bad HTML', function() {
|
||||
var markedElement;
|
||||
var proofElement;
|
||||
|
||||
setup(function() {
|
||||
markedElement = fixture('BadHTMLWithoutChild');
|
||||
proofElement = document.createElement('div');
|
||||
});
|
||||
|
||||
test('in code blocks', function() {
|
||||
proofElement.innerHTML = '<p><div></p></div>';
|
||||
expect(markedElement.$.content).to.equal(markedElement.outputElement);
|
||||
expect(isHidden(markedElement.$.content)).to.be.false;
|
||||
|
||||
// If Markdown content were put into a `<template>` or directly into the DOM, it would be
|
||||
// rendered as DOM and close unbalanced tags. Because they are in code blocks they should
|
||||
// remain as typed.
|
||||
// Turns out, however IE and everybody else have slightly different opinions
|
||||
// about how the incorrect HTML should be fixed. It seems that:
|
||||
// IE says: <p><div></p></div> -> <p><div><p></p></div>
|
||||
// Chrome/FF say: <p><div></p></div> -> <p></p><div><p></p></div>.
|
||||
// So that's cool.
|
||||
var isEqualToOneOfThem =
|
||||
proofElement.innerHTML === '<p><div><p></p></div>' ||
|
||||
proofElement.innerHTML === '<p></p><div><p></p></div>';
|
||||
expect(isEqualToOneOfThem).be.true;
|
||||
expect(markedElement.$.content.innerHTML).to.include(escapeHTML('<p><div></p></div>'));
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue