mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove unused components
This commit is contained in:
parent
f0302b2c9a
commit
ce68029f25
381 changed files with 1 additions and 27826 deletions
|
@ -1,46 +0,0 @@
|
||||||
{
|
|
||||||
"name": "iron-menu-behavior",
|
|
||||||
"version": "1.1.8",
|
|
||||||
"description": "Provides accessible menu behavior",
|
|
||||||
"authors": "The Polymer Authors",
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"behavior",
|
|
||||||
"menu"
|
|
||||||
],
|
|
||||||
"main": [
|
|
||||||
"iron-menu-behavior.html",
|
|
||||||
"iron-menubar-behavior.html"
|
|
||||||
],
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/iron-menu-behavior"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/iron-menu-behavior",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.2.4",
|
|
||||||
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"_release": "1.1.8",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.1.8",
|
|
||||||
"commit": "3f6676b93a4592975efa235590b9d8236af6ea1d"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/polymerelements/iron-menu-behavior.git",
|
|
||||||
"_target": "^1.0.0",
|
|
||||||
"_originalSource": "polymerelements/iron-menu-behavior"
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
<!-- Instructions: https://github.com/PolymerElements/iron-menu-behavior/CONTRIBUTING.md#filing-issues -->
|
|
||||||
### Description
|
|
||||||
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
|
|
||||||
|
|
||||||
### Expected outcome
|
|
||||||
|
|
||||||
<!-- Example: The page stays the same color. -->
|
|
||||||
|
|
||||||
### Actual outcome
|
|
||||||
|
|
||||||
<!-- Example: The page turns pink. -->
|
|
||||||
|
|
||||||
### Live Demo
|
|
||||||
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
|
|
||||||
<!-- Example
|
|
||||||
1. Put a `paper-foo` element in the page.
|
|
||||||
2. Open the page in a web browser.
|
|
||||||
3. Click the `paper-foo` element.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Browsers Affected
|
|
||||||
<!-- Check all that apply -->
|
|
||||||
- [ ] Chrome
|
|
||||||
- [ ] Firefox
|
|
||||||
- [ ] Safari 9
|
|
||||||
- [ ] Safari 8
|
|
||||||
- [ ] Safari 7
|
|
||||||
- [ ] Edge
|
|
||||||
- [ ] IE 11
|
|
||||||
- [ ] IE 10
|
|
|
@ -1 +0,0 @@
|
||||||
bower_components
|
|
|
@ -1,23 +0,0 @@
|
||||||
language: node_js
|
|
||||||
sudo: required
|
|
||||||
before_script:
|
|
||||||
- npm install -g bower polylint web-component-tester
|
|
||||||
- bower install
|
|
||||||
- polylint
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: CbYi/0VAtpLB+NDHdD/I9q2ldILrmyc3wxKdO5vEtMvRKYgsddQ/hXGovV3c6Hy9sAXD5sKtNi60BBG5E2XuydshjYAZiytfeNjFIvDu5627Xljjt90e/r1hg3tNHRRQihH73nPECfp/X+g+yBNCX3f0+2ExAh0DMs1DXt7Dl7Q=
|
|
||||||
- secure: kLFlOTh9IjctY7DIJ3KEw5OPrqHNTzoArdabfAtisBMWahuJptKFmYCp/t+zPSL27IVqJakaqPrwGrBUi+4h3wVWredNhfl2lCpMfQfBMcHC5kBVkf2xjJyDa5Y3bP7jPq6YnWYAqEl6pBWYiHU6yWBc6BEdJ6FsTWFbLFTnY7w=
|
|
||||||
node_js: stable
|
|
||||||
addons:
|
|
||||||
firefox: '46.0'
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
sauce_connect: true
|
|
||||||
script:
|
|
||||||
- xvfb-run wct
|
|
||||||
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'default'; fi
|
|
||||||
dist: trusty
|
|
|
@ -1,77 +0,0 @@
|
||||||
<!--
|
|
||||||
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 :)
|
|
||||||
|
|
||||||
You can however override the jsbin link with one that's customized to this
|
|
||||||
specific element:
|
|
||||||
|
|
||||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
|
||||||
-->
|
|
||||||
|
|
||||||
# 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: [https://jsbin.com/cagaye/edit?html,output](https://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 in the pull request description using the following syntax:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
(For a single issue)
|
|
||||||
Fixes #20
|
|
||||||
|
|
||||||
(For multiple issues)
|
|
||||||
Fixes #32, fixes #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!
|
|
|
@ -1,37 +0,0 @@
|
||||||
{
|
|
||||||
"name": "iron-menu-behavior",
|
|
||||||
"version": "1.1.8",
|
|
||||||
"description": "Provides accessible menu behavior",
|
|
||||||
"authors": "The Polymer Authors",
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"behavior",
|
|
||||||
"menu"
|
|
||||||
],
|
|
||||||
"main": [
|
|
||||||
"iron-menu-behavior.html",
|
|
||||||
"iron-menubar-behavior.html"
|
|
||||||
],
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/iron-menu-behavior"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/iron-menu-behavior",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-selector": "PolymerElements/iron-selector#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.2.4",
|
|
||||||
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,114 +0,0 @@
|
||||||
<!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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<title>iron-menu-behavior demo</title>
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<link rel="import" href="../../paper-styles/color.html">
|
|
||||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
|
||||||
<link rel="import" href="../../paper-styles/default-theme.html">
|
|
||||||
<link rel="import" href="simple-menu.html">
|
|
||||||
<link rel="import" href="simple-menubar.html">
|
|
||||||
|
|
||||||
<style is="custom-style">
|
|
||||||
simple-menu,
|
|
||||||
simple-menubar {
|
|
||||||
display: inline-block;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
simple-menu a {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
simple-menubar a,
|
|
||||||
simple-menu a {
|
|
||||||
padding: 15px 20px;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
simple-menu a[disabled],
|
|
||||||
simple-menubar a[disabled] {
|
|
||||||
color: var(--google-grey-300);
|
|
||||||
}
|
|
||||||
|
|
||||||
.horizontal-section {
|
|
||||||
padding: 0;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
|
||||||
height: 120px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body unresolved>
|
|
||||||
|
|
||||||
<div class="horizontal-section-container">
|
|
||||||
<div>
|
|
||||||
<h3>Simple menu</h3>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<simple-menu>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 0</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 1</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem" disabled>Item 2</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 3</a>
|
|
||||||
</simple-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3>Multi-select menu</h3>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<simple-menu multi>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 0</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 1</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 2</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 3</a>
|
|
||||||
</simple-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="row">
|
|
||||||
<h3>Simple menubar</h3>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<simple-menubar>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 0</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 1</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem" disabled>Item 2</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 3</a>
|
|
||||||
</simple-menubar>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<h3>Multi-select menubar</h3>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<simple-menubar multi>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 0</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 1</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 2</a>
|
|
||||||
<a href="javascript:void(0)" role="menuitem">Item 3</a>
|
|
||||||
</simple-menubar>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,52 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-menu-behavior.html">
|
|
||||||
<link rel="import" href="../../paper-styles/color.html">
|
|
||||||
|
|
||||||
<dom-module id="simple-menu">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
.content ::content > .iron-selected {
|
|
||||||
color: white;
|
|
||||||
background-color: var(--google-blue-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<content></content>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'simple-menu',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronMenuBehavior
|
|
||||||
]
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,56 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-menubar-behavior.html">
|
|
||||||
<link rel="import" href="../../paper-styles/color.html">
|
|
||||||
|
|
||||||
<dom-module id="simple-menubar">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
.content ::content > .iron-selected {
|
|
||||||
color: white;
|
|
||||||
background-color: var(--google-red-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content ::content > * {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<content></content>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'simple-menubar',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronMenubarBehavior
|
|
||||||
]
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,30 +0,0 @@
|
||||||
<!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>iron-menu-behavior</title>
|
|
||||||
|
|
||||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
|
||||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<iron-component-page src="iron-menubar-behavior.html"></iron-component-page>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,336 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-selector/iron-multi-selectable.html">
|
|
||||||
<link rel="import" href="../iron-a11y-keys-behavior/iron-a11y-keys-behavior.html">
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `Polymer.IronMenuBehavior` implements accessible menu behavior.
|
|
||||||
*
|
|
||||||
* @demo demo/index.html
|
|
||||||
* @polymerBehavior Polymer.IronMenuBehavior
|
|
||||||
*/
|
|
||||||
Polymer.IronMenuBehaviorImpl = {
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the currently focused item.
|
|
||||||
* @type {?Object}
|
|
||||||
*/
|
|
||||||
focusedItem: {
|
|
||||||
observer: '_focusedItemChanged',
|
|
||||||
readOnly: true,
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The attribute to use on menu items to look up the item title. Typing the first
|
|
||||||
* letter of an item when the menu is open focuses that item. If unset, `textContent`
|
|
||||||
* will be used.
|
|
||||||
*/
|
|
||||||
attrForItemTitle: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
hostAttributes: {
|
|
||||||
'role': 'menu',
|
|
||||||
'tabindex': '0'
|
|
||||||
},
|
|
||||||
|
|
||||||
observers: [
|
|
||||||
'_updateMultiselectable(multi)'
|
|
||||||
],
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
'focus': '_onFocus',
|
|
||||||
'keydown': '_onKeydown',
|
|
||||||
'iron-items-changed': '_onIronItemsChanged'
|
|
||||||
},
|
|
||||||
|
|
||||||
keyBindings: {
|
|
||||||
'up': '_onUpKey',
|
|
||||||
'down': '_onDownKey',
|
|
||||||
'esc': '_onEscKey',
|
|
||||||
'shift+tab:keydown': '_onShiftTabDown'
|
|
||||||
},
|
|
||||||
|
|
||||||
attached: function() {
|
|
||||||
this._resetTabindices();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Selects the given value. If the `multi` property is true, then the selected state of the
|
|
||||||
* `value` will be toggled; otherwise the `value` will be selected.
|
|
||||||
*
|
|
||||||
* @param {string|number} value the value to select.
|
|
||||||
*/
|
|
||||||
select: function(value) {
|
|
||||||
// Cancel automatically focusing a default item if the menu received focus
|
|
||||||
// through a user action selecting a particular item.
|
|
||||||
if (this._defaultFocusAsync) {
|
|
||||||
this.cancelAsync(this._defaultFocusAsync);
|
|
||||||
this._defaultFocusAsync = null;
|
|
||||||
}
|
|
||||||
var item = this._valueToItem(value);
|
|
||||||
if (item && item.hasAttribute('disabled')) return;
|
|
||||||
this._setFocusedItem(item);
|
|
||||||
Polymer.IronMultiSelectableBehaviorImpl.select.apply(this, arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets all tabindex attributes to the appropriate value based on the
|
|
||||||
* current selection state. The appropriate value is `0` (focusable) for
|
|
||||||
* the default selected item, and `-1` (not keyboard focusable) for all
|
|
||||||
* other items.
|
|
||||||
*/
|
|
||||||
_resetTabindices: function() {
|
|
||||||
var selectedItem = this.multi ? (this.selectedItems && this.selectedItems[0]) : this.selectedItem;
|
|
||||||
|
|
||||||
this.items.forEach(function(item) {
|
|
||||||
item.setAttribute('tabindex', item === selectedItem ? '0' : '-1');
|
|
||||||
}, this);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets appropriate ARIA based on whether or not the menu is meant to be
|
|
||||||
* multi-selectable.
|
|
||||||
*
|
|
||||||
* @param {boolean} multi True if the menu should be multi-selectable.
|
|
||||||
*/
|
|
||||||
_updateMultiselectable: function(multi) {
|
|
||||||
if (multi) {
|
|
||||||
this.setAttribute('aria-multiselectable', 'true');
|
|
||||||
} else {
|
|
||||||
this.removeAttribute('aria-multiselectable');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Given a KeyboardEvent, this method will focus the appropriate item in the
|
|
||||||
* menu (if there is a relevant item, and it is possible to focus it).
|
|
||||||
*
|
|
||||||
* @param {KeyboardEvent} event A KeyboardEvent.
|
|
||||||
*/
|
|
||||||
_focusWithKeyboardEvent: function(event) {
|
|
||||||
for (var i = 0, item; item = this.items[i]; i++) {
|
|
||||||
var attr = this.attrForItemTitle || 'textContent';
|
|
||||||
var title = item[attr] || item.getAttribute(attr);
|
|
||||||
|
|
||||||
if (!item.hasAttribute('disabled') && title &&
|
|
||||||
title.trim().charAt(0).toLowerCase() === String.fromCharCode(event.keyCode).toLowerCase()) {
|
|
||||||
this._setFocusedItem(item);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Focuses the previous item (relative to the currently focused item) in the
|
|
||||||
* menu, disabled items will be skipped.
|
|
||||||
* Loop until length + 1 to handle case of single item in menu.
|
|
||||||
*/
|
|
||||||
_focusPrevious: function() {
|
|
||||||
var length = this.items.length;
|
|
||||||
var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
|
||||||
for (var i = 1; i < length + 1; i++) {
|
|
||||||
var item = this.items[(curFocusIndex - i + length) % length];
|
|
||||||
if (!item.hasAttribute('disabled')) {
|
|
||||||
this._setFocusedItem(item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Focuses the next item (relative to the currently focused item) in the
|
|
||||||
* menu, disabled items will be skipped.
|
|
||||||
* Loop until length + 1 to handle case of single item in menu.
|
|
||||||
*/
|
|
||||||
_focusNext: function() {
|
|
||||||
var length = this.items.length;
|
|
||||||
var curFocusIndex = Number(this.indexOf(this.focusedItem));
|
|
||||||
for (var i = 1; i < length + 1; i++) {
|
|
||||||
var item = this.items[(curFocusIndex + i) % length];
|
|
||||||
if (!item.hasAttribute('disabled')) {
|
|
||||||
this._setFocusedItem(item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutates items in the menu based on provided selection details, so that
|
|
||||||
* all items correctly reflect selection state.
|
|
||||||
*
|
|
||||||
* @param {Element} item An item in the menu.
|
|
||||||
* @param {boolean} isSelected True if the item should be shown in a
|
|
||||||
* selected state, otherwise false.
|
|
||||||
*/
|
|
||||||
_applySelection: function(item, isSelected) {
|
|
||||||
if (isSelected) {
|
|
||||||
item.setAttribute('aria-selected', 'true');
|
|
||||||
} else {
|
|
||||||
item.removeAttribute('aria-selected');
|
|
||||||
}
|
|
||||||
Polymer.IronSelectableBehavior._applySelection.apply(this, arguments);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Discretely updates tabindex values among menu items as the focused item
|
|
||||||
* changes.
|
|
||||||
*
|
|
||||||
* @param {Element} focusedItem The element that is currently focused.
|
|
||||||
* @param {?Element} old The last element that was considered focused, if
|
|
||||||
* applicable.
|
|
||||||
*/
|
|
||||||
_focusedItemChanged: function(focusedItem, old) {
|
|
||||||
old && old.setAttribute('tabindex', '-1');
|
|
||||||
if (focusedItem) {
|
|
||||||
focusedItem.setAttribute('tabindex', '0');
|
|
||||||
focusedItem.focus();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A handler that responds to mutation changes related to the list of items
|
|
||||||
* in the menu.
|
|
||||||
*
|
|
||||||
* @param {CustomEvent} event An event containing mutation records as its
|
|
||||||
* detail.
|
|
||||||
*/
|
|
||||||
_onIronItemsChanged: function(event) {
|
|
||||||
if (event.detail.addedNodes.length) {
|
|
||||||
this._resetTabindices();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when a shift+tab keypress is detected by the menu.
|
|
||||||
*
|
|
||||||
* @param {CustomEvent} event A key combination event.
|
|
||||||
*/
|
|
||||||
_onShiftTabDown: function(event) {
|
|
||||||
var oldTabIndex = this.getAttribute('tabindex');
|
|
||||||
|
|
||||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = true;
|
|
||||||
|
|
||||||
this._setFocusedItem(null);
|
|
||||||
|
|
||||||
this.setAttribute('tabindex', '-1');
|
|
||||||
|
|
||||||
this.async(function() {
|
|
||||||
this.setAttribute('tabindex', oldTabIndex);
|
|
||||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = false;
|
|
||||||
// NOTE(cdata): polymer/polymer#1305
|
|
||||||
}, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when the menu receives focus.
|
|
||||||
*
|
|
||||||
* @param {FocusEvent} event A focus event.
|
|
||||||
*/
|
|
||||||
_onFocus: function(event) {
|
|
||||||
if (Polymer.IronMenuBehaviorImpl._shiftTabPressed) {
|
|
||||||
// do not focus the menu itself
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do not focus the selected tab if the deepest target is part of the
|
|
||||||
// menu element's local DOM and is focusable.
|
|
||||||
var rootTarget = /** @type {?HTMLElement} */(
|
|
||||||
Polymer.dom(event).rootTarget);
|
|
||||||
if (rootTarget !== this && typeof rootTarget.tabIndex !== "undefined" && !this.isLightDescendant(rootTarget)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear the cached focus item
|
|
||||||
this._defaultFocusAsync = this.async(function() {
|
|
||||||
// focus the selected item when the menu receives focus, or the first item
|
|
||||||
// if no item is selected
|
|
||||||
var selectedItem = this.multi ? (this.selectedItems && this.selectedItems[0]) : this.selectedItem;
|
|
||||||
|
|
||||||
this._setFocusedItem(null);
|
|
||||||
|
|
||||||
if (selectedItem) {
|
|
||||||
this._setFocusedItem(selectedItem);
|
|
||||||
} else if (this.items[0]) {
|
|
||||||
// We find the first none-disabled item (if one exists)
|
|
||||||
this._focusNext();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when the up key is pressed.
|
|
||||||
*
|
|
||||||
* @param {CustomEvent} event A key combination event.
|
|
||||||
*/
|
|
||||||
_onUpKey: function(event) {
|
|
||||||
// up and down arrows moves the focus
|
|
||||||
this._focusPrevious();
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when the down key is pressed.
|
|
||||||
*
|
|
||||||
* @param {CustomEvent} event A key combination event.
|
|
||||||
*/
|
|
||||||
_onDownKey: function(event) {
|
|
||||||
this._focusNext();
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when the esc key is pressed.
|
|
||||||
*
|
|
||||||
* @param {CustomEvent} event A key combination event.
|
|
||||||
*/
|
|
||||||
_onEscKey: function(event) {
|
|
||||||
// esc blurs the control
|
|
||||||
this.focusedItem.blur();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handler that is called when a keydown event is detected.
|
|
||||||
*
|
|
||||||
* @param {KeyboardEvent} event A keyboard event.
|
|
||||||
*/
|
|
||||||
_onKeydown: function(event) {
|
|
||||||
if (!this.keyboardEventMatchesKeys(event, 'up down esc')) {
|
|
||||||
// all other keys focus the menu item starting with that character
|
|
||||||
this._focusWithKeyboardEvent(event);
|
|
||||||
}
|
|
||||||
event.stopPropagation();
|
|
||||||
},
|
|
||||||
|
|
||||||
// override _activateHandler
|
|
||||||
_activateHandler: function(event) {
|
|
||||||
Polymer.IronSelectableBehavior._activateHandler.call(this, event);
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = false;
|
|
||||||
|
|
||||||
/** @polymerBehavior Polymer.IronMenuBehavior */
|
|
||||||
Polymer.IronMenuBehavior = [
|
|
||||||
Polymer.IronMultiSelectableBehavior,
|
|
||||||
Polymer.IronA11yKeysBehavior,
|
|
||||||
Polymer.IronMenuBehaviorImpl
|
|
||||||
];
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,81 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="iron-menu-behavior.html">
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* `Polymer.IronMenubarBehavior` implements accessible menubar behavior.
|
|
||||||
*
|
|
||||||
* @polymerBehavior Polymer.IronMenubarBehavior
|
|
||||||
*/
|
|
||||||
Polymer.IronMenubarBehaviorImpl = {
|
|
||||||
|
|
||||||
hostAttributes: {
|
|
||||||
'role': 'menubar'
|
|
||||||
},
|
|
||||||
|
|
||||||
keyBindings: {
|
|
||||||
'left': '_onLeftKey',
|
|
||||||
'right': '_onRightKey'
|
|
||||||
},
|
|
||||||
|
|
||||||
_onUpKey: function(event) {
|
|
||||||
this.focusedItem.click();
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onDownKey: function(event) {
|
|
||||||
this.focusedItem.click();
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
get _isRTL() {
|
|
||||||
return window.getComputedStyle(this)['direction'] === 'rtl';
|
|
||||||
},
|
|
||||||
|
|
||||||
_onLeftKey: function(event) {
|
|
||||||
if (this._isRTL) {
|
|
||||||
this._focusNext();
|
|
||||||
} else {
|
|
||||||
this._focusPrevious();
|
|
||||||
}
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onRightKey: function(event) {
|
|
||||||
if (this._isRTL) {
|
|
||||||
this._focusPrevious();
|
|
||||||
} else {
|
|
||||||
this._focusNext();
|
|
||||||
}
|
|
||||||
event.detail.keyboardEvent.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
_onKeydown: function(event) {
|
|
||||||
if (this.keyboardEventMatchesKeys(event, 'up down left right esc')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// all other keys focus the menu item starting with that character
|
|
||||||
this._focusWithKeyboardEvent(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @polymerBehavior Polymer.IronMenubarBehavior */
|
|
||||||
Polymer.IronMenubarBehavior = [
|
|
||||||
Polymer.IronMenuBehavior,
|
|
||||||
Polymer.IronMenubarBehaviorImpl
|
|
||||||
];
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,33 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>iron-menu-behavior tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
WCT.loadSuites([
|
|
||||||
'iron-menu-behavior.html',
|
|
||||||
'iron-menubar-behavior.html',
|
|
||||||
'iron-menu-behavior.html?dom=shadow',
|
|
||||||
'iron-menubar-behavior.html?dom=shadow'
|
|
||||||
]);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body></html>
|
|
|
@ -1,404 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>iron-menu-behavior tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
|
||||||
<link rel="import" href="test-menu.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="basic">
|
|
||||||
<template>
|
|
||||||
<test-menu>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="single-item">
|
|
||||||
<template>
|
|
||||||
<test-menu>
|
|
||||||
<div>item 1</div>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="disabled">
|
|
||||||
<template>
|
|
||||||
<test-menu>
|
|
||||||
<div>a item 1</div>
|
|
||||||
<div disabled>b item 2</div>
|
|
||||||
<div>b item 3</div>
|
|
||||||
<div disabled>c item 4</div>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="only-disabled">
|
|
||||||
<template>
|
|
||||||
<test-menu>
|
|
||||||
<div disabled>disabled item</div>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="multi">
|
|
||||||
<template>
|
|
||||||
<test-menu multi>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="nested">
|
|
||||||
<template>
|
|
||||||
<test-menu>
|
|
||||||
<test-menu>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menu>
|
|
||||||
</test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="empty">
|
|
||||||
<template>
|
|
||||||
<test-menu></test-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
suite('menu a11y tests', function() {
|
|
||||||
test('menu has role="menu"', function() {
|
|
||||||
var menu = fixture('basic');
|
|
||||||
assert.equal(menu.getAttribute('role'), 'menu', 'has role="menu"');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('first item gets focus when menu is focused', function(done) {
|
|
||||||
var menu = fixture('basic');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menu.firstElementChild).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menu.firstElementChild, 'menu.firstElementChild is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('first item gets focus when menu is focused in a single item menu', function(done) {
|
|
||||||
var menu = fixture('single-item');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menu.firstElementChild).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menu.firstElementChild, 'menu.firstElementChild is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected item gets focus when menu is focused', function(done) {
|
|
||||||
var menu = fixture('basic');
|
|
||||||
menu.selected = 1;
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menu.selectedItem).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menu.selectedItem, 'menu.selectedItem is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on next item skips disabled items', function(done) {
|
|
||||||
var menu = fixture('disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press down
|
|
||||||
MockInteractions.keyDownOn(menu, 40);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, menu.items[2], 'menu.items[2] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on next item in empty menu', function(done) {
|
|
||||||
var menu = fixture('empty');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press down
|
|
||||||
MockInteractions.keyDownOn(menu, 40);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, undefined, 'no focused item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on next item in all disabled menu', function(done) {
|
|
||||||
var menu = fixture('only-disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press down
|
|
||||||
MockInteractions.keyDownOn(menu, 40);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, undefined, 'no focused item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on previous item skips disabled items', function(done) {
|
|
||||||
var menu = fixture('disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press up
|
|
||||||
MockInteractions.keyDownOn(menu, 38);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, menu.items[2], 'menu.items[2] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on previous item in empty menu', function(done) {
|
|
||||||
var menu = fixture('empty');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press up
|
|
||||||
MockInteractions.keyDownOn(menu, 38);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, undefined, 'no focused item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on previous item in all disabled menu', function(done) {
|
|
||||||
var menu = fixture('only-disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press up
|
|
||||||
MockInteractions.keyDownOn(menu, 38);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, undefined, 'no focused item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on item using key press skips disabled items', function(done) {
|
|
||||||
var menu = fixture('disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press 'b'
|
|
||||||
MockInteractions.keyDownOn(menu, 66);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, menu.items[2], 'menu.items[2] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on item using key press ignores disabled items', function(done) {
|
|
||||||
var menu = fixture('disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press 'c'
|
|
||||||
MockInteractions.keyDownOn(menu, 67);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, menu.items[0], 'menu.items[0] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing on item using key press in all disabled items', function(done) {
|
|
||||||
var menu = fixture('only-disabled');
|
|
||||||
MockInteractions.focus(menu);
|
|
||||||
|
|
||||||
// Wait for async focus
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
// Key press 'c'
|
|
||||||
MockInteractions.keyDownOn(menu, 67);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var focusedItem = Polymer.dom(menu).node.focusedItem;
|
|
||||||
assert.equal(focusedItem, undefined, 'no focused item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing non-item content does not auto-focus an item', function(done) {
|
|
||||||
var menu = fixture('basic');
|
|
||||||
menu.extraContent.focus();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var menuOwnerRoot = Polymer.dom(menu.extraContent).getOwnerRoot() || document;
|
|
||||||
var menuActiveElement = Polymer.dom(menuOwnerRoot).activeElement;
|
|
||||||
assert.equal(menuActiveElement, menu.extraContent, 'menu.extraContent is focused');
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menu, 'menu is document.activeElement');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('last activated item in a multi select menu is focused', function(done) {
|
|
||||||
var menu = fixture('multi');
|
|
||||||
menu.selected = 0;
|
|
||||||
menu.items[1].click();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menu.items[1]).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menu.items[1], 'menu.items[1] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('deselection in a multi select menu focuses deselected item', function(done) {
|
|
||||||
var menu = fixture('multi');
|
|
||||||
menu.selected = 0;
|
|
||||||
menu.items[0].click();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menu.items[0]).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menu.items[0], 'menu.items[0] is focused');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('keyboard events should not bubble', function(done) {
|
|
||||||
var menu = fixture('nested');
|
|
||||||
var keyCounter = 0;
|
|
||||||
|
|
||||||
menu.addEventListener('keydown', function(event) {
|
|
||||||
if (menu.keyboardEventMatchesKeys(event, 'esc')) {
|
|
||||||
keyCounter++;
|
|
||||||
}
|
|
||||||
if (menu.keyboardEventMatchesKeys(event, 'up')) {
|
|
||||||
keyCounter++;
|
|
||||||
}
|
|
||||||
if (menu.keyboardEventMatchesKeys(event, 'down')) {
|
|
||||||
keyCounter++;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// up
|
|
||||||
MockInteractions.keyDownOn(menu.firstElementChild, 38);
|
|
||||||
// down
|
|
||||||
MockInteractions.keyDownOn(menu.firstElementChild, 40);
|
|
||||||
// esc
|
|
||||||
MockInteractions.keyDownOn(menu.firstElementChild, 27);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(menu.firstElementChild.tagName, 'TEST-MENU');
|
|
||||||
assert.equal(keyCounter, 0);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('empty menus don\'t unfocus themselves', function(done) {
|
|
||||||
var menu = fixture('empty');
|
|
||||||
|
|
||||||
menu.focus();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menu);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('`tabIndex` properties of all items are updated when items change', function(done) {
|
|
||||||
var menu = fixture('basic');
|
|
||||||
|
|
||||||
function assertTabIndexCounts(nodes, expected) {
|
|
||||||
var tabIndexCounts = {};
|
|
||||||
for (var i = 0; i < nodes.length; i++) {
|
|
||||||
var tabIndex = nodes[i].tabIndex;
|
|
||||||
if (tabIndexCounts[tabIndex]) {
|
|
||||||
tabIndexCounts[tabIndex]++;
|
|
||||||
} else {
|
|
||||||
tabIndexCounts[tabIndex] = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
assert.equal(Object.keys(tabIndexCounts).length, Object.keys(expected).length);
|
|
||||||
Object.keys(expected).forEach(function(key) {
|
|
||||||
assert.equal(tabIndexCounts[key], expected[key]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function divWithTabIndex(tabIndex) {
|
|
||||||
var div = document.createElement('div');
|
|
||||||
div.tabIndex = tabIndex;
|
|
||||||
return div;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only the selected item will have tabIndex 0.
|
|
||||||
menu.select(0);
|
|
||||||
assertTabIndexCounts(menu.items, {"-1": 2, "0": 1});
|
|
||||||
|
|
||||||
Polymer.dom(menu).appendChild(divWithTabIndex(1));
|
|
||||||
Polymer.dom(menu).appendChild(divWithTabIndex(2));
|
|
||||||
Polymer.dom(menu).appendChild(divWithTabIndex(3));
|
|
||||||
|
|
||||||
// Async wait for `observeNodes`.
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assertTabIndexCounts(menu.items, {"-1": 5, "0": 1});
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,162 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>iron-menubar-behavior tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
|
|
||||||
<link rel="import" href="test-menubar.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="basic">
|
|
||||||
<template>
|
|
||||||
<test-menubar>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menubar>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="multi">
|
|
||||||
<template>
|
|
||||||
<test-menubar multi>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menubar>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="rtl">
|
|
||||||
<template>
|
|
||||||
<div dir="rtl">
|
|
||||||
<test-menubar>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</test-menubar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
suite('menubar a11y tests', function() {
|
|
||||||
|
|
||||||
test('menubar has role="menubar"', function() {
|
|
||||||
var menubar = fixture('basic');
|
|
||||||
assert.equal(menubar.getAttribute('role'), 'menubar', 'has role="menubar"');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('first item gets focus when menubar is focused', function(done) {
|
|
||||||
var menubar = fixture('basic');
|
|
||||||
MockInteractions.focus(menubar);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.firstElementChild, 'document.activeElement is first item')
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected item gets focus when menubar is focused', function(done) {
|
|
||||||
var menubar = fixture('basic');
|
|
||||||
menubar.selected = 1;
|
|
||||||
MockInteractions.focus(menubar);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.selectedItem, 'document.activeElement is selected item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('focusing non-item content does not auto-focus an item', function(done) {
|
|
||||||
var menubar = fixture('basic');
|
|
||||||
menubar.extraContent.focus();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
var ownerRoot = Polymer.dom(menubar.extraContent).getOwnerRoot() || document;
|
|
||||||
var activeElement = Polymer.dom(ownerRoot).activeElement;
|
|
||||||
assert.equal(activeElement, menubar.extraContent, 'menubar.extraContent is focused');
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar, 'menubar is document.activeElement');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('last activated item in a multi select menubar is focused', function(done) {
|
|
||||||
var menubar = fixture('multi');
|
|
||||||
menubar.selected = 0;
|
|
||||||
menubar.items[1].click();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[1], 'document.activeElement is last activated item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('deselection in a multi select menubar focuses deselected item', function(done) {
|
|
||||||
var menubar = fixture('multi');
|
|
||||||
menubar.selected = 0;
|
|
||||||
menubar.items[0].click();
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[0], 'document.activeElement is last activated item');
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('left / right keys are reversed when the menubar has RTL directionality', function() {
|
|
||||||
var LEFT = 37;
|
|
||||||
var RIGHT = 39;
|
|
||||||
|
|
||||||
test('left key moves to the next item', function() {
|
|
||||||
var rtlContainer = fixture('rtl');
|
|
||||||
var menubar = rtlContainer.querySelector('test-menubar');
|
|
||||||
menubar.selected = 0;
|
|
||||||
menubar.items[1].click();
|
|
||||||
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[1]);
|
|
||||||
|
|
||||||
MockInteractions.pressAndReleaseKeyOn(menubar, LEFT);
|
|
||||||
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[2],
|
|
||||||
'`document.activeElement` should be the next item.');
|
|
||||||
assert.equal(menubar.selected, 1,
|
|
||||||
'`menubar.selected` should not change.');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('right key moves to the previous item', function() {
|
|
||||||
var rtlContainer = fixture('rtl');
|
|
||||||
var menubar = rtlContainer.querySelector('test-menubar');
|
|
||||||
menubar.selected = 0;
|
|
||||||
menubar.items[1].click();
|
|
||||||
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[1]);
|
|
||||||
|
|
||||||
MockInteractions.pressAndReleaseKeyOn(menubar, RIGHT);
|
|
||||||
|
|
||||||
assert.equal(Polymer.dom(document).activeElement, menubar.items[0],
|
|
||||||
'`document.activeElement` should be the previous item');
|
|
||||||
assert.equal(menubar.selected, 1,
|
|
||||||
'`menubar.selected` should not change.');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,46 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-menu-behavior.html">
|
|
||||||
|
|
||||||
<dom-module id="test-menu">
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<content></content>
|
|
||||||
|
|
||||||
<div id="extraContent" tabindex="-1">focusable extra content</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'test-menu',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronMenuBehavior
|
|
||||||
],
|
|
||||||
|
|
||||||
get extraContent() {
|
|
||||||
return this.$.extraContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,46 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-menubar-behavior.html">
|
|
||||||
|
|
||||||
<dom-module id="test-menubar">
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<content></content>
|
|
||||||
|
|
||||||
<div id="extraContent" tabindex="-1">focusable extra content</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'test-menubar',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronMenubarBehavior
|
|
||||||
],
|
|
||||||
|
|
||||||
get extraContent() {
|
|
||||||
return this.$.extraContent;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -10,6 +10,5 @@
|
||||||
"_release": "e-tag:fa7357706",
|
"_release": "e-tag:fa7357706",
|
||||||
"_source": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip",
|
"_source": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip",
|
||||||
"_target": "*",
|
"_target": "*",
|
||||||
"_originalSource": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip",
|
"_originalSource": "https://github.com/Arnavion/libjass/releases/download/v0.11.0/libjass.zip"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
9650
dashboard-ui/bower_components/libjass/libjass.js
vendored
9650
dashboard-ui/bower_components/libjass/libjass.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,50 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-button",
|
|
||||||
"version": "1.0.12",
|
|
||||||
"description": "Material design button",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"web-component",
|
|
||||||
"polymer",
|
|
||||||
"paper",
|
|
||||||
"button"
|
|
||||||
],
|
|
||||||
"main": "paper-button.html",
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-button.git"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-button",
|
|
||||||
"dependencies": {
|
|
||||||
"polymer": "Polymer/polymer#^1.1.0",
|
|
||||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
|
||||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
|
||||||
"paper-material": "PolymerElements/paper-material#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
|
||||||
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
|
||||||
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
|
|
||||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"ignore": [],
|
|
||||||
"_release": "1.0.12",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.0.12",
|
|
||||||
"commit": "96c3a2661c355223d0b41e1d34126f9c62d544dc"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/PolymerElements/paper-button.git",
|
|
||||||
"_target": "~1.0.1",
|
|
||||||
"_originalSource": "PolymerElements/paper-button"
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
<!-- Instructions: https://github.com/PolymerElements/paper-button/CONTRIBUTING.md#filing-issues -->
|
|
||||||
### Description
|
|
||||||
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
|
|
||||||
|
|
||||||
### Expected outcome
|
|
||||||
|
|
||||||
<!-- Example: The page stays the same color. -->
|
|
||||||
|
|
||||||
### Actual outcome
|
|
||||||
|
|
||||||
<!-- Example: The page turns pink. -->
|
|
||||||
|
|
||||||
### Live Demo
|
|
||||||
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
|
|
||||||
|
|
||||||
### Steps to reproduce
|
|
||||||
|
|
||||||
<!-- Example
|
|
||||||
1. Put a `paper-foo` element in the page.
|
|
||||||
2. Open the page in a web browser.
|
|
||||||
3. Click the `paper-foo` element.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Browsers Affected
|
|
||||||
<!-- Check all that apply -->
|
|
||||||
- [ ] Chrome
|
|
||||||
- [ ] Firefox
|
|
||||||
- [ ] Safari 9
|
|
||||||
- [ ] Safari 8
|
|
||||||
- [ ] Safari 7
|
|
||||||
- [ ] Edge
|
|
||||||
- [ ] IE 11
|
|
||||||
- [ ] IE 10
|
|
|
@ -1 +0,0 @@
|
||||||
bower_components
|
|
|
@ -1,23 +0,0 @@
|
||||||
language: node_js
|
|
||||||
sudo: required
|
|
||||||
before_script:
|
|
||||||
- npm install -g bower polylint web-component-tester
|
|
||||||
- bower install
|
|
||||||
- polylint
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: geFs7Ipj7/9knSKT2FEYAB7b/zbmgWFXCgZm7cEcrG71EX/HB1do3spANGOlRly77xaZtNNF1OGYBHIP36DSyMEHRYj6TYtTrPIr2ySeHvoOv0nzYakXdscxBvfI5HJrNiFpld80KoGl8vKfroLNpVLallgumX3diydypolvW1I=
|
|
||||||
- secure: IILEhg3m49exN5hpxbPP1JA/q+s4v/QpOMbDiXVRV4Uz1XwOPGLCyrAB0ENjwzMCyeOah1Z2MyQSUiPisLheHKvZifhviNqizWN//8EDkg1gkU0R6egGdotD5mBb3UpCD0CNZ8+D0FYwOpdCWCruwr7N+zDUN+6r5H07KP/VeUU=
|
|
||||||
node_js: stable
|
|
||||||
addons:
|
|
||||||
firefox: latest
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
sauce_connect: true
|
|
||||||
script:
|
|
||||||
- xvfb-run wct
|
|
||||||
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
|
|
||||||
dist: trusty
|
|
|
@ -1,77 +0,0 @@
|
||||||
<!--
|
|
||||||
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 :)
|
|
||||||
|
|
||||||
You can however override the jsbin link with one that's customized to this
|
|
||||||
specific element:
|
|
||||||
|
|
||||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
|
||||||
-->
|
|
||||||
|
|
||||||
# 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: [https://jsbin.com/cagaye/edit?html,output](https://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 in the pull request description using the following syntax:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
(For a single issue)
|
|
||||||
Fixes #20
|
|
||||||
|
|
||||||
(For multiple issues)
|
|
||||||
Fixes #32, fixes #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!
|
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-button",
|
|
||||||
"version": "1.0.12",
|
|
||||||
"description": "Material design button",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"web-component",
|
|
||||||
"polymer",
|
|
||||||
"paper",
|
|
||||||
"button"
|
|
||||||
],
|
|
||||||
"main": "paper-button.html",
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-button.git"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-button",
|
|
||||||
"dependencies": {
|
|
||||||
"polymer": "Polymer/polymer#^1.1.0",
|
|
||||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
|
||||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
|
|
||||||
"paper-material": "PolymerElements/paper-material#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
|
|
||||||
"iron-icon": "PolymerElements/iron-icon#^1.0.0",
|
|
||||||
"iron-icons": "PolymerElements/iron-icons#^1.0.0",
|
|
||||||
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"ignore": []
|
|
||||||
}
|
|
|
@ -1,138 +0,0 @@
|
||||||
<!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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<title>paper-button demo</title>
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
|
|
||||||
<link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
|
|
||||||
<link rel="import" href="../../iron-icons/iron-icons.html">
|
|
||||||
<link rel="import" href="../../paper-styles/color.html">
|
|
||||||
<link rel="import" href="../paper-button.html">
|
|
||||||
|
|
||||||
<style is="custom-style" include="demo-pages-shared-styles">
|
|
||||||
.vertical-section-container {
|
|
||||||
max-width: 500px;
|
|
||||||
}
|
|
||||||
paper-button {
|
|
||||||
margin-left: 10px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body unresolved>
|
|
||||||
<div class="vertical-section-container centered">
|
|
||||||
<h3>Buttons can be flat, raised, toggleable, or disabled</h3>
|
|
||||||
<demo-snippet class="centered-demo">
|
|
||||||
<template>
|
|
||||||
<paper-button>link</paper-button>
|
|
||||||
<paper-button raised>raised</paper-button>
|
|
||||||
<paper-button toggles raised>toggles</paper-button>
|
|
||||||
<paper-button disabled>disabled</paper-button>
|
|
||||||
</template>
|
|
||||||
</demo-snippet>
|
|
||||||
|
|
||||||
<h3>Buttons can have icons</h3>
|
|
||||||
<demo-snippet class="centered-demo">
|
|
||||||
<template>
|
|
||||||
<paper-button><iron-icon icon="check"></iron-icon>link</paper-button>
|
|
||||||
<paper-button raised><iron-icon icon="file-download"></iron-icon>raised</paper-button>
|
|
||||||
<paper-button toggles raised><iron-icon icon="favorite"></iron-icon>toggles</paper-button>
|
|
||||||
<paper-button disabled><iron-icon icon="block"></iron-icon>disabled</paper-button>
|
|
||||||
</template>
|
|
||||||
</demo-snippet>
|
|
||||||
|
|
||||||
<h3>Buttons can hide the ripple effect using the <i>noink</i> attribute</h3>
|
|
||||||
<demo-snippet class="centered-demo">
|
|
||||||
<template>
|
|
||||||
<paper-button noink>link</paper-button>
|
|
||||||
<paper-button raised noink>raised</paper-button>
|
|
||||||
<paper-button toggles raised noink>toggles</paper-button>
|
|
||||||
<paper-button disabled noink>disabled</paper-button>
|
|
||||||
</template>
|
|
||||||
</demo-snippet>
|
|
||||||
|
|
||||||
<h3>Buttons can be styled using custom properties</h3>
|
|
||||||
<demo-snippet class="centered-demo">
|
|
||||||
<template>
|
|
||||||
<paper-button class="custom pink">link</paper-button>
|
|
||||||
<paper-button raised class="custom indigo">raised</paper-button>
|
|
||||||
<paper-button toggles raised class="custom green">toggles</paper-button>
|
|
||||||
<paper-button disabled class="custom disabled">disabled</paper-button>
|
|
||||||
|
|
||||||
<style is="custom-style">
|
|
||||||
paper-button.custom {
|
|
||||||
--paper-button-ink-color: var(--paper-pink-a200);
|
|
||||||
/* These could also be individually defined for each of the
|
|
||||||
specific css classes, but we'll just do it once as an example */
|
|
||||||
--paper-button-flat-keyboard-focus: {
|
|
||||||
background-color: var(--paper-pink-a200);
|
|
||||||
color: white !important;
|
|
||||||
};
|
|
||||||
--paper-button-raised-keyboard-focus: {
|
|
||||||
background-color: var(--paper-pink-a200) !important;
|
|
||||||
color: white !important;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
paper-button.custom:hover {
|
|
||||||
background-color: var(--paper-indigo-100);
|
|
||||||
}
|
|
||||||
paper-button.pink {
|
|
||||||
color: var(--paper-pink-a200);
|
|
||||||
|
|
||||||
}
|
|
||||||
paper-button.indigo {
|
|
||||||
background-color: var(--paper-indigo-500);
|
|
||||||
color: white;
|
|
||||||
--paper-button-raised-keyboard-focus: {
|
|
||||||
background-color: var(--paper-pink-a200) !important;
|
|
||||||
color: white !important;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
paper-button.green {
|
|
||||||
background-color: var(--paper-green-500);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
paper-button.green[active] {
|
|
||||||
background-color: var(--paper-red-500);
|
|
||||||
}
|
|
||||||
paper-button.disabled {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</template>
|
|
||||||
</demo-snippet>
|
|
||||||
|
|
||||||
<h3>Buttons can be used as a link</h3>
|
|
||||||
<demo-snippet class="centered-demo">
|
|
||||||
<template>
|
|
||||||
<a href="https://www.polymer-project.org/" tabindex="-1">
|
|
||||||
<paper-button raised>Polymer Project</paper-button>
|
|
||||||
</a>
|
|
||||||
<style>
|
|
||||||
a paper-button,
|
|
||||||
a:active paper-button,
|
|
||||||
a:visited paper-button {
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</template>
|
|
||||||
</demo-snippet>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,26 +0,0 @@
|
||||||
<!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>
|
|
|
@ -1,178 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-flex-layout/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../paper-behaviors/paper-button-behavior.html">
|
|
||||||
<link rel="import" href="../paper-material/paper-material.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Material design: [Buttons](https://www.google.com/design/spec/components/buttons.html)
|
|
||||||
|
|
||||||
`paper-button` is a button. When the user touches the button, a ripple effect emanates
|
|
||||||
from the point of contact. It may be flat or raised. A raised button is styled with a
|
|
||||||
shadow.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
<paper-button>Flat button</paper-button>
|
|
||||||
<paper-button raised>Raised button</paper-button>
|
|
||||||
<paper-button noink>No ripple effect</paper-button>
|
|
||||||
<paper-button toggles>Toggle-able button</paper-button>
|
|
||||||
|
|
||||||
A button that has `toggles` true will remain `active` after being clicked (and
|
|
||||||
will have an `active` attribute set). For more information, see the `Polymer.IronButtonState`
|
|
||||||
behavior.
|
|
||||||
|
|
||||||
You may use custom DOM in the button body to create a variety of buttons. For example, to
|
|
||||||
create a button with an icon and some text:
|
|
||||||
|
|
||||||
<paper-button>
|
|
||||||
<iron-icon icon="favorite"></iron-icon>
|
|
||||||
custom button content
|
|
||||||
</paper-button>
|
|
||||||
|
|
||||||
To use `paper-button` as a link, wrap it in an anchor tag. Since `paper-button` will already
|
|
||||||
receive focus, you may want to prevent the anchor tag from receiving focus as well by setting
|
|
||||||
its tabindex to -1.
|
|
||||||
|
|
||||||
<a href="https://www.polymer-project.org/" tabindex="-1">
|
|
||||||
<paper-button raised>Polymer Project</paper-button>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
### Styling
|
|
||||||
|
|
||||||
Style the button with CSS as you would a normal DOM element.
|
|
||||||
|
|
||||||
paper-button.fancy {
|
|
||||||
background: green;
|
|
||||||
color: yellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-button.fancy:hover {
|
|
||||||
background: lime;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-button[disabled],
|
|
||||||
paper-button[toggles][active] {
|
|
||||||
background: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
By default, the ripple is the same color as the foreground at 25% opacity. You may
|
|
||||||
customize the color using the `--paper-button-ink-color` custom property.
|
|
||||||
|
|
||||||
The following custom properties and mixins are also available for styling:
|
|
||||||
|
|
||||||
Custom property | Description | Default
|
|
||||||
----------------|-------------|----------
|
|
||||||
`--paper-button-ink-color` | Background color of the ripple | `Based on the button's color`
|
|
||||||
`--paper-button` | Mixin applied to the button | `{}`
|
|
||||||
`--paper-button-disabled` | Mixin applied to the disabled button. Note that you can also use the `paper-button[disabled]` selector | `{}`
|
|
||||||
`--paper-button-flat-keyboard-focus` | Mixin applied to a flat button after it's been focused using the keyboard | `{}`
|
|
||||||
`--paper-button-raised-keyboard-focus` | Mixin applied to a raised button after it's been focused using the keyboard | `{}`
|
|
||||||
|
|
||||||
@demo demo/index.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-button">
|
|
||||||
<template strip-whitespace>
|
|
||||||
<style include="paper-material">
|
|
||||||
:host {
|
|
||||||
@apply(--layout-inline);
|
|
||||||
@apply(--layout-center-center);
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-width: 5.14em;
|
|
||||||
margin: 0 0.29em;
|
|
||||||
background: transparent;
|
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
||||||
-webkit-tap-highlight-color: transparent;
|
|
||||||
font: inherit;
|
|
||||||
text-transform: uppercase;
|
|
||||||
outline-width: 0;
|
|
||||||
border-radius: 3px;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
cursor: pointer;
|
|
||||||
z-index: 0;
|
|
||||||
padding: 0.7em 0.57em;
|
|
||||||
|
|
||||||
@apply(--paper-font-common-base);
|
|
||||||
@apply(--paper-button);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host([raised].keyboard-focus) {
|
|
||||||
font-weight: bold;
|
|
||||||
@apply(--paper-button-raised-keyboard-focus);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host(:not([raised]).keyboard-focus) {
|
|
||||||
font-weight: bold;
|
|
||||||
@apply(--paper-button-flat-keyboard-focus);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host([disabled]) {
|
|
||||||
background: #eaeaea;
|
|
||||||
color: #a8a8a8;
|
|
||||||
cursor: auto;
|
|
||||||
pointer-events: none;
|
|
||||||
|
|
||||||
@apply(--paper-button-disabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-ripple {
|
|
||||||
color: var(--paper-button-ink-color);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<content></content>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
is: 'paper-button',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.PaperButtonBehavior
|
|
||||||
],
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
/**
|
|
||||||
* If true, the button should be styled with a shadow.
|
|
||||||
*/
|
|
||||||
raised: {
|
|
||||||
type: Boolean,
|
|
||||||
reflectToAttribute: true,
|
|
||||||
value: false,
|
|
||||||
observer: '_calculateElevation'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_calculateElevation: function() {
|
|
||||||
if (!this.raised) {
|
|
||||||
this._setElevation(0);
|
|
||||||
} else {
|
|
||||||
Polymer.PaperButtonBehaviorImpl._calculateElevation.apply(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Fired when the animation finishes.
|
|
||||||
This is useful if you want to wait until
|
|
||||||
the ripple animation finishes to perform some action.
|
|
||||||
|
|
||||||
@event transitionend
|
|
||||||
Event param: {{node: Object}} detail Contains the animated node.
|
|
||||||
*/
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</dom-module>
|
|
|
@ -1,24 +0,0 @@
|
||||||
<!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>paper-button tests</title>
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<script>
|
|
||||||
WCT.loadSuites([
|
|
||||||
'paper-button.html',
|
|
||||||
'paper-button.html?dom=shadow'
|
|
||||||
]);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
</body></html>
|
|
|
@ -1,108 +0,0 @@
|
||||||
<!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>paper-button 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="../../iron-test-helpers/mock-interactions.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../paper-button.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="TrivialButton">
|
|
||||||
<template>
|
|
||||||
<paper-button>Button</paper-button>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
suite('<paper-button>', function() {
|
|
||||||
var button;
|
|
||||||
|
|
||||||
setup(function() {
|
|
||||||
button = fixture('TrivialButton');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('can be raised imperatively', function(done) {
|
|
||||||
button.raised = true;
|
|
||||||
|
|
||||||
expect(button.hasAttribute('raised')).to.be.eql(true);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
try {
|
|
||||||
expect(button.elevation).to.be.eql(1);
|
|
||||||
done();
|
|
||||||
} catch (e) {
|
|
||||||
done(e);
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('can be unraised after being raised imperatively', function(done) {
|
|
||||||
button.raised = true;
|
|
||||||
expect(button.hasAttribute('raised')).to.be.eql(true);
|
|
||||||
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
expect(button.elevation).to.be.eql(1);
|
|
||||||
|
|
||||||
button.raised = false;
|
|
||||||
expect(button.hasAttribute('raised')).to.be.eql(false);
|
|
||||||
Polymer.Base.async(function() {
|
|
||||||
expect(button.elevation).to.be.eql(0);
|
|
||||||
done();
|
|
||||||
}, 1);
|
|
||||||
}, 1);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('can be disabled imperatively', function() {
|
|
||||||
button.disabled = true;
|
|
||||||
expect(button.getAttribute('aria-disabled')).to.be.eql('true');
|
|
||||||
expect(button.hasAttribute('disabled')).to.be.eql(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('can be triggered with space', function(done) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
MockInteractions.pressSpace(button);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('can be triggered with enter', function(done) {
|
|
||||||
button.addEventListener('click', function() {
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
MockInteractions.pressEnter(button);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('<paper-button>', function() {
|
|
||||||
var button;
|
|
||||||
|
|
||||||
setup(function() {
|
|
||||||
button = fixture('TrivialButton');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('has aria role "button"', function() {
|
|
||||||
expect(button.getAttribute('role')).to.be.eql('button');
|
|
||||||
});
|
|
||||||
|
|
||||||
a11ySuite('TrivialButton');
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,41 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-menu",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"description": "Implements an accessible material design menu",
|
|
||||||
"authors": "The Polymer Authors",
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"menu"
|
|
||||||
],
|
|
||||||
"main": "paper-menu.html",
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-menu"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-menu",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"paper-item": "PolymerElements/paper-item#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"_release": "1.0.1",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.0.1",
|
|
||||||
"commit": "137caedb322ab2464730d7b1776e5c88989d2c3f"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/PolymerElements/paper-menu.git",
|
|
||||||
"_target": "~1.0.0",
|
|
||||||
"_originalSource": "PolymerElements/paper-menu"
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
bower_components/
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-menu",
|
|
||||||
"version": "1.0.1",
|
|
||||||
"description": "Implements an accessible material design menu",
|
|
||||||
"authors": "The Polymer Authors",
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"menu"
|
|
||||||
],
|
|
||||||
"main": "paper-menu.html",
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-menu"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-menu",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"paper-item": "PolymerElements/paper-item#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,80 +0,0 @@
|
||||||
<!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 http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<title>paper-menu demo</title>
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../../paper-item/paper-item.html">
|
|
||||||
<link rel="import" href="../paper-menu.html">
|
|
||||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.horizontal-section {
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar {
|
|
||||||
display: inline-block;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #ccc;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body unresolved>
|
|
||||||
<div class="horizontal-section-container">
|
|
||||||
<div>
|
|
||||||
<h4>Standard</h4>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<paper-menu class="list">
|
|
||||||
<paper-item>Inbox</paper-item>
|
|
||||||
<paper-item>Starred</paper-item>
|
|
||||||
<paper-item>Sent mail</paper-item>
|
|
||||||
<paper-item>Drafts</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h4>Pre-selected</h4>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<paper-menu class="list" selected="0">
|
|
||||||
<paper-item>Inbox</paper-item>
|
|
||||||
<paper-item disabled>Starred</paper-item>
|
|
||||||
<paper-item>Sent mail</paper-item>
|
|
||||||
<paper-item>Drafts</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h4>Multi-select</h4>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<paper-menu class="list" multi>
|
|
||||||
<paper-item>Bold</paper-item>
|
|
||||||
<paper-item>Italic</paper-item>
|
|
||||||
<paper-item>Underline</paper-item>
|
|
||||||
<paper-item>Strikethrough</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?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">
|
|
||||||
<g>
|
|
||||||
<circle cx="86.5" cy="39" r="4"/>
|
|
||||||
<path d="M138,44c-2,0-3.6-2.4-4.6-4.6c-1.1-2.1-1.7-3.4-3-3.4s-2,1.3-3,3.4c-1.1,2.1-2.2,4.6-4.9,4.6c-2.6,0-3.8-2.4-4.9-4.6
|
|
||||||
c-1.1-2.1-1.8-3.4-3.1-3.4c-1.3,0-2,1.3-3.1,3.4c-1.1,2.1-2.3,4.6-4.9,4.6c-2.6,0-4.1-2.4-5.1-4.6C100.3,37.3,100,36,98,36v-2
|
|
||||||
c3,0,4.1,2.4,5.1,4.6c1.1,2.1,1.9,3.4,3.2,3.4c1.3,0,2.1-1.3,3.2-3.4c1.1-2.1,2.3-4.6,4.9-4.6c2.6,0,3.8,2.4,4.9,4.6
|
|
||||||
c1.1,2.1,1.8,3.4,3.1,3.4c1.3,0,2-1.3,3.1-3.4c1.1-2.1,2.3-4.6,4.9-4.6s3.6,2.4,4.6,4.6c1.1,2.1,1.9,3.4,2.9,3.4V44z"/>
|
|
||||||
<circle cx="86.5" cy="63" r="4"/>
|
|
||||||
<path d="M138,68c-2,0-3.6-2.4-4.6-4.6c-1.1-2.1-1.7-3.4-3-3.4s-2,1.3-3,3.4c-1.1,2.1-2.2,4.6-4.9,4.6c-2.6,0-3.8-2.4-4.9-4.6
|
|
||||||
c-1.1-2.1-1.8-3.4-3.1-3.4c-1.3,0-2,1.3-3.1,3.4c-1.1,2.1-2.3,4.6-4.9,4.6c-2.6,0-4.1-2.4-5.1-4.6C100.3,61.3,100,60,98,60v-2
|
|
||||||
c3,0,4.1,2.4,5.1,4.6c1.1,2.1,1.9,3.4,3.2,3.4c1.3,0,2.1-1.3,3.2-3.4c1.1-2.1,2.3-4.6,4.9-4.6c2.6,0,3.8,2.4,4.9,4.6
|
|
||||||
c1.1,2.1,1.8,3.4,3.1,3.4c1.3,0,2-1.3,3.1-3.4c1.1-2.1,2.3-4.6,4.9-4.6s3.6,2.4,4.6,4.6c1.1,2.1,1.9,3.4,2.9,3.4V68z"/>
|
|
||||||
<circle cx="86.5" cy="88" r="4"/>
|
|
||||||
<path d="M138,93c-2,0-3.6-2.4-4.6-4.6c-1.1-2.1-1.7-3.4-3-3.4s-2,1.3-3,3.4c-1.1,2.1-2.2,4.6-4.9,4.6c-2.6,0-3.8-2.4-4.9-4.6
|
|
||||||
c-1.1-2.1-1.8-3.4-3.1-3.4c-1.3,0-2,1.3-3.1,3.4c-1.1,2.1-2.3,4.6-4.9,4.6c-2.6,0-4.1-2.4-5.1-4.6C100.3,86.3,100,85,98,85v-2
|
|
||||||
c3,0,4.1,2.4,5.1,4.6c1.1,2.1,1.9,3.4,3.2,3.4c1.3,0,2.1-1.3,3.2-3.4c1.1-2.1,2.3-4.6,4.9-4.6c2.6,0,3.8,2.4,4.9,4.6
|
|
||||||
c1.1,2.1,1.8,3.4,3.1,3.4c1.3,0,2-1.3,3.1-3.4c1.1-2.1,2.3-4.6,4.9-4.6s3.6,2.4,4.6,4.6c1.1,2.1,1.9,3.4,2.9,3.4V93z"/>
|
|
||||||
<path d="M151,102H73V24h78V102z M75,100h74V26H75V100z"/>
|
|
||||||
</g>
|
|
||||||
<g id="ic_x5F_add_x0D_">
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g id="Guides">
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 2.2 KiB |
|
@ -1,30 +0,0 @@
|
||||||
<!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>paper-menu</title>
|
|
||||||
|
|
||||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
|
||||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<iron-component-page></iron-component-page>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,140 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-menu-behavior/iron-menu-behavior.html">
|
|
||||||
<link rel="import" href="../paper-styles/paper-styles.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
`<paper-menu>` implements an accessible menu control with Material Design styling. The focused item
|
|
||||||
is highlighted, and the selected item has bolded text.
|
|
||||||
|
|
||||||
<paper-menu>
|
|
||||||
<paper-item>Item 1</paper-item>
|
|
||||||
<paper-item>Item 2</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
|
|
||||||
An initial selection can be specified with the `selected` attribute.
|
|
||||||
|
|
||||||
<paper-menu selected="0">
|
|
||||||
<paper-item>Item 1</paper-item>
|
|
||||||
<paper-item>Item 2</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
|
|
||||||
Make a multi-select menu with the `multi` attribute. Items in a multi-select menu can be deselected,
|
|
||||||
and multiple item can be selected.
|
|
||||||
|
|
||||||
<paper-menu multi>
|
|
||||||
<paper-item>Item 1</paper-item>
|
|
||||||
<paper-item>Item 2</paper-item>
|
|
||||||
</paper-menu>
|
|
||||||
|
|
||||||
### Styling
|
|
||||||
|
|
||||||
The following custom properties and mixins are available for styling:
|
|
||||||
|
|
||||||
Custom property | Description | Default
|
|
||||||
----------------|-------------|----------
|
|
||||||
`--paper-menu-background-color` | Menu background color | `--primary-background-color`
|
|
||||||
`--paper-menu-color` | Menu foreground color | `--primary-text-color`
|
|
||||||
`--paper-menu-disabled-color` | Foreground color for a disabled item | `--disabled-text-color`
|
|
||||||
`--paper-menu` | Mixin applied to the menu | `{}`
|
|
||||||
`--paper-menu-selected-item` | Mixin applied to the selected item | `{}`
|
|
||||||
`--paper-menu-focused-item` | Mixin applied to the focused item | `{}`
|
|
||||||
`--paper-menu-focused-item-after` | Mixin applied to the ::after pseudo-element for the focused item | `{}`
|
|
||||||
|
|
||||||
### Accessibility
|
|
||||||
|
|
||||||
`<paper-menu>` has `role="menu"` by default. A multi-select menu will also have
|
|
||||||
`aria-multiselectable` set. It implements key bindings to navigate through the menu with the up and
|
|
||||||
down arrow keys, esc to exit the menu, and enter to activate a menu item. Typing the first letter
|
|
||||||
of a menu item will also focus it.
|
|
||||||
|
|
||||||
@group Paper Elements
|
|
||||||
@element paper-menu
|
|
||||||
@hero hero.svg
|
|
||||||
@demo demo/index.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-menu">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
padding: 8px 0;
|
|
||||||
|
|
||||||
background: var(--paper-menu-background-color, --primary-background-color);
|
|
||||||
color: var(--paper-menu-color, --primary-text-color);
|
|
||||||
|
|
||||||
@apply(--paper-menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* need a wrapper element to make this higher specificity than the :host rule in paper-item */
|
|
||||||
.content > ::content > .iron-selected {
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
@apply(--paper-menu-selected-item);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content > ::content > [disabled] {
|
|
||||||
color: var(--paper-menu-disabled-color, --disabled-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content > ::content > *:focus {
|
|
||||||
position: relative;
|
|
||||||
outline: 0;
|
|
||||||
|
|
||||||
@apply(--paper-menu-focused-item);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content > ::content > *:focus:after {
|
|
||||||
@apply(--layout-fit);
|
|
||||||
background: currentColor;
|
|
||||||
/* FIXME move to paper-styles for next widget */
|
|
||||||
opacity: 0.12;
|
|
||||||
content: '';
|
|
||||||
|
|
||||||
@apply(--paper-menu-focused-item-after);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content > ::content > *[colored]:focus:after {
|
|
||||||
opacity: 0.26;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<content></content>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'paper-menu',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronMenuBehavior
|
|
||||||
]
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>paper-menu tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
WCT.loadSuites([
|
|
||||||
'paper-menu.html'
|
|
||||||
]);
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,67 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>paper-menu tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<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="../paper-menu.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="basic">
|
|
||||||
<template>
|
|
||||||
<paper-menu>
|
|
||||||
<div>item 1</div>
|
|
||||||
<div>item 2</div>
|
|
||||||
<div>item 3</div>
|
|
||||||
</paper-menu>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
suite('<paper-menu>', function() {
|
|
||||||
var menu;
|
|
||||||
|
|
||||||
setup(function() {
|
|
||||||
menu = fixture('basic');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected item is styled', function() {
|
|
||||||
|
|
||||||
var boldDiv = document.createElement('div');
|
|
||||||
boldDiv.style.fontWeight = 'bold';
|
|
||||||
document.body.appendChild(boldDiv);
|
|
||||||
|
|
||||||
menu.selected = 1;
|
|
||||||
|
|
||||||
assert.equal(getComputedStyle(menu.selectedItem).fontWeight,
|
|
||||||
getComputedStyle(boldDiv).fontWeight, 'selected item is bold');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,43 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-spinner",
|
|
||||||
"version": "1.0.4",
|
|
||||||
"description": "A material design spinner",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"spinner",
|
|
||||||
"loading"
|
|
||||||
],
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-spinner"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-spinner",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.1.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"main": "paper-spinner.html",
|
|
||||||
"_release": "1.0.4",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.0.4",
|
|
||||||
"commit": "731e067cada82c724df9bd676dfd7324699e4793"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/PolymerElements/paper-spinner.git",
|
|
||||||
"_target": "~1.0.1",
|
|
||||||
"_originalSource": "PolymerElements/paper-spinner"
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
bower_components/
|
|
|
@ -1,28 +0,0 @@
|
||||||
language: node_js
|
|
||||||
sudo: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- node_js: stable
|
|
||||||
script: xvfb-run wct
|
|
||||||
addons:
|
|
||||||
firefox: latest
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
- node_js: node
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
|
||||||
wct -s 'default'
|
|
||||||
fi
|
|
||||||
before_script:
|
|
||||||
- npm install web-component-tester
|
|
||||||
- npm install bower
|
|
||||||
- export PATH=$PWD/node_modules/.bin:$PATH
|
|
||||||
- bower install
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: dpHtK5BMl68o/D6cQO9VsQWBPVuTrFPC56NT6kBLbiQtmxG2E2FD8dN4cHuEWafZopwYSsLLmEIIK77FMaonTSmzos5EixIQyqGxWTyNTpthg0Jenzc+6vZEs3h+3LDodFjdZSu8FgKyxU8SFLLGjAsSy8aegUNBszy7/SY8FAM=
|
|
||||||
- secure: EASvFsWb/njjh3DOLD5Oz3nw4QPl4aIhDAIhU2qelb2UCp8Q/KGniU7VjNoQ7OSN05jh2ooz8Pu3cAhLmrWumJn2atXEXvRPKtT/+1Ciy3xFcvgmqM0RHB+7qSSOUwgvPW9bwdzVxxMjAW7Oqb7w3nVn9/mEv2sMPNSv7iEbiUI=
|
|
|
@ -1,72 +0,0 @@
|
||||||
|
|
||||||
<!--
|
|
||||||
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!
|
|
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-spinner",
|
|
||||||
"version": "1.0.4",
|
|
||||||
"description": "A material design spinner",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"spinner",
|
|
||||||
"loading"
|
|
||||||
],
|
|
||||||
"private": true,
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-spinner"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-spinner",
|
|
||||||
"ignore": [],
|
|
||||||
"dependencies": {
|
|
||||||
"iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.1.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"test-fixture": "PolymerElements/test-fixture#^1.0.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
|
||||||
},
|
|
||||||
"main": "paper-spinner.html"
|
|
||||||
}
|
|
|
@ -1,97 +0,0 @@
|
||||||
<!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 lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>paper-spinner demo</title>
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<link rel="import" href="../../paper-styles/demo-pages.html">
|
|
||||||
<link rel="import" href="../paper-spinner.html">
|
|
||||||
|
|
||||||
<style is="custom-style">
|
|
||||||
.horizontal-section {
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-spinner, button {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-spinner.blue {
|
|
||||||
--paper-spinner-layer-1-color: var(--paper-light-blue-500);
|
|
||||||
--paper-spinner-layer-2-color: var(--paper-light-blue-500);
|
|
||||||
--paper-spinner-layer-3-color: var(--paper-light-blue-500);
|
|
||||||
--paper-spinner-layer-4-color: var(--paper-light-blue-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-spinner.red {
|
|
||||||
--paper-spinner-layer-1-color: var(--paper-red-500);
|
|
||||||
--paper-spinner-layer-2-color: var(--paper-red-500);
|
|
||||||
--paper-spinner-layer-3-color: var(--paper-red-500);
|
|
||||||
--paper-spinner-layer-4-color: var(--paper-red-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-spinner.orange {
|
|
||||||
--paper-spinner-layer-1-color: var(--paper-orange-500);
|
|
||||||
--paper-spinner-layer-2-color: var(--paper-orange-500);
|
|
||||||
--paper-spinner-layer-3-color: var(--paper-orange-500);
|
|
||||||
--paper-spinner-layer-4-color: var(--paper-orange-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-spinner.green {
|
|
||||||
--paper-spinner-layer-1-color: var(--paper-green-500);
|
|
||||||
--paper-spinner-layer-2-color: var(--paper-green-500);
|
|
||||||
--paper-spinner-layer-3-color: var(--paper-green-500);
|
|
||||||
--paper-spinner-layer-4-color: var(--paper-green-500);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body unresolved>
|
|
||||||
<div class="horizontal-section-container">
|
|
||||||
<div>
|
|
||||||
<h4>Default</h4>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<paper-spinner></paper-spinner>
|
|
||||||
<paper-spinner active></paper-spinner>
|
|
||||||
<paper-spinner></paper-spinner>
|
|
||||||
<paper-spinner active></paper-spinner>
|
|
||||||
<button onclick="toggle(event)">Toggle</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h4>Color</h4>
|
|
||||||
<div class="horizontal-section">
|
|
||||||
<paper-spinner class="blue" active></paper-spinner>
|
|
||||||
<paper-spinner class="red" active></paper-spinner>
|
|
||||||
<paper-spinner class="orange" active></paper-spinner>
|
|
||||||
<paper-spinner class="green" active></paper-spinner>
|
|
||||||
<button onclick="toggle(event)">Toggle</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function toggle(event) {
|
|
||||||
var spinners = event.target.parentElement.querySelectorAll('paper-spinner');
|
|
||||||
Array.prototype.forEach.call(spinners, function(spinner) {
|
|
||||||
spinner.active = !spinner.active;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,27 +0,0 @@
|
||||||
<?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">
|
|
||||||
<g>
|
|
||||||
<path d="M112.1,92.3c-13.4,0-25.1-9.1-28.4-22l1.9-0.5c3.1,12.1,13.9,20.5,26.4,20.5c15,0,27.3-12.2,27.3-27.3
|
|
||||||
s-12.2-27.3-27.3-27.3c-8.1,0-15.8,3.6-21,9.8l-1.5-1.3c5.6-6.7,13.8-10.6,22.5-10.6c16.1,0,29.3,13.1,29.3,29.3
|
|
||||||
S128.2,92.3,112.1,92.3z"/>
|
|
||||||
<path d="M112.7,87.3c-6.6,0-12.7-2.5-17.3-7.2c-4.6-4.6-7.2-10.8-7.2-17.3c0-6.6,2.5-12.7,7.2-17.3c7.9-7.9,20.2-9.5,29.8-3.8
|
|
||||||
l-1,1.7c-8.8-5.3-20.1-3.8-27.4,3.5c-4.2,4.2-6.6,9.9-6.6,15.9s2.3,11.7,6.6,15.9s9.9,6.6,15.9,6.6c6,0,11.7-2.3,15.9-6.6
|
|
||||||
c4.7-4.7,7.1-11.3,6.5-18l2-0.2c0.7,7.3-1.9,14.4-7.1,19.6C125.4,84.7,119.2,87.3,112.7,87.3z"/>
|
|
||||||
<path d="M112.5,43.5C101.8,43.5,93,52.3,93,63s8.7,19.5,19.5,19.5S132,73.7,132,63S123.2,43.5,112.5,43.5z M119,64h-6v6h-2v-6h-6
|
|
||||||
v-2h6v-6h2v6h6V64z"/>
|
|
||||||
</g>
|
|
||||||
<g id="ic_x5F_add_x0D_">
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g id="Guides">
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.4 KiB |
|
@ -1,30 +0,0 @@
|
||||||
<!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>paper-spinner</title>
|
|
||||||
|
|
||||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../polymer/polymer.html">
|
|
||||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<iron-component-page></iron-component-page>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,338 +0,0 @@
|
||||||
<!--
|
|
||||||
@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
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-spinner-styles">
|
|
||||||
<template>
|
|
||||||
<style>
|
|
||||||
/*
|
|
||||||
/**************************/
|
|
||||||
/* STYLES FOR THE SPINNER */
|
|
||||||
/**************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Constants:
|
|
||||||
* STROKEWIDTH = 3px
|
|
||||||
* ARCSIZE = 270 degrees (amount of circle the arc takes up)
|
|
||||||
* ARCTIME = 1333ms (time it takes to expand and contract arc)
|
|
||||||
* ARCSTARTROT = 216 degrees (how much the start location of the arc
|
|
||||||
* should rotate each time, 216 gives us a
|
|
||||||
* 5 pointed star shape (it's 360/5 * 3).
|
|
||||||
* For a 7 pointed star, we might do
|
|
||||||
* 360/7 * 3 = 154.286)
|
|
||||||
* CONTAINERWIDTH = 28px
|
|
||||||
* SHRINK_TIME = 400ms
|
|
||||||
*/
|
|
||||||
|
|
||||||
:host {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
width: 28px; /* CONTAINERWIDTH */
|
|
||||||
height: 28px; /* CONTAINERWIDTH */
|
|
||||||
}
|
|
||||||
|
|
||||||
#spinnerContainer {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
/* The spinner does not have any contents that would have to be
|
|
||||||
* flipped if the direction changes. Always use ltr so that the
|
|
||||||
* style works out correctly in both cases. */
|
|
||||||
direction: ltr;
|
|
||||||
}
|
|
||||||
|
|
||||||
#spinnerContainer.active {
|
|
||||||
/* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
|
|
||||||
-webkit-animation: container-rotate 1568ms linear infinite;
|
|
||||||
animation: container-rotate 1568ms linear infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes container-rotate {
|
|
||||||
to { -webkit-transform: rotate(360deg) }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes container-rotate {
|
|
||||||
to { transform: rotate(360deg) }
|
|
||||||
}
|
|
||||||
|
|
||||||
.spinner-layer {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
opacity: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layer-1 {
|
|
||||||
border-color: var(--paper-spinner-layer-1-color, --google-blue-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.layer-2 {
|
|
||||||
border-color: var(--paper-spinner-layer-2-color, --google-red-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.layer-3 {
|
|
||||||
border-color: var(--paper-spinner-layer-3-color, --google-yellow-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.layer-4 {
|
|
||||||
border-color: var(--paper-spinner-layer-4-color, --google-green-500);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee):
|
|
||||||
*
|
|
||||||
* iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't
|
|
||||||
* guarantee that the animation will start _exactly_ after that value. So we avoid using
|
|
||||||
* animation-delay and instead set custom keyframes for each color (as layer-2undant as it
|
|
||||||
* seems).
|
|
||||||
*
|
|
||||||
* We write out each animation in full (instead of separating animation-name,
|
|
||||||
* animation-duration, etc.) because under the polyfill, Safari does not recognize those
|
|
||||||
* specific properties properly, treats them as -webkit-animation, and overrides the
|
|
||||||
* other animation rules. See https://github.com/Polymer/platform/issues/53.
|
|
||||||
*/
|
|
||||||
.active .spinner-layer.layer-1 {
|
|
||||||
/* durations: 4 * ARCTIME */
|
|
||||||
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-1-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-1-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active .spinner-layer.layer-2 {
|
|
||||||
/* durations: 4 * ARCTIME */
|
|
||||||
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-2-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-2-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active .spinner-layer.layer-3 {
|
|
||||||
/* durations: 4 * ARCTIME */
|
|
||||||
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-3-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-3-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active .spinner-layer.layer-4 {
|
|
||||||
/* durations: 4 * ARCTIME */
|
|
||||||
-webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-4-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, layer-4-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes fill-unfill-rotate {
|
|
||||||
12.5% { -webkit-transform: rotate(135deg); } /* 0.5 * ARCSIZE */
|
|
||||||
25% { -webkit-transform: rotate(270deg); } /* 1 * ARCSIZE */
|
|
||||||
37.5% { -webkit-transform: rotate(405deg); } /* 1.5 * ARCSIZE */
|
|
||||||
50% { -webkit-transform: rotate(540deg); } /* 2 * ARCSIZE */
|
|
||||||
62.5% { -webkit-transform: rotate(675deg); } /* 2.5 * ARCSIZE */
|
|
||||||
75% { -webkit-transform: rotate(810deg); } /* 3 * ARCSIZE */
|
|
||||||
87.5% { -webkit-transform: rotate(945deg); } /* 3.5 * ARCSIZE */
|
|
||||||
to { -webkit-transform: rotate(1080deg); } /* 4 * ARCSIZE */
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fill-unfill-rotate {
|
|
||||||
12.5% { transform: rotate(135deg); } /* 0.5 * ARCSIZE */
|
|
||||||
25% { transform: rotate(270deg); } /* 1 * ARCSIZE */
|
|
||||||
37.5% { transform: rotate(405deg); } /* 1.5 * ARCSIZE */
|
|
||||||
50% { transform: rotate(540deg); } /* 2 * ARCSIZE */
|
|
||||||
62.5% { transform: rotate(675deg); } /* 2.5 * ARCSIZE */
|
|
||||||
75% { transform: rotate(810deg); } /* 3 * ARCSIZE */
|
|
||||||
87.5% { transform: rotate(945deg); } /* 3.5 * ARCSIZE */
|
|
||||||
to { transform: rotate(1080deg); } /* 4 * ARCSIZE */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HACK: Even though the intention is to have the current .spinner-layer at
|
|
||||||
* `opacity: 1`, we set it to `opacity: 0.99` instead since this forces Chrome
|
|
||||||
* to do proper subpixel rendering for the elements being animated. This is
|
|
||||||
* especially visible in Chrome 39 on Ubuntu 14.04. See:
|
|
||||||
*
|
|
||||||
* - https://github.com/Polymer/paper-spinner/issues/9
|
|
||||||
* - https://code.google.com/p/chromium/issues/detail?id=436255
|
|
||||||
*/
|
|
||||||
@-webkit-keyframes layer-1-fade-in-out {
|
|
||||||
from { opacity: 0.99; }
|
|
||||||
25% { opacity: 0.99; }
|
|
||||||
26% { opacity: 0; }
|
|
||||||
89% { opacity: 0; }
|
|
||||||
90% { opacity: 0.99; }
|
|
||||||
100% { opacity: 0.99; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes layer-1-fade-in-out {
|
|
||||||
from { opacity: 0.99; }
|
|
||||||
25% { opacity: 0.99; }
|
|
||||||
26% { opacity: 0; }
|
|
||||||
89% { opacity: 0; }
|
|
||||||
90% { opacity: 0.99; }
|
|
||||||
100% { opacity: 0.99; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes layer-2-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
15% { opacity: 0; }
|
|
||||||
25% { opacity: 0.99; }
|
|
||||||
50% { opacity: 0.99; }
|
|
||||||
51% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes layer-2-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
15% { opacity: 0; }
|
|
||||||
25% { opacity: 0.99; }
|
|
||||||
50% { opacity: 0.99; }
|
|
||||||
51% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes layer-3-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
40% { opacity: 0; }
|
|
||||||
50% { opacity: 0.99; }
|
|
||||||
75% { opacity: 0.99; }
|
|
||||||
76% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes layer-3-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
40% { opacity: 0; }
|
|
||||||
50% { opacity: 0.99; }
|
|
||||||
75% { opacity: 0.99; }
|
|
||||||
76% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes layer-4-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
65% { opacity: 0; }
|
|
||||||
75% { opacity: 0.99; }
|
|
||||||
90% { opacity: 0.99; }
|
|
||||||
100% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes layer-4-fade-in-out {
|
|
||||||
from { opacity: 0; }
|
|
||||||
65% { opacity: 0; }
|
|
||||||
75% { opacity: 0.99; }
|
|
||||||
90% { opacity: 0.99; }
|
|
||||||
100% { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Patch the gap that appear between the two adjacent div.circle-clipper while the
|
|
||||||
* spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11).
|
|
||||||
*
|
|
||||||
* Update: the gap no longer appears on Chrome when .spinner-layer's opacity is 0.99,
|
|
||||||
* but still does on Safari and IE.
|
|
||||||
*/
|
|
||||||
.gap-patch {
|
|
||||||
position: absolute;
|
|
||||||
box-sizing: border-box;
|
|
||||||
top: 0;
|
|
||||||
left: 45%;
|
|
||||||
width: 10%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gap-patch .circle {
|
|
||||||
width: 1000%;
|
|
||||||
left: -450%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-clipper {
|
|
||||||
display: inline-block;
|
|
||||||
position: relative;
|
|
||||||
width: 50%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
border-color: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-clipper .circle {
|
|
||||||
width: 200%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle {
|
|
||||||
box-sizing: border-box;
|
|
||||||
height: 100%;
|
|
||||||
border-width: 3px; /* STROKEWIDTH */
|
|
||||||
border-style: solid;
|
|
||||||
border-color: inherit;
|
|
||||||
border-bottom-color: transparent !important;
|
|
||||||
border-radius: 50%;
|
|
||||||
-webkit-animation: none;
|
|
||||||
animation: none;
|
|
||||||
|
|
||||||
@apply(--layout-fit);
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-clipper.left .circle {
|
|
||||||
border-right-color: transparent !important;
|
|
||||||
-webkit-transform: rotate(129deg);
|
|
||||||
transform: rotate(129deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle-clipper.right .circle {
|
|
||||||
left: -100%;
|
|
||||||
border-left-color: transparent !important;
|
|
||||||
-webkit-transform: rotate(-129deg);
|
|
||||||
transform: rotate(-129deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.active .circle-clipper.left .circle {
|
|
||||||
/* duration: ARCTIME */
|
|
||||||
-webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active .circle-clipper.right .circle {
|
|
||||||
/* duration: ARCTIME */
|
|
||||||
-webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes left-spin {
|
|
||||||
from { -webkit-transform: rotate(130deg); }
|
|
||||||
50% { -webkit-transform: rotate(-5deg); }
|
|
||||||
to { -webkit-transform: rotate(130deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes left-spin {
|
|
||||||
from { transform: rotate(130deg); }
|
|
||||||
50% { transform: rotate(-5deg); }
|
|
||||||
to { transform: rotate(130deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes right-spin {
|
|
||||||
from { -webkit-transform: rotate(-130deg); }
|
|
||||||
50% { -webkit-transform: rotate(5deg); }
|
|
||||||
to { -webkit-transform: rotate(-130deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes right-spin {
|
|
||||||
from { transform: rotate(-130deg); }
|
|
||||||
50% { transform: rotate(5deg); }
|
|
||||||
to { transform: rotate(-130deg); }
|
|
||||||
}
|
|
||||||
|
|
||||||
#spinnerContainer.cooldown {
|
|
||||||
/* duration: SHRINK_TIME */
|
|
||||||
-webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
||||||
animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@-webkit-keyframes fade-out {
|
|
||||||
from { opacity: 0.99; }
|
|
||||||
to { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes fade-out {
|
|
||||||
from { opacity: 0.99; }
|
|
||||||
to { opacity: 0; }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
|
@ -1,191 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-flex-layout/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../paper-styles/color.html">
|
|
||||||
<link rel="import" href="paper-spinner-styles.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Material design: [Progress & activity](https://www.google.com/design/spec/components/progress-activity.html)
|
|
||||||
|
|
||||||
Element providing material design circular spinner.
|
|
||||||
|
|
||||||
<paper-spinner active></paper-spinner>
|
|
||||||
|
|
||||||
The default spinner cycles between four layers of colors; by default they are
|
|
||||||
blue, red, yellow and green. It can be customized so that it uses one color only
|
|
||||||
by setting all the layer colors to the same value.
|
|
||||||
|
|
||||||
### Accessibility
|
|
||||||
|
|
||||||
Alt attribute should be set to provide adequate context for accessibility. If not provided,
|
|
||||||
it defaults to 'loading'.
|
|
||||||
Empty alt can be provided to mark the element as decorative if alternative content is provided
|
|
||||||
in another form (e.g. a text block following the spinner).
|
|
||||||
|
|
||||||
<paper-spinner alt="Loading contacts list" active></paper-spinner>
|
|
||||||
|
|
||||||
### Styling
|
|
||||||
|
|
||||||
The following custom properties and mixins are available for styling:
|
|
||||||
|
|
||||||
Custom property | Description | Default
|
|
||||||
----------------|-------------|----------
|
|
||||||
`--paper-spinner-layer-1-color` | Color of the first spinner rotation | `--google-blue-500`
|
|
||||||
`--paper-spinner-layer-2-color` | Color of the second spinner rotation | `--google-red-500`
|
|
||||||
`--paper-spinner-layer-3-color` | Color of the third spinner rotation | `--google-yellow-500`
|
|
||||||
`--paper-spinner-layer-4-color` | Color of the fourth spinner rotation | `--google-green-500`
|
|
||||||
|
|
||||||
@group Paper Elements
|
|
||||||
@element paper-spinner
|
|
||||||
@hero hero.svg
|
|
||||||
@demo demo/index.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-spinner">
|
|
||||||
<template>
|
|
||||||
<style include="paper-spinner-styles"></style>
|
|
||||||
|
|
||||||
<div id="spinnerContainer" class-name="[[_spinnerContainerClassName]]">
|
|
||||||
<div class="spinner-layer layer-1">
|
|
||||||
<div class="circle-clipper left">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="gap-patch">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="circle-clipper right">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="spinner-layer layer-2">
|
|
||||||
<div class="circle-clipper left">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="gap-patch">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="circle-clipper right">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="spinner-layer layer-3">
|
|
||||||
<div class="circle-clipper left">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="gap-patch">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="circle-clipper right">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="spinner-layer layer-4">
|
|
||||||
<div class="circle-clipper left">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="gap-patch">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div><div class="circle-clipper right">
|
|
||||||
<div class="circle"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
is: 'paper-spinner',
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
'animationend': 'reset',
|
|
||||||
'webkitAnimationEnd': 'reset'
|
|
||||||
},
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
/**
|
|
||||||
* Displays the spinner.
|
|
||||||
*
|
|
||||||
* @attribute active
|
|
||||||
* @type boolean
|
|
||||||
* @default false
|
|
||||||
*/
|
|
||||||
active: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false,
|
|
||||||
reflectToAttribute: true,
|
|
||||||
observer: '_activeChanged'
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Alternative text content for accessibility support.
|
|
||||||
* If alt is present, it will add an aria-label whose content matches alt when active.
|
|
||||||
* If alt is not present, it will default to 'loading' as the alt value.
|
|
||||||
*
|
|
||||||
* @attribute alt
|
|
||||||
* @type string
|
|
||||||
* @default 'loading'
|
|
||||||
*/
|
|
||||||
alt: {
|
|
||||||
type: String,
|
|
||||||
value: 'loading',
|
|
||||||
observer: '_altChanged'
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* True when the spinner is going from active to inactive. This is represented by a fade
|
|
||||||
* to 0% opacity to the user.
|
|
||||||
*/
|
|
||||||
_coolingDown: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
_spinnerContainerClassName: {
|
|
||||||
type: String,
|
|
||||||
computed: '_computeSpinnerContainerClassName(active, _coolingDown)'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_computeSpinnerContainerClassName: function(active, coolingDown) {
|
|
||||||
return [
|
|
||||||
active || coolingDown ? 'active' : '',
|
|
||||||
coolingDown ? 'cooldown' : ''
|
|
||||||
].join(' ');
|
|
||||||
},
|
|
||||||
|
|
||||||
_activeChanged: function(active, old) {
|
|
||||||
this._setAriaHidden(!active);
|
|
||||||
this._coolingDown = !active && old;
|
|
||||||
},
|
|
||||||
|
|
||||||
_altChanged: function(alt) {
|
|
||||||
// user-provided `aria-label` takes precedence over prototype default
|
|
||||||
if (alt === this.getPropertyInfo('alt').value) {
|
|
||||||
this.alt = this.getAttribute('aria-label') || alt;
|
|
||||||
} else {
|
|
||||||
this._setAriaHidden(alt==='');
|
|
||||||
this.setAttribute('aria-label', alt);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_setAriaHidden: function(hidden) {
|
|
||||||
var attr = 'aria-hidden';
|
|
||||||
if (hidden) {
|
|
||||||
this.setAttribute(attr, 'true');
|
|
||||||
} else {
|
|
||||||
this.removeAttribute(attr);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
reset: function() {
|
|
||||||
this.active = false;
|
|
||||||
this._coolingDown = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</dom-module>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>paper-spinner tests</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
WCT.loadSuites([
|
|
||||||
'paper-spinner.html'
|
|
||||||
]);
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,86 +0,0 @@
|
||||||
<!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>paper-spinner basic tests</title>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents.js"></script>
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
|
||||||
|
|
||||||
<link href="../../test-fixture/test-fixture.html" rel="import">
|
|
||||||
<link href="../paper-spinner.html" rel="import">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="PaperSpinner">
|
|
||||||
<template>
|
|
||||||
<paper-spinner></paper-spinner>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="ActivePaperSpinner">
|
|
||||||
<template>
|
|
||||||
<paper-spinner active></paper-spinner>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
suite('<paper-spinner>', function() {
|
|
||||||
|
|
||||||
suite('an accessible paper spinner', function() {
|
|
||||||
var spinner;
|
|
||||||
var activeSpinner;
|
|
||||||
|
|
||||||
setup(function() {
|
|
||||||
spinner = fixture('PaperSpinner');
|
|
||||||
activeSpinner = fixture('ActivePaperSpinner');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('adds an ARIA label when `alt` is supplied', function() {
|
|
||||||
var ALT_TEXT = 'Loading the next gif...';
|
|
||||||
|
|
||||||
spinner.alt = ALT_TEXT;
|
|
||||||
expect(spinner.getAttribute('aria-label')).to.be.eql(ALT_TEXT);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('hides from ARIA when inactive', function() {
|
|
||||||
spinner.active = false;
|
|
||||||
expect(spinner.getAttribute('aria-hidden')).to.be.eql('true');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('toggle during cooldown', function(done) {
|
|
||||||
activeSpinner.active = false;
|
|
||||||
|
|
||||||
// Set active to true before cooldown animation completes.
|
|
||||||
setTimeout(function() {
|
|
||||||
activeSpinner.active = true;
|
|
||||||
|
|
||||||
// Wait for cooldown animation to complete.
|
|
||||||
setTimeout(function() {
|
|
||||||
expect(activeSpinner.active).to.equal(true);
|
|
||||||
done();
|
|
||||||
}, 500);
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,52 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-tabs",
|
|
||||||
"version": "1.0.10",
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"description": "Material design tabs",
|
|
||||||
"private": true,
|
|
||||||
"main": "paper-tabs.html",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"tabs",
|
|
||||||
"control"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-tabs.git"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
|
|
||||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
|
||||||
"iron-icon": "polymerelements/iron-icon#^1.0.0",
|
|
||||||
"iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
|
|
||||||
"iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
|
|
||||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
|
||||||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.0.0",
|
|
||||||
"paper-icon-button": "polymerelements/paper-icon-button#^1.0.0",
|
|
||||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
|
||||||
"paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
|
|
||||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"iron-pages": "PolymerElements/iron-pages#^1.0.0"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/PolymerElements/paper-tabs",
|
|
||||||
"_release": "1.0.10",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.0.10",
|
|
||||||
"commit": "d9f518810b7313f3e5a29383d3bb86de0b260319"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/PolymerElements/paper-tabs.git",
|
|
||||||
"_target": "~1.0.0",
|
|
||||||
"_originalSource": "PolymerElements/paper-tabs"
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
bower_components/
|
|
|
@ -1,28 +0,0 @@
|
||||||
language: node_js
|
|
||||||
sudo: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- node_js: stable
|
|
||||||
script: xvfb-run wct
|
|
||||||
addons:
|
|
||||||
firefox: latest
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
- google-chrome
|
|
||||||
packages:
|
|
||||||
- google-chrome-stable
|
|
||||||
- node_js: node
|
|
||||||
script:
|
|
||||||
- |
|
|
||||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
|
||||||
wct -s 'default'
|
|
||||||
fi
|
|
||||||
before_script:
|
|
||||||
- npm install web-component-tester
|
|
||||||
- npm install bower
|
|
||||||
- export PATH=$PWD/node_modules/.bin:$PATH
|
|
||||||
- bower install
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: ieKt2HWOdClqU7OyYA20DFlWduaM0IDk91lO7mWySQL6r55SSB4DnUCgVycQJf0L6S8vyY/fbC/vFP0notyz3MvMAz1NwpRzAI9mKkVWJuaBbm9Ql9PewjanX42chbz3XyqZofXVkfBywmj61NyPM7VRVwhEHmOeYgyFUyV9cls=
|
|
||||||
- secure: g7yrxdFIVMIjkYBKZ29FHUX3noS6u1lvjUmaAaG28rGaEfXK4XR9fhZABR+6ydAjLjdo+WUMvTp4oi6HYrb6ToByprEli/fTexjeGuagDc5r5R84u3CusBuw9YYHDjstHCBFmIZndD+r4PRXkWvYatciF9c0NCHoVrjTH/woe9g=
|
|
|
@ -1,72 +0,0 @@
|
||||||
|
|
||||||
<!--
|
|
||||||
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!
|
|
|
@ -1,42 +0,0 @@
|
||||||
{
|
|
||||||
"name": "paper-tabs",
|
|
||||||
"version": "1.0.10",
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"description": "Material design tabs",
|
|
||||||
"private": true,
|
|
||||||
"main": "paper-tabs.html",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Authors"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"tabs",
|
|
||||||
"control"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/paper-tabs.git"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
|
|
||||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
|
||||||
"iron-icon": "polymerelements/iron-icon#^1.0.0",
|
|
||||||
"iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
|
|
||||||
"iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
|
|
||||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
|
||||||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
|
||||||
"polymer": "Polymer/polymer#^1.0.0",
|
|
||||||
"paper-icon-button": "polymerelements/paper-icon-button#^1.0.0",
|
|
||||||
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
|
||||||
"paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
|
|
||||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
|
||||||
"web-component-tester": "*",
|
|
||||||
"iron-pages": "PolymerElements/iron-pages#^1.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,170 +0,0 @@
|
||||||
<!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
|
|
||||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
|
||||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
|
||||||
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
|
|
||||||
-->
|
|
||||||
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<title>paper-tabs</title>
|
|
||||||
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
|
|
||||||
<link rel="import" href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
|
||||||
|
|
||||||
<link rel="import" href="../../paper-toolbar/paper-toolbar.html">
|
|
||||||
|
|
||||||
<link rel="import" href="../paper-tabs.html">
|
|
||||||
<link rel="import" href="../paper-tab.html">
|
|
||||||
|
|
||||||
<link rel="import" href="tabs-with-content-example.html">
|
|
||||||
<link rel="import" href="paper-tabs-demo-styles.html">
|
|
||||||
|
|
||||||
<style is="custom-style" include="paper-tabs-demo-styles"></style>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body unresolved>
|
|
||||||
|
|
||||||
<h3>A. No ink effect and no sliding bar</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0" noink no-bar>
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>B. The bottom bar appears to indicate the selected tab, but without sliding effect.</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0" noink no-slide>
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>C. The bar slides to the selected tab</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0" noink>
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>D. Inky Tabs</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0">
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>E. Scrollable Tabs</h3>
|
|
||||||
|
|
||||||
<paper-tabs id="scrollableTabs" selected="0" scrollable>
|
|
||||||
|
|
||||||
<paper-tab>NUMBER ONE ITEM</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>THE THIRD ITEM</paper-tab>
|
|
||||||
<paper-tab>THE ITEM FOUR</paper-tab>
|
|
||||||
<paper-tab>FIFTH</paper-tab>
|
|
||||||
<paper-tab>THE SIXTH TAB</paper-tab>
|
|
||||||
<paper-tab>NUMBER SEVEN</paper-tab>
|
|
||||||
<paper-tab>EIGHT</paper-tab>
|
|
||||||
<paper-tab>NUMBER NINE</paper-tab>
|
|
||||||
<paper-tab>THE TENTH</paper-tab>
|
|
||||||
<paper-tab>THE ITEM ELEVEN</paper-tab>
|
|
||||||
<paper-tab>TWELFTH ITEM</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>F. Scrollable tabs within right-to-left region</h3>
|
|
||||||
|
|
||||||
<div dir="rtl">
|
|
||||||
<paper-tabs selected="0" scrollable>
|
|
||||||
|
|
||||||
<paper-tab>NUMBER ONE ITEM</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>THE THIRD ITEM</paper-tab>
|
|
||||||
<paper-tab>THE ITEM FOUR</paper-tab>
|
|
||||||
<paper-tab>FIFTH</paper-tab>
|
|
||||||
<paper-tab>THE SIXTH TAB</paper-tab>
|
|
||||||
<paper-tab>NUMBER SEVEN</paper-tab>
|
|
||||||
<paper-tab>EIGHT</paper-tab>
|
|
||||||
<paper-tab>NUMBER NINE</paper-tab>
|
|
||||||
<paper-tab>THE TENTH</paper-tab>
|
|
||||||
<paper-tab>THE ITEM ELEVEN</paper-tab>
|
|
||||||
<paper-tab>TWELFTH ITEM</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h3>G. Link Tabs</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0">
|
|
||||||
|
|
||||||
<paper-tab link><a href="#item1" class="horizontal center-center layout">ITEM ONE</a></paper-tab>
|
|
||||||
<paper-tab link><a href="#item2" class="horizontal center-center layout">ITEM TWO</a></paper-tab>
|
|
||||||
<paper-tab link><a href="#item3" class="horizontal center-center layout">ITEM THREE</a></paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>H. Tabs in Toolbar</h3>
|
|
||||||
|
|
||||||
<paper-toolbar class="tall">
|
|
||||||
|
|
||||||
<paper-tabs selected="0" class="bottom self-end" style="width: 300px;">
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<div class="bottom flex"></div>
|
|
||||||
|
|
||||||
</paper-toolbar>
|
|
||||||
|
|
||||||
<h3>I. Tabs aligned to bottom</h3>
|
|
||||||
|
|
||||||
<paper-tabs selected="0" align-bottom>
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<h3>J. Bound Selection</h3>
|
|
||||||
|
|
||||||
<template is="dom-bind">
|
|
||||||
<h2>Current Tab: <span>[[selected]]</span></h2>
|
|
||||||
<paper-tabs selected="{{selected}}">
|
|
||||||
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
|
|
||||||
</paper-tabs>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<h3>J. Controlling content</h3>
|
|
||||||
|
|
||||||
<tabs-with-content-example></tabs-with-content-example>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,41 +0,0 @@
|
||||||
<dom-module id="paper-tabs-demo-styles">
|
|
||||||
<template>
|
|
||||||
<style>
|
|
||||||
:root {
|
|
||||||
--paper-toolbar-background: #00bcd4;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: sans-serif;
|
|
||||||
margin: 0;
|
|
||||||
padding: 24px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-tabs, paper-toolbar {
|
|
||||||
background-color: #00bcd4;
|
|
||||||
color: #fff;
|
|
||||||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-toolbar paper-tabs {
|
|
||||||
box-shadow: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-tabs[noink][no-bar] paper-tab.iron-selected {
|
|
||||||
color: #ffff8d;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-tabs[align-bottom] {
|
|
||||||
box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 400;
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
|
@ -1,40 +0,0 @@
|
||||||
<link rel="import" href="../paper-tabs.html">
|
|
||||||
<link rel="import" href="../paper-tab.html">
|
|
||||||
|
|
||||||
<link rel="import" href="../../iron-pages/iron-pages.html">
|
|
||||||
|
|
||||||
<link rel="import" href="paper-tabs-demo-styles.html">
|
|
||||||
|
|
||||||
<dom-module is="tabs-with-content-example">
|
|
||||||
<template>
|
|
||||||
<style include="paper-tabs-demo-styles"></style>
|
|
||||||
<style>
|
|
||||||
iron-pages {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-top: none;
|
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<paper-tabs selected="{{selected}}">
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
<iron-pages selected="{{selected}}">
|
|
||||||
<div>CONTENT ONE</div>
|
|
||||||
<div>CONTENT TWO</div>
|
|
||||||
<div>CONTENT THREE</div>
|
|
||||||
</iron-pages>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
is: 'tabs-with-content-example',
|
|
||||||
properties: {
|
|
||||||
selected: {
|
|
||||||
type: Number,
|
|
||||||
value: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</dom-module>
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?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">
|
|
||||||
<path d="M188,78H37V44h151V78z M39,76h147V46H39V76z"/>
|
|
||||||
<polygon points="66,64.8 60.6,56.8 55.3,64.8 49.2,55.6 50.8,54.4 55.3,61.2 60.6,53.2 66,61.2 71.3,53.2 77.4,62.4 75.8,63.6
|
|
||||||
71.3,56.8 "/>
|
|
||||||
<rect x="149" y="58" width="26" height="2"/>
|
|
||||||
<rect x="99" y="58" width="26" height="2"/>
|
|
||||||
<rect x="38" y="72" width="50" height="4"/>
|
|
||||||
<g id="ic_x5F_add_x0D_">
|
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
<g id="Guides">
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 966 B |
|
@ -1,25 +0,0 @@
|
||||||
<!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
|
|
||||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
|
||||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
|
||||||
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
|
|
||||||
-->
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
|
|
||||||
<title>paper-tabs</title>
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<iron-component-page sources='["paper-tabs.html", "paper-tab.html"]'></iron-component-page>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,155 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-flex-layout/classes/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
|
||||||
<link rel="import" href="../iron-behaviors/iron-button-state.html">
|
|
||||||
<link rel="import" href="../paper-behaviors/paper-ripple-behavior.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
`paper-tab` is styled to look like a tab. It should be used in conjunction with
|
|
||||||
`paper-tabs`.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
<paper-tabs selected="0">
|
|
||||||
<paper-tab>TAB 1</paper-tab>
|
|
||||||
<paper-tab>TAB 2</paper-tab>
|
|
||||||
<paper-tab>TAB 3</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
### Styling
|
|
||||||
|
|
||||||
The following custom properties and mixins are available for styling:
|
|
||||||
|
|
||||||
Custom property | Description | Default
|
|
||||||
----------------|-------------|----------
|
|
||||||
`--paper-tab-ink` | Ink color | `--paper-yellow-a100`
|
|
||||||
`--paper-tab` | Mixin applied to the tab | `{}`
|
|
||||||
`--paper-tab-content` | Mixin applied to the tab content | `{}`
|
|
||||||
`--paper-tab-content-unselected` | Mixin applied to the tab content when the tab is not selected | `{}`
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-tab">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
:host {
|
|
||||||
@apply(--layout-inline);
|
|
||||||
@apply(--layout-center);
|
|
||||||
@apply(--layout-center-justified);
|
|
||||||
@apply(--layout-flex);
|
|
||||||
|
|
||||||
position: relative;
|
|
||||||
padding: 0 12px;
|
|
||||||
overflow: hidden;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
@apply(--paper-tab);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host(:focus) {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host([link]) {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-content {
|
|
||||||
height: 100%;
|
|
||||||
-webkit-transform: translateZ(0);
|
|
||||||
transform: translateZ(0);
|
|
||||||
transition: opacity 0.1s cubic-bezier(0.4, 0.0, 1, 1);
|
|
||||||
|
|
||||||
@apply(--paper-tab-content);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host(:not(.iron-selected)) > .tab-content {
|
|
||||||
opacity: 0.8;
|
|
||||||
|
|
||||||
@apply(--paper-tab-content-unselected);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host(:focus) .tab-content {
|
|
||||||
opacity: 1;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-ripple {
|
|
||||||
color: var(--paper-tab-ink, --paper-yellow-a100);
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-content > ::content > a {
|
|
||||||
height: 100%;
|
|
||||||
/* flex */
|
|
||||||
-ms-flex: 1 1 0.000000001px;
|
|
||||||
-webkit-flex: 1;
|
|
||||||
flex: 1;
|
|
||||||
-webkit-flex-basis: 0.000000001px;
|
|
||||||
flex-basis: 0.000000001px;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<div class="tab-content flex-auto center-center horizontal layout">
|
|
||||||
<content></content>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'paper-tab',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronControlState,
|
|
||||||
Polymer.IronButtonState,
|
|
||||||
Polymer.PaperRippleBehavior
|
|
||||||
],
|
|
||||||
|
|
||||||
hostAttributes: {
|
|
||||||
role: 'tab'
|
|
||||||
},
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
down: '_updateNoink'
|
|
||||||
},
|
|
||||||
|
|
||||||
ready: function() {
|
|
||||||
var ripple = this.getRipple();
|
|
||||||
ripple.initialOpacity = 0.95;
|
|
||||||
ripple.opacityDecayVelocity = 0.98;
|
|
||||||
},
|
|
||||||
|
|
||||||
attached: function() {
|
|
||||||
this._updateNoink();
|
|
||||||
},
|
|
||||||
|
|
||||||
get _parentNoink () {
|
|
||||||
var parent = Polymer.dom(this).parentNode;
|
|
||||||
return !!parent && !!parent.noink;
|
|
||||||
},
|
|
||||||
|
|
||||||
_updateNoink: function() {
|
|
||||||
this.noink = !!this.noink || !!this._parentNoink;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,18 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-iconset-svg/iron-iconset-svg.html">
|
|
||||||
|
|
||||||
<iron-iconset-svg name="paper-tabs" size="24">
|
|
||||||
<svg><defs>
|
|
||||||
<g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></g>
|
|
||||||
<g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></g>
|
|
||||||
</defs></svg>
|
|
||||||
</iron-iconset-svg>
|
|
|
@ -1,538 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../iron-flex-layout/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
|
|
||||||
<link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html">
|
|
||||||
<link rel="import" href="../iron-menu-behavior/iron-menubar-behavior.html">
|
|
||||||
<link rel="import" href="../iron-icon/iron-icon.html">
|
|
||||||
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
|
|
||||||
<link rel="import" href="../paper-styles/color.html">
|
|
||||||
<link rel="import" href="paper-tabs-icons.html">
|
|
||||||
<link rel="import" href="paper-tab.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Material design: [Tabs](https://www.google.com/design/spec/components/tabs.html)
|
|
||||||
|
|
||||||
`paper-tabs` makes it easy to explore and switch between different views or functional aspects of
|
|
||||||
an app, or to browse categorized data sets.
|
|
||||||
|
|
||||||
Use `selected` property to get or set the selected tab.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
<paper-tabs selected="0">
|
|
||||||
<paper-tab>TAB 1</paper-tab>
|
|
||||||
<paper-tab>TAB 2</paper-tab>
|
|
||||||
<paper-tab>TAB 3</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
See <a href="#paper-tab">paper-tab</a> for more information about
|
|
||||||
`paper-tab`.
|
|
||||||
|
|
||||||
A common usage for `paper-tabs` is to use it along with `iron-pages` to switch
|
|
||||||
between different views.
|
|
||||||
|
|
||||||
<paper-tabs selected="{{selected}}">
|
|
||||||
<paper-tab>Tab 1</paper-tab>
|
|
||||||
<paper-tab>Tab 2</paper-tab>
|
|
||||||
<paper-tab>Tab 3</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
<iron-pages selected="{{selected}}">
|
|
||||||
<div>Page 1</div>
|
|
||||||
<div>Page 2</div>
|
|
||||||
<div>Page 3</div>
|
|
||||||
</iron-pages>
|
|
||||||
|
|
||||||
|
|
||||||
To use links in tabs, add `link` attribute to `paper-tab` and put an `<a>`
|
|
||||||
element in `paper-tab`.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
<paper-tabs selected="0">
|
|
||||||
<paper-tab link>
|
|
||||||
<a href="#link1" class="horizontal center-center layout">TAB ONE</a>
|
|
||||||
</paper-tab>
|
|
||||||
<paper-tab link>
|
|
||||||
<a href="#link2" class="horizontal center-center layout">TAB TWO</a>
|
|
||||||
</paper-tab>
|
|
||||||
<paper-tab link>
|
|
||||||
<a href="#link3" class="horizontal center-center layout">TAB THREE</a>
|
|
||||||
</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
|
|
||||||
### Styling
|
|
||||||
|
|
||||||
The following custom properties and mixins are available for styling:
|
|
||||||
|
|
||||||
Custom property | Description | Default
|
|
||||||
----------------|-------------|----------
|
|
||||||
`--paper-tabs-selection-bar-color` | Color for the selection bar | `--paper-yellow-a100`
|
|
||||||
`--paper-tabs` | Mixin applied to the tabs | `{}`
|
|
||||||
|
|
||||||
@hero hero.svg
|
|
||||||
@demo demo/index.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<dom-module id="paper-tabs">
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
:host {
|
|
||||||
@apply(--layout);
|
|
||||||
@apply(--layout-center);
|
|
||||||
|
|
||||||
height: 48px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
overflow: hidden;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
||||||
|
|
||||||
@apply(--paper-tabs);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host-context([dir=rtl]) {
|
|
||||||
@apply(--layout-horizontal-reverse);
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabsContainer {
|
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabsContent {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabsContent.scrollable {
|
|
||||||
position: absolute;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hidden {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.not-visible {
|
|
||||||
opacity: 0;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
paper-icon-button {
|
|
||||||
width: 48px;
|
|
||||||
height: 48px;
|
|
||||||
padding: 12px;
|
|
||||||
margin: 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#selectionBar {
|
|
||||||
position: absolute;
|
|
||||||
height: 2px;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: var(--paper-tabs-selection-bar-color, --paper-yellow-a100);
|
|
||||||
-webkit-transform-origin: left center;
|
|
||||||
transform-origin: left center;
|
|
||||||
-webkit-transform: scale(0);
|
|
||||||
transform: scale(0);
|
|
||||||
transition: -webkit-transform;
|
|
||||||
transition: transform;
|
|
||||||
|
|
||||||
@apply(--paper-tabs-selection-bar);
|
|
||||||
}
|
|
||||||
|
|
||||||
#selectionBar.align-bottom {
|
|
||||||
top: 0;
|
|
||||||
bottom: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#selectionBar.expand {
|
|
||||||
transition-duration: 0.15s;
|
|
||||||
transition-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#selectionBar.contract {
|
|
||||||
transition-duration: 0.18s;
|
|
||||||
transition-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
#tabsContent > ::content > *:not(#selectionBar) {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
|
|
||||||
<paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown" tabindex="-1"></paper-icon-button>
|
|
||||||
|
|
||||||
<div id="tabsContainer" class="flex" on-track="_scroll" on-down="_down">
|
|
||||||
|
|
||||||
<div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]">
|
|
||||||
|
|
||||||
<content select="*"></content>
|
|
||||||
|
|
||||||
<div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]"
|
|
||||||
on-transitionend="_onBarTransitionEnd"></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown" tabindex="-1"></paper-icon-button>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
</dom-module>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'paper-tabs',
|
|
||||||
|
|
||||||
behaviors: [
|
|
||||||
Polymer.IronResizableBehavior,
|
|
||||||
Polymer.IronMenubarBehavior
|
|
||||||
],
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, ink ripple effect is disabled. When this property is changed,
|
|
||||||
* all descendant `<paper-tab>` elements have their `noink` property
|
|
||||||
* changed to the new value as well.
|
|
||||||
*/
|
|
||||||
noink: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false,
|
|
||||||
observer: '_noinkChanged'
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, the bottom bar to indicate the selected tab will not be shown.
|
|
||||||
*/
|
|
||||||
noBar: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, the slide effect for the bottom bar is disabled.
|
|
||||||
*/
|
|
||||||
noSlide: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, tabs are scrollable and the tab width is based on the label width.
|
|
||||||
*/
|
|
||||||
scrollable: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, dragging on the tabs to scroll is disabled.
|
|
||||||
*/
|
|
||||||
disableDrag: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, scroll buttons (left/right arrow) will be hidden for scrollable tabs.
|
|
||||||
*/
|
|
||||||
hideScrollButtons: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If true, the tabs are aligned to bottom (the selection bar appears at the top).
|
|
||||||
*/
|
|
||||||
alignBottom: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets or sets the selected element. The default is to use the index of the item.
|
|
||||||
*/
|
|
||||||
selected: {
|
|
||||||
type: String,
|
|
||||||
notify: true
|
|
||||||
},
|
|
||||||
|
|
||||||
selectable: {
|
|
||||||
type: String,
|
|
||||||
value: 'paper-tab'
|
|
||||||
},
|
|
||||||
|
|
||||||
_step: {
|
|
||||||
type: Number,
|
|
||||||
value: 10
|
|
||||||
},
|
|
||||||
|
|
||||||
_holdDelay: {
|
|
||||||
type: Number,
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
|
|
||||||
_leftHidden: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
_rightHidden: {
|
|
||||||
type: Boolean,
|
|
||||||
value: false
|
|
||||||
},
|
|
||||||
|
|
||||||
_previousTab: {
|
|
||||||
type: Object
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
hostAttributes: {
|
|
||||||
role: 'tablist'
|
|
||||||
},
|
|
||||||
|
|
||||||
listeners: {
|
|
||||||
'iron-resize': '_onResize',
|
|
||||||
'iron-select': '_onIronSelect',
|
|
||||||
'iron-deselect': '_onIronDeselect'
|
|
||||||
},
|
|
||||||
|
|
||||||
created: function() {
|
|
||||||
this._holdJob = null;
|
|
||||||
},
|
|
||||||
|
|
||||||
ready: function() {
|
|
||||||
this.setScrollDirection('y', this.$.tabsContainer);
|
|
||||||
},
|
|
||||||
|
|
||||||
_noinkChanged: function(noink) {
|
|
||||||
var childTabs = Polymer.dom(this).querySelectorAll('paper-tab');
|
|
||||||
childTabs.forEach(noink ? this._setNoinkAttribute : this._removeNoinkAttribute);
|
|
||||||
},
|
|
||||||
|
|
||||||
_setNoinkAttribute: function(element) {
|
|
||||||
element.setAttribute('noink', '');
|
|
||||||
},
|
|
||||||
|
|
||||||
_removeNoinkAttribute: function(element) {
|
|
||||||
element.removeAttribute('noink');
|
|
||||||
},
|
|
||||||
|
|
||||||
_computeScrollButtonClass: function(hideThisButton, scrollable, hideScrollButtons) {
|
|
||||||
if (!scrollable || hideScrollButtons) {
|
|
||||||
return 'hidden';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hideThisButton) {
|
|
||||||
return 'not-visible';
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
|
|
||||||
_computeTabsContentClass: function(scrollable) {
|
|
||||||
return scrollable ? 'scrollable' : 'horizontal layout';
|
|
||||||
},
|
|
||||||
|
|
||||||
_computeSelectionBarClass: function(noBar, alignBottom) {
|
|
||||||
if (noBar) {
|
|
||||||
return 'hidden';
|
|
||||||
} else if (alignBottom) {
|
|
||||||
return 'align-bottom';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// TODO(cdata): Add `track` response back in when gesture lands.
|
|
||||||
|
|
||||||
_onResize: function() {
|
|
||||||
this.debounce('_onResize', function() {
|
|
||||||
this._scroll();
|
|
||||||
this._tabChanged(this.selectedItem);
|
|
||||||
}, 10);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onIronSelect: function(event) {
|
|
||||||
this._tabChanged(event.detail.item, this._previousTab);
|
|
||||||
this._previousTab = event.detail.item;
|
|
||||||
this.cancelDebouncer('tab-changed');
|
|
||||||
},
|
|
||||||
|
|
||||||
_onIronDeselect: function(event) {
|
|
||||||
this.debounce('tab-changed', function() {
|
|
||||||
this._tabChanged(null, this._previousTab);
|
|
||||||
// See polymer/polymer#1305
|
|
||||||
}, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
get _tabContainerScrollSize () {
|
|
||||||
return Math.max(
|
|
||||||
0,
|
|
||||||
this.$.tabsContainer.scrollWidth -
|
|
||||||
this.$.tabsContainer.offsetWidth
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
_scroll: function(e, detail) {
|
|
||||||
if (!this.scrollable) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var ddx = (detail && -detail.ddx) || 0;
|
|
||||||
this._affectScroll(ddx);
|
|
||||||
},
|
|
||||||
|
|
||||||
_down: function(e) {
|
|
||||||
// go one beat async to defeat IronMenuBehavior
|
|
||||||
// autorefocus-on-no-selection timeout
|
|
||||||
this.async(function() {
|
|
||||||
if (this._defaultFocusAsync) {
|
|
||||||
this.cancelAsync(this._defaultFocusAsync);
|
|
||||||
this._defaultFocusAsync = null;
|
|
||||||
}
|
|
||||||
}, 1);
|
|
||||||
},
|
|
||||||
|
|
||||||
_affectScroll: function(dx) {
|
|
||||||
this.$.tabsContainer.scrollLeft += dx;
|
|
||||||
|
|
||||||
var scrollLeft = this.$.tabsContainer.scrollLeft;
|
|
||||||
|
|
||||||
this._leftHidden = scrollLeft === 0;
|
|
||||||
this._rightHidden = scrollLeft === this._tabContainerScrollSize;
|
|
||||||
},
|
|
||||||
|
|
||||||
_onLeftScrollButtonDown: function() {
|
|
||||||
this._scrollToLeft();
|
|
||||||
this._holdJob = setInterval(this._scrollToLeft.bind(this), this._holdDelay);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onRightScrollButtonDown: function() {
|
|
||||||
this._scrollToRight();
|
|
||||||
this._holdJob = setInterval(this._scrollToRight.bind(this), this._holdDelay);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onScrollButtonUp: function() {
|
|
||||||
clearInterval(this._holdJob);
|
|
||||||
this._holdJob = null;
|
|
||||||
},
|
|
||||||
|
|
||||||
_scrollToLeft: function() {
|
|
||||||
this._affectScroll(-this._step);
|
|
||||||
},
|
|
||||||
|
|
||||||
_scrollToRight: function() {
|
|
||||||
this._affectScroll(this._step);
|
|
||||||
},
|
|
||||||
|
|
||||||
_tabChanged: function(tab, old) {
|
|
||||||
if (!tab) {
|
|
||||||
this._positionBar(0, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var r = this.$.tabsContent.getBoundingClientRect();
|
|
||||||
var w = r.width;
|
|
||||||
var tabRect = tab.getBoundingClientRect();
|
|
||||||
var tabOffsetLeft = tabRect.left - r.left;
|
|
||||||
|
|
||||||
this._pos = {
|
|
||||||
width: this._calcPercent(tabRect.width, w),
|
|
||||||
left: this._calcPercent(tabOffsetLeft, w)
|
|
||||||
};
|
|
||||||
|
|
||||||
if (this.noSlide || old == null) {
|
|
||||||
// position bar directly without animation
|
|
||||||
this._positionBar(this._pos.width, this._pos.left);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var oldRect = old.getBoundingClientRect();
|
|
||||||
var oldIndex = this.items.indexOf(old);
|
|
||||||
var index = this.items.indexOf(tab);
|
|
||||||
var m = 5;
|
|
||||||
|
|
||||||
// bar animation: expand
|
|
||||||
this.$.selectionBar.classList.add('expand');
|
|
||||||
|
|
||||||
if (oldIndex < index) {
|
|
||||||
this._positionBar(this._calcPercent(tabRect.left + tabRect.width - oldRect.left, w) - m,
|
|
||||||
this._left);
|
|
||||||
} else {
|
|
||||||
this._positionBar(this._calcPercent(oldRect.left + oldRect.width - tabRect.left, w) - m,
|
|
||||||
this._calcPercent(tabOffsetLeft, w) + m);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.scrollable) {
|
|
||||||
this._scrollToSelectedIfNeeded(tabRect.width, tabOffsetLeft);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_scrollToSelectedIfNeeded: function(tabWidth, tabOffsetLeft) {
|
|
||||||
var l = tabOffsetLeft - this.$.tabsContainer.scrollLeft;
|
|
||||||
if (l < 0) {
|
|
||||||
this.$.tabsContainer.scrollLeft += l;
|
|
||||||
} else {
|
|
||||||
l += (tabWidth - this.$.tabsContainer.offsetWidth);
|
|
||||||
if (l > 0) {
|
|
||||||
this.$.tabsContainer.scrollLeft += l;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_calcPercent: function(w, w0) {
|
|
||||||
return 100 * w / w0;
|
|
||||||
},
|
|
||||||
|
|
||||||
_positionBar: function(width, left) {
|
|
||||||
width = width || 0;
|
|
||||||
left = left || 0;
|
|
||||||
|
|
||||||
this._width = width;
|
|
||||||
this._left = left;
|
|
||||||
this.transform(
|
|
||||||
'translate3d(' + left + '%, 0, 0) scaleX(' + (width / 100) + ')',
|
|
||||||
this.$.selectionBar);
|
|
||||||
},
|
|
||||||
|
|
||||||
_onBarTransitionEnd: function(e) {
|
|
||||||
var cl = this.$.selectionBar.classList;
|
|
||||||
// bar animation: expand -> contract
|
|
||||||
if (cl.contains('expand')) {
|
|
||||||
cl.remove('expand');
|
|
||||||
cl.add('contract');
|
|
||||||
this._positionBar(this._pos.width, this._pos.left);
|
|
||||||
// bar animation done
|
|
||||||
} else if (cl.contains('contract')) {
|
|
||||||
cl.remove('contract');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
|
@ -1,84 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>paper-tabs-attr-for-selected</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<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="../paper-tabs.html">
|
|
||||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="basic">
|
|
||||||
<template>
|
|
||||||
<paper-tabs attr-for-selected="name" selected="bar">
|
|
||||||
<paper-tab name="foo">ITEM FOO</paper-tab>
|
|
||||||
<paper-tab name="bar">ITEM BAR</paper-tab>
|
|
||||||
<paper-tab name="zot">ITEM ZOT</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
suite('set the selected attribute', function() {
|
|
||||||
|
|
||||||
var tabs;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected value', function() {
|
|
||||||
assert.equal(tabs.selected, 'bar');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has iron-selected class', function() {
|
|
||||||
Polymer.dom.flush();
|
|
||||||
assert.isTrue(tabs.querySelector('[name=bar]').classList.contains('iron-selected'));
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('select tab via click', function() {
|
|
||||||
|
|
||||||
var tabs, tab;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
tab = tabs.querySelector('[name=zot]');
|
|
||||||
tab.dispatchEvent(new CustomEvent('click', {bubbles: true}));
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected value', function() {
|
|
||||||
assert.equal(tabs.selected, 'zot');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has iron-selected class', function() {
|
|
||||||
Polymer.dom.flush();
|
|
||||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,214 +0,0 @@
|
||||||
<!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>
|
|
||||||
|
|
||||||
<title>paper-tabs-basic</title>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
|
||||||
|
|
||||||
<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="../paper-tabs.html">
|
|
||||||
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
|
|
||||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<test-fixture id="basic">
|
|
||||||
<template>
|
|
||||||
<paper-tabs>
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
<paper-tab>ITEM THREE</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<test-fixture id="HiddenTabs">
|
|
||||||
<template>
|
|
||||||
<paper-tabs hidden>
|
|
||||||
<paper-tab>ITEM ONE</paper-tab>
|
|
||||||
<paper-tab>ITEM TWO</paper-tab>
|
|
||||||
</paper-tabs>
|
|
||||||
</template>
|
|
||||||
</test-fixture>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
function checkSelectionBar(tabs, tab) {
|
|
||||||
var tabRect = tab.getBoundingClientRect();
|
|
||||||
var rect = Polymer.dom(tabs.root).querySelector('#selectionBar').getBoundingClientRect();
|
|
||||||
assert.equal(Math.round(tabRect.left), Math.round(rect.left));
|
|
||||||
}
|
|
||||||
|
|
||||||
suite('defaults', function() {
|
|
||||||
|
|
||||||
var tabs;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to nothing selected', function() {
|
|
||||||
assert.equal(tabs.selected, undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('no tabs have iron-selected class', function() {
|
|
||||||
Array.prototype.forEach.call(tabs.querySelectorAll('paper-tab'), function(tab) {
|
|
||||||
assert.isFalse(tab.classList.contains('iron-selected'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as noink', function() {
|
|
||||||
assert.equal(tabs.noink, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as noBar', function() {
|
|
||||||
assert.equal(tabs.noBar, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as noSlide', function() {
|
|
||||||
assert.equal(tabs.noSlide, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as scrollable', function() {
|
|
||||||
assert.equal(tabs.scrollable, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as disableDrag', function() {
|
|
||||||
assert.equal(tabs.disableDrag, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as hideScrollButtons', function() {
|
|
||||||
assert.equal(tabs.hideScrollButtons, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('to false as alignBottom', function() {
|
|
||||||
assert.equal(tabs.alignBottom, false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('has role tablist', function() {
|
|
||||||
assert.equal(tabs.getAttribute('role'), 'tablist');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('hidden tabs', function() {
|
|
||||||
var tabs;
|
|
||||||
|
|
||||||
setup(function() {
|
|
||||||
tabs = fixture('HiddenTabs');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('choose the correct bar position once made visible', function() {
|
|
||||||
tabs.removeAttribute('hidden');
|
|
||||||
tabs.selected = 0;
|
|
||||||
expect(tabs._width).to.be.greaterThan(0);
|
|
||||||
expect(tabs._left).to.be.equal(0);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('set the selected attribute', function() {
|
|
||||||
|
|
||||||
var tabs, index = 0;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
tabs.selected = index;
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected value', function() {
|
|
||||||
assert.equal(tabs.selected, index);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has iron-selected class', function() {
|
|
||||||
var tab = tabs.querySelectorAll('paper-tab')[index];
|
|
||||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has selection bar position at the bottom of the tab', function(done) {
|
|
||||||
setTimeout(function() {
|
|
||||||
checkSelectionBar(tabs, tabs.querySelectorAll('paper-tab')[index]);
|
|
||||||
done();
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('select tab via click', function() {
|
|
||||||
|
|
||||||
var tabs, index = 1;
|
|
||||||
var tab;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
tab = tabs.querySelectorAll('paper-tab')[index];
|
|
||||||
tab.dispatchEvent(new CustomEvent('click', {bubbles: true}));
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected value', function() {
|
|
||||||
assert.equal(tabs.selected, index);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has iron-selected class', function() {
|
|
||||||
var tab = tabs.querySelectorAll('paper-tab')[index];
|
|
||||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
|
||||||
});
|
|
||||||
|
|
||||||
test('selected tab has selection bar position at the bottom of the tab', function(done) {
|
|
||||||
setTimeout(function() {
|
|
||||||
checkSelectionBar(tabs, tabs.querySelectorAll('paper-tab')[index]);
|
|
||||||
done();
|
|
||||||
}, 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('pressing enter on tab causes a click', function(done) {
|
|
||||||
var clickCount = 0;
|
|
||||||
tab.addEventListener('click', function onTabClick() {
|
|
||||||
clickCount++;
|
|
||||||
tab.removeEventListener('click', onTabClick);
|
|
||||||
|
|
||||||
expect(clickCount).to.be.equal(1);
|
|
||||||
done();
|
|
||||||
});
|
|
||||||
|
|
||||||
MockInteractions.pressEnter(tab);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
suite('noink attribute', function() {
|
|
||||||
var tabs;
|
|
||||||
|
|
||||||
setup(function () {
|
|
||||||
tabs = fixture('basic');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('noink attribute propagates to all descendant tabs', function() {
|
|
||||||
tabs.noink = true;
|
|
||||||
Array.prototype.slice.apply(tabs.querySelectorAll('paper-tab')).forEach(function(tab) {
|
|
||||||
assert.isTrue(tab.noink);
|
|
||||||
});
|
|
||||||
|
|
||||||
tabs.noink = false;
|
|
||||||
Array.prototype.slice.apply(tabs.querySelectorAll('paper-tab')).forEach(function(tab) {
|
|
||||||
assert.isFalse(tab.noink);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,32 +0,0 @@
|
||||||
<!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>Tests</title>
|
|
||||||
<script src="../../web-component-tester/browser.js"></script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
WCT.loadSuites([
|
|
||||||
'basic.html',
|
|
||||||
'attr-for-selected.html'
|
|
||||||
]);
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,45 +0,0 @@
|
||||||
{
|
|
||||||
"name": "prism-element",
|
|
||||||
"description": "Prism.js import and syntax highlighting",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"prism",
|
|
||||||
"molecule"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/prism-element.git"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/prism-highlighter",
|
|
||||||
"main": "prism-highlighter.html",
|
|
||||||
"ignore": [
|
|
||||||
"/.*",
|
|
||||||
"/test/",
|
|
||||||
"/demo/"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"prism": "*",
|
|
||||||
"polymer": "Polymer/polymer#^1.5.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0"
|
|
||||||
},
|
|
||||||
"_release": "1.1.0",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "v1.1.0",
|
|
||||||
"commit": "4c9366c79db87cb5eee3263452875b951b9741ed"
|
|
||||||
},
|
|
||||||
"_source": "git://github.com/PolymerElements/prism-element.git",
|
|
||||||
"_target": "^1.0.0",
|
|
||||||
"_originalSource": "PolymerElements/prism-element"
|
|
||||||
}
|
|
|
@ -1,77 +0,0 @@
|
||||||
<!--
|
|
||||||
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 :)
|
|
||||||
|
|
||||||
You can however override the jsbin link with one that's customized to this
|
|
||||||
specific element:
|
|
||||||
|
|
||||||
jsbin=https://jsbin.com/cagaye/edit?html,output
|
|
||||||
-->
|
|
||||||
|
|
||||||
# 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: [https://jsbin.com/cagaye/edit?html,output](https://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 in the pull request description using the following syntax:
|
|
||||||
|
|
||||||
```markdown
|
|
||||||
(For a single issue)
|
|
||||||
Fixes #20
|
|
||||||
|
|
||||||
(For multiple issues)
|
|
||||||
Fixes #32, fixes #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!
|
|
|
@ -1,36 +0,0 @@
|
||||||
{
|
|
||||||
"name": "prism-element",
|
|
||||||
"description": "Prism.js import and syntax highlighting",
|
|
||||||
"version": "1.1.0",
|
|
||||||
"authors": [
|
|
||||||
"The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"web-components",
|
|
||||||
"polymer",
|
|
||||||
"prism",
|
|
||||||
"molecule"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git://github.com/PolymerElements/prism-element.git"
|
|
||||||
},
|
|
||||||
"license": "http://polymer.github.io/LICENSE.txt",
|
|
||||||
"homepage": "https://github.com/PolymerElements/prism-highlighter",
|
|
||||||
"main": "prism-highlighter.html",
|
|
||||||
"ignore": [
|
|
||||||
"/.*",
|
|
||||||
"/test/",
|
|
||||||
"/demo/"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"prism": "*",
|
|
||||||
"polymer": "Polymer/polymer#^1.5.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
|
||||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
|
||||||
"paper-styles": "PolymerElements/paper-styles#^1.0.0",
|
|
||||||
"web-component-tester": "^4.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
<!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">
|
|
||||||
|
|
||||||
<title>prism-element</title>
|
|
||||||
|
|
||||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
|
||||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<iron-component-page src="prism-highlighter.html"></iron-component-page>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,103 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="prism-import.html">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Syntax highlighting via [Prism](http://prismjs.com/).
|
|
||||||
|
|
||||||
Place a `<prism-highlighter>` in your document, preferably as a direct child of
|
|
||||||
`<body>`. It will listen for `syntax-highlight` events on its parent element,
|
|
||||||
and annotate the code being provided via that event.
|
|
||||||
|
|
||||||
The `syntax-highlight` event's detail is expected to have a `code` property
|
|
||||||
containing the source to highlight. The event detail can optionally contain a
|
|
||||||
`lang` property, containing a string like `"html"`, `"js"`, etc.
|
|
||||||
|
|
||||||
This flow is supported by [`<marked-element>`](https://github.com/PolymerElements/marked-element).
|
|
||||||
|
|
||||||
@element prism-highlighter
|
|
||||||
@demo demo/index.html
|
|
||||||
-->
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var HIGHLIGHT_EVENT = 'syntax-highlight';
|
|
||||||
|
|
||||||
Polymer({
|
|
||||||
|
|
||||||
is: 'prism-highlighter',
|
|
||||||
|
|
||||||
ready: function() {
|
|
||||||
this._handler = this._highlight.bind(this);
|
|
||||||
},
|
|
||||||
|
|
||||||
attached: function() {
|
|
||||||
(this.parentElement || this.parentNode.host).addEventListener(HIGHLIGHT_EVENT, this._handler);
|
|
||||||
},
|
|
||||||
|
|
||||||
detached: function() {
|
|
||||||
(this.parentElement || this.parentNode.host).removeEventListener(HIGHLIGHT_EVENT, this._handler);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle the highlighting event, if we can.
|
|
||||||
*
|
|
||||||
* @param {!CustomEvent} event
|
|
||||||
*/
|
|
||||||
_highlight: function(event) {
|
|
||||||
if (!event.detail || !event.detail.code) {
|
|
||||||
Polymer.Base._warn('Malformed', HIGHLIGHT_EVENT, 'event:', event.detail);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.stopPropagation();
|
|
||||||
|
|
||||||
var detail = event.detail;
|
|
||||||
detail.code = Prism.highlight(detail.code, this._detectLang(detail.code, detail.lang));
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Picks a Prism formatter based on the `lang` hint and `code`.
|
|
||||||
*
|
|
||||||
* @param {string} code The source being highlighted.
|
|
||||||
* @param {string=} lang A language hint (e.g. ````LANG`).
|
|
||||||
* @return {!prism.Lang}
|
|
||||||
*/
|
|
||||||
_detectLang: function(code, lang) {
|
|
||||||
if (!lang) {
|
|
||||||
// Stupid simple detection if we have no lang, courtesy of:
|
|
||||||
// https://github.com/robdodson/mark-down/blob/ac2eaa/mark-down.html#L93-101
|
|
||||||
return code.match(/^\s*</) ? Prism.languages.markup : Prism.languages.javascript;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Prism.languages[lang]) {
|
|
||||||
return Prism.languages[lang];
|
|
||||||
}
|
|
||||||
switch (lang.substr(0, 2)) {
|
|
||||||
case 'js':
|
|
||||||
case 'es':
|
|
||||||
return Prism.languages.javascript;
|
|
||||||
case 'c':
|
|
||||||
return Prism.languages.clike;
|
|
||||||
default:
|
|
||||||
// The assumption is that you're mostly documenting HTML when in HTML.
|
|
||||||
return Prism.languages.markup;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
})();
|
|
||||||
</script>
|
|
|
@ -1,11 +0,0 @@
|
||||||
<!--
|
|
||||||
@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="../prism/prism.js" data-manual></script>
|
|
||||||
<link rel="stylesheet" href="../prism/themes/prism.css">
|
|
|
@ -1,151 +0,0 @@
|
||||||
<!--
|
|
||||||
@license
|
|
||||||
Copyright (c) 2016 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
|
|
||||||
-->
|
|
||||||
<dom-module id="prism-theme-default">
|
|
||||||
<template>
|
|
||||||
<style>
|
|
||||||
/**
|
|
||||||
* prism.js default theme for JavaScript, CSS and HTML
|
|
||||||
* Based on dabblet (http://dabblet.com)
|
|
||||||
* @author Lea Verou
|
|
||||||
*/
|
|
||||||
code[class*="language-"],
|
|
||||||
pre[class*="language-"] {
|
|
||||||
color: black;
|
|
||||||
background: none;
|
|
||||||
text-shadow: 0 1px white;
|
|
||||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
||||||
text-align: left;
|
|
||||||
white-space: pre;
|
|
||||||
word-spacing: normal;
|
|
||||||
word-break: normal;
|
|
||||||
word-wrap: normal;
|
|
||||||
line-height: 1.5;
|
|
||||||
|
|
||||||
-moz-tab-size: 4;
|
|
||||||
-o-tab-size: 4;
|
|
||||||
tab-size: 4;
|
|
||||||
|
|
||||||
-webkit-hyphens: none;
|
|
||||||
-moz-hyphens: none;
|
|
||||||
-ms-hyphens: none;
|
|
||||||
hyphens: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
|
||||||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
|
||||||
text-shadow: none;
|
|
||||||
background: #b3d4fc;
|
|
||||||
}
|
|
||||||
|
|
||||||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
|
||||||
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
|
||||||
text-shadow: none;
|
|
||||||
background: #b3d4fc;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
|
||||||
code[class*="language-"],
|
|
||||||
pre[class*="language-"] {
|
|
||||||
text-shadow: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Code blocks */
|
|
||||||
pre[class*="language-"] {
|
|
||||||
padding: 1em;
|
|
||||||
margin: .5em 0;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
:not(pre) > code[class*="language-"],
|
|
||||||
pre[class*="language-"] {
|
|
||||||
background: #f5f2f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inline code */
|
|
||||||
:not(pre) > code[class*="language-"] {
|
|
||||||
padding: .1em;
|
|
||||||
border-radius: .3em;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.comment,
|
|
||||||
.token.prolog,
|
|
||||||
.token.doctype,
|
|
||||||
.token.cdata {
|
|
||||||
color: slategray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.punctuation {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.namespace {
|
|
||||||
opacity: .7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.property,
|
|
||||||
.token.tag,
|
|
||||||
.token.boolean,
|
|
||||||
.token.number,
|
|
||||||
.token.constant,
|
|
||||||
.token.symbol,
|
|
||||||
.token.deleted {
|
|
||||||
color: #905;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.selector,
|
|
||||||
.token.attr-name,
|
|
||||||
.token.string,
|
|
||||||
.token.char,
|
|
||||||
.token.builtin,
|
|
||||||
.token.inserted {
|
|
||||||
color: #690;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.operator,
|
|
||||||
.token.entity,
|
|
||||||
.token.url,
|
|
||||||
.language-css .token.string,
|
|
||||||
.style .token.string {
|
|
||||||
color: #a67f59;
|
|
||||||
background: hsla(0, 0%, 100%, .5);
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.atrule,
|
|
||||||
.token.attr-value,
|
|
||||||
.token.keyword {
|
|
||||||
color: #07a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.function {
|
|
||||||
color: #DD4A68;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.regex,
|
|
||||||
.token.important,
|
|
||||||
.token.variable {
|
|
||||||
color: #e90;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.important,
|
|
||||||
.token.bold {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.token.italic {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
.token.entity {
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
40
dashboard-ui/bower_components/prism/.bower.json
vendored
40
dashboard-ui/bower_components/prism/.bower.json
vendored
|
@ -1,40 +0,0 @@
|
||||||
{
|
|
||||||
"name": "prism",
|
|
||||||
"main": [
|
|
||||||
"prism.js",
|
|
||||||
"themes/prism.css"
|
|
||||||
],
|
|
||||||
"homepage": "http://prismjs.com",
|
|
||||||
"authors": "Lea Verou",
|
|
||||||
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
|
|
||||||
"license": "MIT",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/PrismJS/prism.git"
|
|
||||||
},
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"img",
|
|
||||||
"templates",
|
|
||||||
"tests",
|
|
||||||
"CNAME",
|
|
||||||
"*.html",
|
|
||||||
"style.css",
|
|
||||||
"favicon.png",
|
|
||||||
"logo.svg",
|
|
||||||
"download.js",
|
|
||||||
"prefixfree.min.js",
|
|
||||||
"utopia.js",
|
|
||||||
"code.js"
|
|
||||||
],
|
|
||||||
"version": "1.5.1",
|
|
||||||
"_release": "1.5.1",
|
|
||||||
"_resolution": {
|
|
||||||
"type": "version",
|
|
||||||
"tag": "1.5.1",
|
|
||||||
"commit": "4a44f01606dbc88ac49accce9cd0cd7cb2fe213d"
|
|
||||||
},
|
|
||||||
"_source": "https://github.com/LeaVerou/prism.git",
|
|
||||||
"_target": "*",
|
|
||||||
"_originalSource": "prism"
|
|
||||||
}
|
|
583
dashboard-ui/bower_components/prism/CHANGELOG.md
vendored
583
dashboard-ui/bower_components/prism/CHANGELOG.md
vendored
|
@ -1,583 +0,0 @@
|
||||||
# Prism Changelog
|
|
||||||
|
|
||||||
## 1.5.1 (2016-06-05)
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __Normalize Whitespace__:
|
|
||||||
* FAdd class that disables the normalize whitespace plugin [[`9385c54`](https://github.com/PrismJS/prism/commit/9385c54)]
|
|
||||||
* __JavaScript Language__:
|
|
||||||
* Rearrange the `string` and `template-string` token in JavaScript [[`1158e46`](https://github.com/PrismJS/prism/commit/1158e46)]
|
|
||||||
* __SQL Language__:
|
|
||||||
* add delimeter and delimeters keywords to sql ([#958](https://github.com/PrismJS/prism/pull/958)) [[`a9ef24e`](https://github.com/PrismJS/prism/commit/a9ef24e)]
|
|
||||||
* add AUTO_INCREMENT and DATE keywords to sql ([#954](https://github.com/PrismJS/prism/pull/954)) [[`caea2af`](https://github.com/PrismJS/prism/commit/caea2af)]
|
|
||||||
* __Diff Language__:
|
|
||||||
* Highlight diff lines with only + or - ([#952](https://github.com/PrismJS/prism/pull/952)) [[`4d0526f`](https://github.com/PrismJS/prism/commit/4d0526f)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Allow for asynchronous loading of prism.js ([#959](https://github.com/PrismJS/prism/pull/959))
|
|
||||||
* Use toLowerCase on language names ([#957](https://github.com/PrismJS/prism/pull/957)) [[`acd9508`](https://github.com/PrismJS/prism/commit/acd9508)]
|
|
||||||
* link to index for basic usage - fixes #945 ([#946](https://github.com/PrismJS/prism/pull/946)) [[`6c772d8`](https://github.com/PrismJS/prism/commit/6c772d8)]
|
|
||||||
* Fixed monospace typo ([#953](https://github.com/PrismJS/prism/pull/953)) [[`e6c3498`](https://github.com/PrismJS/prism/commit/e6c3498)]
|
|
||||||
|
|
||||||
## 1.5.0 (2016-05-01)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __Bro Language__ ([#925](https://github.com/PrismJS/prism/pull/925))
|
|
||||||
* __Protocol Buffers Language__ ([#938](https://github.com/PrismJS/prism/pull/938)) [[`ae4a4f2`](https://github.com/PrismJS/prism/commit/ae4a4f2)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __Keep Markup__:
|
|
||||||
* Fix Keep Markup plugin incorrect highlighting ([#880](https://github.com/PrismJS/prism/pull/880)) [[`24841ef`](https://github.com/PrismJS/prism/commit/24841ef)]
|
|
||||||
* __Groovy Language__:
|
|
||||||
* Fix double HTML-encoding bug in Groovy language [[`24a0936`](https://github.com/PrismJS/prism/commit/24a0936)]
|
|
||||||
* __Java Language__:
|
|
||||||
* Adding annotation token for Java ([#905](https://github.com/PrismJS/prism/pull/905)) [[`367ace6`](https://github.com/PrismJS/prism/commit/367ace6)]
|
|
||||||
* __SAS Language__:
|
|
||||||
* Add missing keywords for SAS ([#922](https://github.com/PrismJS/prism/pull/922))
|
|
||||||
* __YAML Language__:
|
|
||||||
* fix hilighting of YAML keys on first line of code block ([#943](https://github.com/PrismJS/prism/pull/943)) [[`f19db81`](https://github.com/PrismJS/prism/commit/f19db81)]
|
|
||||||
* __C# Language__:
|
|
||||||
* Support for generic methods in csharp [[`6f75735`](https://github.com/PrismJS/prism/commit/6f75735)]
|
|
||||||
|
|
||||||
### New plugins
|
|
||||||
|
|
||||||
* __Unescaped Markup__ [[`07d77e5`](https://github.com/PrismJS/prism/commit/07d77e5)]
|
|
||||||
* __Normalize Whitespace__ ([#847](https://github.com/PrismJS/prism/pull/847)) [[`e86ec01`](https://github.com/PrismJS/prism/commit/e86ec01)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Add JSPM support [[`ad048ab`](https://github.com/PrismJS/prism/commit/ad048ab)]
|
|
||||||
* update linear-gradient syntax from `left` to `to right` [[`cd234dc`](https://github.com/PrismJS/prism/commit/cd234dc)]
|
|
||||||
* Add after-property to allow ordering of plugins [[`224b7a1`](https://github.com/PrismJS/prism/commit/224b7a1)]
|
|
||||||
* Partial solution for the "Comment-like substrings"-problem [[`2705c50`](https://github.com/PrismJS/prism/commit/2705c50)]
|
|
||||||
* Add property 'aliasTitles' to components.js [[`54400fb`](https://github.com/PrismJS/prism/commit/54400fb)]
|
|
||||||
* Add before-highlightall hook [[`70a8602`](https://github.com/PrismJS/prism/commit/70a8602)]
|
|
||||||
* Fix catastrophic backtracking regex issues in JavaScript [[`ab65be2`](https://github.com/PrismJS/prism/commit/ab65be2)]
|
|
||||||
|
|
||||||
## 1.4.1 (2016-02-03)
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Fix DFS bug in Prism core [[`b86c727`](https://github.com/PrismJS/prism/commit/b86c727)]
|
|
||||||
|
|
||||||
## 1.4.0 (2016-02-03)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __Solarized Light__ ([#855](https://github.com/PrismJS/prism/pull/855)) [[`70846ba`](https://github.com/PrismJS/prism/commit/70846ba)]
|
|
||||||
* __JSON__ ([#370](https://github.com/PrismJS/prism/pull/370)) [[`ad2fcd0`](https://github.com/PrismJS/prism/commit/ad2fcd0)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __Show Language__:
|
|
||||||
* Remove data-language attribute ([#840](https://github.com/PrismJS/prism/pull/840)) [[`eb9a83c`](https://github.com/PrismJS/prism/commit/eb9a83c)]
|
|
||||||
* Allow custom label without a language mapping ([#837](https://github.com/PrismJS/prism/pull/837)) [[`7e74aef`](https://github.com/PrismJS/prism/commit/7e74aef)]
|
|
||||||
* __JSX__:
|
|
||||||
* Better Nesting in JSX attributes ([#842](https://github.com/PrismJS/prism/pull/842)) [[`971dda7`](https://github.com/PrismJS/prism/commit/971dda7)]
|
|
||||||
* __File Highlight__:
|
|
||||||
* Defer File Highlight until the full DOM has loaded. ([#844](https://github.com/PrismJS/prism/pull/844)) [[`6f995ef`](https://github.com/PrismJS/prism/commit/6f995ef)]
|
|
||||||
* __Coy Theme__:
|
|
||||||
* Fix coy theme shadows ([#865](https://github.com/PrismJS/prism/pull/865)) [[`58d2337`](https://github.com/PrismJS/prism/commit/58d2337)]
|
|
||||||
* __Show Invisibles__:
|
|
||||||
* Ensure show-invisibles compat with autoloader ([#874](https://github.com/PrismJS/prism/pull/874)) [[`c3cfb1f`](https://github.com/PrismJS/prism/commit/c3cfb1f)]
|
|
||||||
* Add support for the space character for the show-invisibles plugin ([#876](https://github.com/PrismJS/prism/pull/876)) [[`05442d3`](https://github.com/PrismJS/prism/commit/05442d3)]
|
|
||||||
|
|
||||||
### New plugins
|
|
||||||
|
|
||||||
* __Command Line__ ([#831](https://github.com/PrismJS/prism/pull/831)) [[`8378906`](https://github.com/PrismJS/prism/commit/8378906)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Use document.currentScript instead of document.getElementsByTagName() [[`fa98743`](https://github.com/PrismJS/prism/commit/fa98743)]
|
|
||||||
* Add prefix for Firefox selection and move prefixed rule first [[`6d54717`](https://github.com/PrismJS/prism/commit/6d54717)]
|
|
||||||
* No background for `<code>` in `<pre>` [[`8c310bc`](https://github.com/PrismJS/prism/commit/8c310bc)]
|
|
||||||
* Fixing to initial copyright year [[`69cbf7a`](https://github.com/PrismJS/prism/commit/69cbf7a)]
|
|
||||||
* Simplify the “lang” regex [[`417f54a`](https://github.com/PrismJS/prism/commit/417f54a)]
|
|
||||||
* Fix broken heading links [[`a7f9e62`](https://github.com/PrismJS/prism/commit/a7f9e62)]
|
|
||||||
* Prevent infinite recursion in DFS [[`02894e1`](https://github.com/PrismJS/prism/commit/02894e1)]
|
|
||||||
* Fix incorrect page title [[`544b56f`](https://github.com/PrismJS/prism/commit/544b56f)]
|
|
||||||
* Link scss to webplatform wiki [[`08d979a`](https://github.com/PrismJS/prism/commit/08d979a)]
|
|
||||||
* Revert white-space to normal when code is inline instead of in a pre [[`1a971b5`](https://github.com/PrismJS/prism/commit/1a971b5)]
|
|
||||||
|
|
||||||
## 1.3.0 (2015-10-26)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __AsciiDoc__ ([#800](https://github.com/PrismJS/prism/issues/800)) [[`6803ca0`](https://github.com/PrismJS/prism/commit/6803ca0)]
|
|
||||||
* __Haxe__ ([#811](https://github.com/PrismJS/prism/issues/811)) [[`bd44341`](https://github.com/PrismJS/prism/commit/bd44341)]
|
|
||||||
* __Icon__ ([#803](https://github.com/PrismJS/prism/issues/803)) [[`b43c5f3`](https://github.com/PrismJS/prism/commit/b43c5f3)]
|
|
||||||
* __Kotlin ([#814](https://github.com/PrismJS/prism/issues/814)) [[`e8a31a5`](https://github.com/PrismJS/prism/commit/e8a31a5)]
|
|
||||||
* __Lua__ ([#804](https://github.com/PrismJS/prism/issues/804)) [[`a36bc4a`](https://github.com/PrismJS/prism/commit/a36bc4a)]
|
|
||||||
* __Nix__ ([#795](https://github.com/PrismJS/prism/issues/795)) [[`9b275c8`](https://github.com/PrismJS/prism/commit/9b275c8)]
|
|
||||||
* __Oz__ ([#805](https://github.com/PrismJS/prism/issues/805)) [[`388c53f`](https://github.com/PrismJS/prism/commit/388c53f)]
|
|
||||||
* __PARI/GP__ ([#802](https://github.com/PrismJS/prism/issues/802)) [[`253c035`](https://github.com/PrismJS/prism/commit/253c035)]
|
|
||||||
* __Parser__ ([#808](https://github.com/PrismJS/prism/issues/808)) [[`a953b3a`](https://github.com/PrismJS/prism/commit/a953b3a)]
|
|
||||||
* __Puppet__ ([#813](https://github.com/PrismJS/prism/issues/813)) [[`81933ee`](https://github.com/PrismJS/prism/commit/81933ee)]
|
|
||||||
* __Roboconf__ ([#812](https://github.com/PrismJS/prism/issues/812)) [[`f5db346`](https://github.com/PrismJS/prism/commit/f5db346)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __C__:
|
|
||||||
* Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
|
|
||||||
* __C#__:
|
|
||||||
* Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
|
|
||||||
* Fix detection of float numbers ([#806](https://github.com/PrismJS/prism/issues/806)) [[`1dae72b`](https://github.com/PrismJS/prism/commit/1dae72b)]
|
|
||||||
* __F#__:
|
|
||||||
* Highlight directives in preprocessor lines ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
|
|
||||||
* __JavaScript__:
|
|
||||||
* Highlight true and false as booleans ([#801](https://github.com/PrismJS/prism/issues/801)) [[`ad316a3`](https://github.com/PrismJS/prism/commit/ad316a3)]
|
|
||||||
* __Python__:
|
|
||||||
* Highlight triple-quoted strings before comments. Fix [#815](https://github.com/PrismJS/prism/issues/815) [[`90fbf0b`](https://github.com/PrismJS/prism/commit/90fbf0b)]
|
|
||||||
|
|
||||||
### New plugins
|
|
||||||
|
|
||||||
* __Previewer: Time__ ([#790](https://github.com/PrismJS/prism/issues/790)) [[`88173de`](https://github.com/PrismJS/prism/commit/88173de)]
|
|
||||||
* __Previewer: Angle__ ([#791](https://github.com/PrismJS/prism/issues/791)) [[`a434c86`](https://github.com/PrismJS/prism/commit/a434c86)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Increase mocha's timeout [[`f1c41db`](https://github.com/PrismJS/prism/commit/f1c41db)]
|
|
||||||
* Prevent most errors in IE8. Fix [#9](https://github.com/PrismJS/prism/issues/9) [[`9652d75`](https://github.com/PrismJS/prism/commit/9652d75)]
|
|
||||||
* Add U.S. Web Design Standards on homepage. Fix [#785](https://github.com/PrismJS/prism/issues/785) [[`e10d48b`](https://github.com/PrismJS/prism/commit/e10d48b), [`79ebbf8`](https://github.com/PrismJS/prism/commit/79ebbf8), [`2f7088d`](https://github.com/PrismJS/prism/commit/2f7088d)]
|
|
||||||
* Added gulp task to autolink PRs and commits in changelog [[`5ec4e4d`](https://github.com/PrismJS/prism/commit/5ec4e4d)]
|
|
||||||
* Use child processes to run each set of tests, in order to deal with the memory leak in vm.runInNewContext() [[`9a4b6fa`](https://github.com/PrismJS/prism/commit/9a4b6fa)]
|
|
||||||
|
|
||||||
## 1.2.0 (2015-10-07)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __Batch__ ([#781](https://github.com/PrismJS/prism/issues/781)) [[`eab5b06`](https://github.com/PrismJS/prism/commit/eab5b06)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __ASP.NET__:
|
|
||||||
* Simplified pattern for `<script>` [[`29643f4`](https://github.com/PrismJS/prism/issues/29643f4)]
|
|
||||||
* __Bash__:
|
|
||||||
* Fix regression in strings ([#792](https://github.com/PrismJS/prism/issues/792)) [[`bd275c2`](https://github.com/PrismJS/prism/commit/bd275c2)]
|
|
||||||
* Substantially reduce wrongly highlighted stuff ([#793](https://github.com/PrismJS/prism/issues/793)) [[`ac6fe2e`](https://github.com/PrismJS/prism/commit/ac6fe2e)]
|
|
||||||
* __CSS__:
|
|
||||||
* Simplified pattern for `<style>` [[`29643f4`](https://github.com/PrismJS/prism/issues/29643f4)]
|
|
||||||
* __JavaScript__:
|
|
||||||
* Simplified pattern for `<script>` [[`29643f4`](https://github.com/PrismJS/prism/issues/29643f4)]
|
|
||||||
|
|
||||||
### New plugins
|
|
||||||
|
|
||||||
* __Previewer: Gradient__ ([#783](https://github.com/PrismJS/prism/issues/783)) [[`9a63483`](https://github.com/PrismJS/prism/commit/9a63483)]
|
|
||||||
|
|
||||||
### Updated plugins
|
|
||||||
|
|
||||||
* __Previewer: Color__
|
|
||||||
* Add support for Sass variables [[`3a1fb04`](https://github.com/PrismJS/prism/commit/3a1fb04)]
|
|
||||||
|
|
||||||
* __Previewer: Easing__
|
|
||||||
* Add support for Sass variables [[`7c7ab4e`](https://github.com/PrismJS/prism/commit/7c7ab4e)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Test runner: Allow to run tests for only some languages [[`5ade8a5`](https://github.com/PrismJS/prism/issues/5ade8a5)]
|
|
||||||
* Download page: Fixed wrong components order raising error in generated file ([#797](https://github.com/PrismJS/prism/issues/787)) [[`7a6aed8`](https://github.com/PrismJS/prism/commit/7a6aed8)]
|
|
||||||
|
|
||||||
## 1.1.0 (2015-10-04)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __ABAP__ ([#636](https://github.com/PrismJS/prism/issues/636)) [[`75b0328`](https://github.com/PrismJS/prism/commit/75b0328), [`0749129`](https://github.com/PrismJS/prism/commit/0749129)]
|
|
||||||
* __APL__ ([#308](https://github.com/PrismJS/prism/issues/308)) [[`1f45942`](https://github.com/PrismJS/prism/commit/1f45942), [`33a295f`](https://github.com/PrismJS/prism/commit/33a295f)]
|
|
||||||
* __AutoIt__ ([#771](https://github.com/PrismJS/prism/issues/771)) [[`211a41c`](https://github.com/PrismJS/prism/commit/211a41c)]
|
|
||||||
* __BASIC__ ([#620](https://github.com/PrismJS/prism/issues/620)) [[`805a0ce`](https://github.com/PrismJS/prism/commit/805a0ce)]
|
|
||||||
* __Bison__ ([#764](https://github.com/PrismJS/prism/issues/764)) [[`7feb135`](https://github.com/PrismJS/prism/commit/7feb135)]
|
|
||||||
* __Crystal__ ([#780](https://github.com/PrismJS/prism/issues/780)) [[`5b473de`](https://github.com/PrismJS/prism/commit/5b473de), [`414848d`](https://github.com/PrismJS/prism/commit/414848d)]
|
|
||||||
* __D__ ([#613](https://github.com/PrismJS/prism/issues/613)) [[`b5e741c`](https://github.com/PrismJS/prism/commit/b5e741c)]
|
|
||||||
* __Diff__ ([#450](https://github.com/PrismJS/prism/issues/450)) [[`ef41c74`](https://github.com/PrismJS/prism/commit/ef41c74)]
|
|
||||||
* __Docker__ ([#576](https://github.com/PrismJS/prism/issues/576)) [[`e808352`](https://github.com/PrismJS/prism/commit/e808352)]
|
|
||||||
* __Elixir__ ([#614](https://github.com/PrismJS/prism/issues/614)) [[`a1c028c`](https://github.com/PrismJS/prism/commit/a1c028c), [`c451611`](https://github.com/PrismJS/prism/commit/c451611), [`2e637f0`](https://github.com/PrismJS/prism/commit/2e637f0), [`ccb6566`](https://github.com/PrismJS/prism/commit/ccb6566)]
|
|
||||||
* __GLSL__ ([#615](https://github.com/PrismJS/prism/issues/615)) [[`247da05`](https://github.com/PrismJS/prism/commit/247da05)]
|
|
||||||
* __Inform 7__ ([#616](https://github.com/PrismJS/prism/issues/616)) [[`d2595b4`](https://github.com/PrismJS/prism/commit/d2595b4)]
|
|
||||||
* __J__ ([#623](https://github.com/PrismJS/prism/issues/623)) [[`0cc50b2`](https://github.com/PrismJS/prism/commit/0cc50b2)]
|
|
||||||
* __MEL__ ([#618](https://github.com/PrismJS/prism/issues/618)) [[`8496c14`](https://github.com/PrismJS/prism/commit/8496c14)]
|
|
||||||
* __Mizar__ ([#619](https://github.com/PrismJS/prism/issues/619)) [[`efde61d`](https://github.com/PrismJS/prism/commit/efde61d)]
|
|
||||||
* __Monkey__ ([#621](https://github.com/PrismJS/prism/issues/621)) [[`fdd4a3c`](https://github.com/PrismJS/prism/commit/fdd4a3c)]
|
|
||||||
* __nginx__ ([#776](https://github.com/PrismJS/prism/issues/776)) [[`dc4fc19`](https://github.com/PrismJS/prism/commit/dc4fc19), [`e62c88e`](https://github.com/PrismJS/prism/commit/e62c88e)]
|
|
||||||
* __Nim__ ([#622](https://github.com/PrismJS/prism/issues/622)) [[`af9c49a`](https://github.com/PrismJS/prism/commit/af9c49a)]
|
|
||||||
* __OCaml__ ([#628](https://github.com/PrismJS/prism/issues/628)) [[`556c04d`](https://github.com/PrismJS/prism/commit/556c04d)]
|
|
||||||
* __Processing__ ([#629](https://github.com/PrismJS/prism/issues/629)) [[`e47087b`](https://github.com/PrismJS/prism/commit/e47087b)]
|
|
||||||
* __Prolog__ ([#630](https://github.com/PrismJS/prism/issues/630)) [[`dd04c32`](https://github.com/PrismJS/prism/commit/dd04c32)]
|
|
||||||
* __Pure__ ([#626](https://github.com/PrismJS/prism/issues/626)) [[`9c276ab`](https://github.com/PrismJS/prism/commit/9c276ab)]
|
|
||||||
* __Q__ ([#624](https://github.com/PrismJS/prism/issues/624)) [[`c053c9e`](https://github.com/PrismJS/prism/commit/c053c9e)]
|
|
||||||
* __Qore__ [[`125e91f`](https://github.com/PrismJS/prism/commit/125e91f)]
|
|
||||||
* __Tcl__ [[`a3e751a`](https://github.com/PrismJS/prism/commit/a3e751a), [`11ff829`](https://github.com/PrismJS/prism/commit/11ff829)]
|
|
||||||
* __Textile__ ([#544](https://github.com/PrismJS/prism/issues/544)) [[`d0c6764`](https://github.com/PrismJS/prism/commit/d0c6764)]
|
|
||||||
* __Verilog__ ([#640](https://github.com/PrismJS/prism/issues/640)) [[`44a11c2`](https://github.com/PrismJS/prism/commit/44a11c2), [`795eb99`](https://github.com/PrismJS/prism/commit/795eb99)]
|
|
||||||
* __Vim__ [[`69ea994`](https://github.com/PrismJS/prism/commit/69ea994)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __Bash__:
|
|
||||||
* Add support for Here-Documents ([#787](https://github.com/PrismJS/prism/issues/787)) [[`b57a096`](https://github.com/PrismJS/prism/commit/b57a096)]
|
|
||||||
* Remove C-like dependency ([#789](https://github.com/PrismJS/prism/issues/789)) [[`1ab4619`](https://github.com/PrismJS/prism/commit/1ab4619)]
|
|
||||||
* __C__:
|
|
||||||
* Fixed numbers [[`4d64d07`](https://github.com/PrismJS/prism/commit/4d64d07), [`071c3dd`](https://github.com/PrismJS/prism/commit/071c3dd)]
|
|
||||||
* __C-like__:
|
|
||||||
* Add word boundary before class-name prefixes [[`aa757f6`](https://github.com/PrismJS/prism/commit/aa757f6)]
|
|
||||||
* Improved operator regex + add != and !== [[`135ee9d`](https://github.com/PrismJS/prism/commit/135ee9d)]
|
|
||||||
* Optimized string regexp [[`792e35c`](https://github.com/PrismJS/prism/commit/792e35c)]
|
|
||||||
* __F#__:
|
|
||||||
* Fixed keywords containing exclamation mark [[`09f2005`](https://github.com/PrismJS/prism/commit/09f2005)]
|
|
||||||
* Improved string pattern [[`0101c89`](https://github.com/PrismJS/prism/commit/0101c89)]
|
|
||||||
* Insert preprocessor before keyword + don't allow line feeds before # [[`fdc9477`](https://github.com/PrismJS/prism/commit/fdc9477)]
|
|
||||||
* Fixed numbers [[`0aa0791`](https://github.com/PrismJS/prism/commit/0aa0791)]
|
|
||||||
* __Gherkin__:
|
|
||||||
* Don't allow spaces in tags [[`48ff8b7`](https://github.com/PrismJS/prism/commit/48ff8b7)]
|
|
||||||
* Handle \r\n and \r + allow feature alone + don't match blank td/th [[`ce1ec3b`](https://github.com/PrismJS/prism/commit/ce1ec3b)]
|
|
||||||
* __Git__:
|
|
||||||
* Added more examples ([#652](https://github.com/PrismJS/prism/issues/652)) [[`95dc102`](https://github.com/PrismJS/prism/commit/95dc102)]
|
|
||||||
* Add support for unified diff. Fixes [#769](https://github.com/PrismJS/prism/issues/769), fixes [#357](https://github.com/PrismJS/prism/issues/357), closes [#401](https://github.com/PrismJS/prism/issues/401) [[`3aadd5d`](https://github.com/PrismJS/prism/commit/3aadd5d)]
|
|
||||||
* __Go__:
|
|
||||||
* Improved operator regexp + removed punctuation from it [[`776ab90`](https://github.com/PrismJS/prism/commit/776ab90)]
|
|
||||||
* __Haml__:
|
|
||||||
* Combine both multiline-comment regexps + handle \r\n and \r [[`f77b40b`](https://github.com/PrismJS/prism/commit/f77b40b)]
|
|
||||||
* Handle \r\n and \r in filter regex [[`bbe68ac`](https://github.com/PrismJS/prism/commit/bbe68ac)]
|
|
||||||
* __Handlebars__:
|
|
||||||
* Fix empty strings, add plus sign in exponential notation, improve block pattern and variable pattern [[`c477f9a`](https://github.com/PrismJS/prism/commit/c477f9a)]
|
|
||||||
* Properly escape special replacement patterns ($) in Handlebars, PHP and Smarty. Fix [#772](https://github.com/PrismJS/prism/issues/772) [[`895bf46`](https://github.com/PrismJS/prism/commit/895bf46)]
|
|
||||||
* __Haskell__:
|
|
||||||
* Removed useless backslashes and parentheses + handle \r\n and \r + simplify number regexp + fix operator regexp [[`1cc8d8e`](https://github.com/PrismJS/prism/commit/1cc8d8e)]
|
|
||||||
* __HTTP__:
|
|
||||||
* Fix indentation + Add multiline flag for more flexibility + Fix response status + Handle \r\n and \r [[`aaa90f1`](https://github.com/PrismJS/prism/commit/aaa90f1)]
|
|
||||||
* __Ini__:
|
|
||||||
* Fix some regexps + remove unused flags [[`53d5839`](https://github.com/PrismJS/prism/commit/53d5839)]
|
|
||||||
* __Jade__:
|
|
||||||
* Add todo list + remove single-line comment pattern + simplified most patterns with m flag + handle \r\n and \r [[`a79e838`](https://github.com/PrismJS/prism/commit/a79e838)]
|
|
||||||
* __Java__:
|
|
||||||
* Fix number regexp + simplified number regexp and optimized operator regexp [[`21e20b9`](https://github.com/PrismJS/prism/commit/21e20b9)]
|
|
||||||
* __JavaScript__:
|
|
||||||
* JavaScript: Allow for all non-ASCII characters in function names. Fix [#400](https://github.com/PrismJS/prism/issues/400) [[`29e26dc`](https://github.com/PrismJS/prism/commit/29e26dc)]
|
|
||||||
* __JSX__:
|
|
||||||
* Allow for one level of nesting in scripts (Fix [#717](https://github.com/PrismJS/prism/issues/717)) [[`90c75d5`](https://github.com/PrismJS/prism/commit/90c75d5)]
|
|
||||||
* __Julia__:
|
|
||||||
* Simplify comment regexp + improved number regexp + improved operator regexp [[`bcac7d4`](https://github.com/PrismJS/prism/commit/bcac7d4)]
|
|
||||||
* __Keyman__:
|
|
||||||
* Move header statements above keywords [[`23a444c`](https://github.com/PrismJS/prism/commit/23a444c)]
|
|
||||||
* __LaTeX__:
|
|
||||||
* Simplify comment regexp [[`132b41a`](https://github.com/PrismJS/prism/commit/132b41a)]
|
|
||||||
* Extend support [[`942a6ec`](https://github.com/PrismJS/prism/commit/942a6ec)]
|
|
||||||
* __Less__:
|
|
||||||
* Remove useless part in property regexp [[`80d8260`](https://github.com/PrismJS/prism/commit/80d8260)]
|
|
||||||
* __LOLCODE__:
|
|
||||||
* Removed useless parentheses [[`8147c9b`](https://github.com/PrismJS/prism/commit/8147c9b)]
|
|
||||||
* __Makefile__:
|
|
||||||
* Add known failures in example [[`e0f8984`](https://github.com/PrismJS/prism/commit/e0f8984)]
|
|
||||||
* Handle \r\n in comments and strings + fix "-include" keyword
|
|
||||||
* __Markup__:
|
|
||||||
* Simplify patterns + handle \r\n and \r [[`4c551e8`](https://github.com/PrismJS/prism/commit/4c551e8)]
|
|
||||||
* Don't allow = to appear in tag name [[`85d8a55`](https://github.com/PrismJS/prism/commit/85d8a55)]
|
|
||||||
* Don't allow dot inside tag name [[`283691e`](https://github.com/PrismJS/prism/commit/283691e)]
|
|
||||||
* __MATLAB__:
|
|
||||||
* Simplify string pattern to remove lookbehind [[`a3cbecc`](https://github.com/PrismJS/prism/commit/a3cbecc)]
|
|
||||||
* __NASM__:
|
|
||||||
* Converted indents to tabs, removed uneeded escapes, added lookbehinds [[`a92e4bd`](https://github.com/PrismJS/prism/commit/a92e4bd)]
|
|
||||||
* __NSIS__:
|
|
||||||
* Simplified patterns [[`bbd83d4`](https://github.com/PrismJS/prism/commit/bbd83d4)]
|
|
||||||
* Fix operator regexp [[`44ad8dc`](https://github.com/PrismJS/prism/commit/44ad8dc)]
|
|
||||||
* __Objective-C__:
|
|
||||||
* Simplified regexps + fix strings + handle \r [[`1d33147`](https://github.com/PrismJS/prism/commit/1d33147)]
|
|
||||||
* Fix operator regexp [[`e9d382e`](https://github.com/PrismJS/prism/commit/e9d382e)]
|
|
||||||
* __Pascal__:
|
|
||||||
* Simplified regexps [[`c03c8a4`](https://github.com/PrismJS/prism/commit/c03c8a4)]
|
|
||||||
* __Perl__:
|
|
||||||
* Simplified regexps + Made most string and regexp patterns multi-line + Added support for regexp's n flag + Added missing operators [[`71b00cc`](https://github.com/PrismJS/prism/commit/71b00cc)]
|
|
||||||
* __PHP__:
|
|
||||||
* Simplified patterns [[`f9d9452`](https://github.com/PrismJS/prism/commit/f9d9452)]
|
|
||||||
* Properly escape special replacement patterns ($) in Handlebars, PHP and Smarty. Fix [#772](https://github.com/PrismJS/prism/issues/772) [[`895bf46`](https://github.com/PrismJS/prism/commit/895bf46)]
|
|
||||||
* __PHP Extras__:
|
|
||||||
* Fix $this regexp + improve global regexp [[`781fdad`](https://github.com/PrismJS/prism/commit/781fdad)]
|
|
||||||
* __PowerShell__:
|
|
||||||
* Update definitions for command/alias/operators [[`14da55c`](https://github.com/PrismJS/prism/commit/14da55c)]
|
|
||||||
* __Python__:
|
|
||||||
* Added async/await and @ operator ([#656](https://github.com/PrismJS/prism/issues/656)) [[`7f1ae75`](https://github.com/PrismJS/prism/commit/7f1ae75)]
|
|
||||||
* Added 'self' keyword and support for class names ([#677](https://github.com/PrismJS/prism/issues/677)) [[`d9d4ab2`](https://github.com/PrismJS/prism/commit/d9d4ab2)]
|
|
||||||
* Simplified regexps + don't capture where unneeded + fixed operators [[`530f5f0`](https://github.com/PrismJS/prism/commit/530f5f0)]
|
|
||||||
* __R__:
|
|
||||||
* Fixed and simplified patterns [[`c20c3ec`](https://github.com/PrismJS/prism/commit/c20c3ec)]
|
|
||||||
* __reST__:
|
|
||||||
* Simplified some patterns, fixed others, prevented blank comments to match, moved list-bullet down to prevent breaking quotes [[`e6c6b85`](https://github.com/PrismJS/prism/commit/e6c6b85)]
|
|
||||||
* __Rip__:
|
|
||||||
* Fixed some regexp + moved down numbers [[`1093f7d`](https://github.com/PrismJS/prism/commit/1093f7d)]
|
|
||||||
* __Ruby__:
|
|
||||||
* Code cleaning, handle \r\n and \r, fix some regexps [[`dd4989f`](https://github.com/PrismJS/prism/commit/dd4989f)]
|
|
||||||
* Add % notations for strings and regexps. Fix [#590](https://github.com/PrismJS/prism/issues/590) [[`2d37800`](https://github.com/PrismJS/prism/commit/2d37800)]
|
|
||||||
* __Rust__:
|
|
||||||
* Simplified patterns and fixed operators [[`6c8494f`](https://github.com/PrismJS/prism/commit/6c8494f)]
|
|
||||||
* __SAS__:
|
|
||||||
* Simplified datalines and optimized operator patterns [[`6ebb96f`](https://github.com/PrismJS/prism/commit/6ebb96f)]
|
|
||||||
* __Sass__:
|
|
||||||
* Add missing require in components [[`35b8c50`](https://github.com/PrismJS/prism/commit/35b8c50)]
|
|
||||||
* Fix comments, operators and selectors and simplified patterns [[`28759d0`](https://github.com/PrismJS/prism/commit/28759d0)]
|
|
||||||
* Highlight "-" as operator only if surrounded by spaces, in order to not break hyphenated values (e.g. "ease-in-out") [[`b2763e7`](https://github.com/PrismJS/prism/commit/b2763e7)]
|
|
||||||
* __Scala__:
|
|
||||||
* Simplified patterns [[`daf2597`](https://github.com/PrismJS/prism/commit/daf2597)]
|
|
||||||
* __Scheme__:
|
|
||||||
* Add missing lookbehind on number pattern. Fix [#702](https://github.com/PrismJS/prism/issues/702) [[`3120ff7`](https://github.com/PrismJS/prism/commit/3120ff7)]
|
|
||||||
* Fixes and simplifications [[`068704a`](https://github.com/PrismJS/prism/commit/068704a)]
|
|
||||||
* Don't match content of symbols starting with a parenthesis [[`fa7df08`](https://github.com/PrismJS/prism/commit/fa7df08)]
|
|
||||||
* __Scss__:
|
|
||||||
* Simplified patterns + fixed operators + don't match empty selectors [[`672c167`](https://github.com/PrismJS/prism/commit/672c167)]
|
|
||||||
* __Smalltalk__:
|
|
||||||
* Simplified patterns [[`d896622`](https://github.com/PrismJS/prism/commit/d896622)]
|
|
||||||
* __Smarty__:
|
|
||||||
* Optimized regexps + fixed punctuation and operators [[`1446700`](https://github.com/PrismJS/prism/commit/1446700)]
|
|
||||||
* Properly escape special replacement patterns ($) in Handlebars, PHP and Smarty. Fix [#772](https://github.com/PrismJS/prism/issues/772) [[`895bf46`](https://github.com/PrismJS/prism/commit/895bf46)]
|
|
||||||
* __SQL__:
|
|
||||||
* Simplified regexp + fixed keywords and operators + add CHARSET keyword [[`d49fec0`](https://github.com/PrismJS/prism/commit/d49fec0)]
|
|
||||||
* __Stylus__:
|
|
||||||
* Rewrote the component entirely [[`7729728`](https://github.com/PrismJS/prism/commit/7729728)]
|
|
||||||
* __Swift__:
|
|
||||||
* Optimized keywords lists and removed duplicates [[`936e429`](https://github.com/PrismJS/prism/commit/936e429)]
|
|
||||||
* Add support for string interpolation. Fix [#448](https://github.com/PrismJS/prism/issues/448) [[`89cd5d0`](https://github.com/PrismJS/prism/commit/89cd5d0)]
|
|
||||||
* __Twig__:
|
|
||||||
* Prevent "other" pattern from matching blank strings [[`cae2cef`](https://github.com/PrismJS/prism/commit/cae2cef)]
|
|
||||||
* Optimized regexps + fixed operators + added missing operators/keywords [[`2d8271f`](https://github.com/PrismJS/prism/commit/2d8271f)]
|
|
||||||
* __VHDL__:
|
|
||||||
* Move operator overloading before strings, don't capture if not needed, handle \r\n and \r, fix numbers [[`4533f17`](https://github.com/PrismJS/prism/commit/4533f17)]
|
|
||||||
* __Wiki markup__:
|
|
||||||
* Fixed emphasis + merged some url patterns + added TODOs [[`8cf9e6a`](https://github.com/PrismJS/prism/commit/8cf9e6a)]
|
|
||||||
* __YAML__:
|
|
||||||
* Handled \r\n and \r, simplified some patterns, fixed "---" [[`9e33e0a`](https://github.com/PrismJS/prism/commit/9e33e0a)]
|
|
||||||
|
|
||||||
### New plugins
|
|
||||||
|
|
||||||
* __Autoloader__ ([#766](https://github.com/PrismJS/prism/issues/766)) [[`ed4ccfe`](https://github.com/PrismJS/prism/commit/ed4ccfe)]
|
|
||||||
* __JSONP Highlight__ [[`b2f14d9`](https://github.com/PrismJS/prism/commit/b2f14d9)]
|
|
||||||
* __Keep Markup__ ([#770](https://github.com/PrismJS/prism/issues/770)) [[`bd3e9ea`](https://github.com/PrismJS/prism/commit/bd3e9ea)]
|
|
||||||
* __Previewer: Base__ ([#767](https://github.com/PrismJS/prism/issues/767)) [[`cf764c0`](https://github.com/PrismJS/prism/commit/cf764c0)]
|
|
||||||
* __Previewer: Color__ ([#767](https://github.com/PrismJS/prism/issues/767)) [[`cf764c0`](https://github.com/PrismJS/prism/commit/cf764c0)]
|
|
||||||
* __Previewer: Easing__ ([#773](https://github.com/PrismJS/prism/issues/773)) [[`513137c`](https://github.com/PrismJS/prism/commit/513137c), [`9207258`](https://github.com/PrismJS/prism/commit/9207258), [`4303c94`](https://github.com/PrismJS/prism/commit/4303c94)]
|
|
||||||
* __Remove initial line feed__ [[`ed9f2b2`](https://github.com/PrismJS/prism/commit/ed9f2b2), [`b8d098e`](https://github.com/PrismJS/prism/commit/b8d098e)]
|
|
||||||
|
|
||||||
### Updated plugins
|
|
||||||
|
|
||||||
* __Autolinker__:
|
|
||||||
* Don't process all grammars on load, process each one in before-highlight. Should fix [#760](https://github.com/PrismJS/prism/issues/760) [[`a572495`](https://github.com/PrismJS/prism/commit/a572495)]
|
|
||||||
* __Line Highlight__:
|
|
||||||
* Run in `complete` hook [[`f237e67`](https://github.com/PrismJS/prism/commit/f237e67)]
|
|
||||||
* Fixed position when font-size is odd ([#668](https://github.com/PrismJS/prism/issues/668)) [[`86bbd4c`](https://github.com/PrismJS/prism/commit/86bbd4c), [`8ed7ce3`](https://github.com/PrismJS/prism/commit/8ed7ce3)]
|
|
||||||
* __Line Numbers__:
|
|
||||||
* Run in `complete` hook [[`3f4d918`](https://github.com/PrismJS/prism/commit/3f4d918)]
|
|
||||||
* Don't run if already exists [[`c89bbdb`](https://github.com/PrismJS/prism/commit/c89bbdb)]
|
|
||||||
* Don't run if block is empty. Fix [#669](https://github.com/PrismJS/prism/issues/669) [[`ee463e8`](https://github.com/PrismJS/prism/commit/ee463e8)]
|
|
||||||
* Correct calculation for number of lines (fix [#385](https://github.com/PrismJS/prism/issues/385)) [[`14f3f80`](https://github.com/PrismJS/prism/commit/14f3f80)]
|
|
||||||
* Fix computation of line numbers for single-line code blocks. Fix [#721](https://github.com/PrismJS/prism/issues/721) [[`02b220e`](https://github.com/PrismJS/prism/commit/02b220e)]
|
|
||||||
* Fixing word wrap on long code lines [[`56b3d29`](https://github.com/PrismJS/prism/commit/56b3d29)]
|
|
||||||
* Fixing coy theme + line numbers plugin overflowing on long blocks of text ([#762](https://github.com/PrismJS/prism/issues/762)) [[`a0127eb`](https://github.com/PrismJS/prism/commit/a0127eb)]
|
|
||||||
* __Show Language__:
|
|
||||||
* Add gulp task to build languages map in Show language plugin (Fix [#671](https://github.com/PrismJS/prism/issues/671)) [[`39bd827`](https://github.com/PrismJS/prism/commit/39bd827)]
|
|
||||||
* Add reset styles to prevent bug in Coy theme ([#703](https://github.com/PrismJS/prism/issues/703)) [[`08dd500`](https://github.com/PrismJS/prism/commit/08dd500)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Fixed link to David Peach article ([#647](https://github.com/PrismJS/prism/issues/647)) [[`3f679f8`](https://github.com/PrismJS/prism/commit/3f679f8)]
|
|
||||||
* Added `complete` hook, which runs even when no grammar is found [[`e58b6c0`](https://github.com/PrismJS/prism/commit/e58b6c0), [`fd54995`](https://github.com/PrismJS/prism/commit/fd54995)]
|
|
||||||
* Added test suite runner ([#588](https://github.com/PrismJS/prism/issues/588)) [[`956cd85`](https://github.com/PrismJS/prism/commit/956cd85)]
|
|
||||||
* Added tests for every components
|
|
||||||
* Added `.gitattributes` to prevent line ending changes in test files [[`45ca8c8`](https://github.com/PrismJS/prism/commit/45ca8c8)]
|
|
||||||
* Split plugins into 3 columns on Download page [[`a88936a`](https://github.com/PrismJS/prism/commit/a88936a)]
|
|
||||||
* Removed comment in components.js to make it easier to parse as JSON ([#679](https://github.com/PrismJS/prism/issues/679)) [[`2cb1326`](https://github.com/PrismJS/prism/commit/2cb1326)]
|
|
||||||
* Updated README.md [[`1388256`](https://github.com/PrismJS/prism/commit/1388256)]
|
|
||||||
* Updated documentation since the example was not relevant any more [[`80aedb2`](https://github.com/PrismJS/prism/commit/80aedb2)]
|
|
||||||
* Fixed inline style for Coy theme [[`52829b3`](https://github.com/PrismJS/prism/commit/52829b3)]
|
|
||||||
* Prevent errors in nodeJS ([#754](https://github.com/PrismJS/prism/issues/754)) [[`9f5c93c`](https://github.com/PrismJS/prism/commit/9f5c93c), [`0356c58`](https://github.com/PrismJS/prism/commit/0356c58)]
|
|
||||||
* Explicitly make the Worker close itself after highlighting, so that users have control on this behaviour when directly using Prism inside a Worker. Fix [#492](https://github.com/PrismJS/prism/issues/492) [[`e42a228`](https://github.com/PrismJS/prism/commit/e42a228)]
|
|
||||||
* Added some language aliases: js for javascript, xml, html, mathml and svg for markup [[`2f9fe1e`](https://github.com/PrismJS/prism/commit/2f9fe1e)]
|
|
||||||
* Download page: Add a "Select all" checkbox ([#561](https://github.com/PrismJS/prism/issues/561)) [[`9a9020b`](https://github.com/PrismJS/prism/commit/9a9020b)]
|
|
||||||
* Download page: Don't add semicolon unless needed in generated code. Fix [#273](https://github.com/PrismJS/prism/issues/273) [[`5a5eec5`](https://github.com/PrismJS/prism/commit/5a5eec5)]
|
|
||||||
* Add language counter on homepage [[`889cda5`](https://github.com/PrismJS/prism/commit/889cda5)]
|
|
||||||
* Improve performance by doing more work in the worker [[`1316abc`](https://github.com/PrismJS/prism/commit/1316abc)]
|
|
||||||
* Replace Typeplate with SitePoint on homepage. Fix [#774](https://github.com/PrismJS/prism/issues/774) [[`0c54308`](https://github.com/PrismJS/prism/commit/0c54308)]
|
|
||||||
* Added basic `.editorconfig` [[`c48f55d`](https://github.com/PrismJS/prism/commit/c48f55d)]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.0.1 (2015-07-26)
|
|
||||||
|
|
||||||
### New components
|
|
||||||
|
|
||||||
* __Brainfuck__ ([#611](https://github.com/PrismJS/prism/issues/611)) [[`3ede718`](https://github.com/PrismJS/prism/commit/3ede718)]
|
|
||||||
* __Keyman__ ([#609](https://github.com/PrismJS/prism/issues/609)) [[`2698f82`](https://github.com/PrismJS/prism/commit/2698f82), [`e9936c6`](https://github.com/PrismJS/prism/commit/e9936c6)]
|
|
||||||
* __Makefile__ ([#610](https://github.com/PrismJS/prism/issues/610)) [[`3baa61c`](https://github.com/PrismJS/prism/commit/3baa61c)]
|
|
||||||
* __Sass (Sass)__ (fix [#199](https://github.com/PrismJS/prism/issues/199)) [[`b081804`](https://github.com/PrismJS/prism/commit/b081804)]
|
|
||||||
* __VHDL__ ([#595](https://github.com/PrismJS/prism/issues/595)) [[`43e6157`](https://github.com/PrismJS/prism/commit/43e6157)]
|
|
||||||
|
|
||||||
### Updated components
|
|
||||||
|
|
||||||
* __ActionScript__:
|
|
||||||
* Fix ! operator and add ++ and -- as whole operators [[`6bf0794`](https://github.com/PrismJS/prism/commit/6bf0794)]
|
|
||||||
* Fix XML highlighting [[`90257b0`](https://github.com/PrismJS/prism/commit/90257b0)]
|
|
||||||
* Update examples to add inline XML [[`2c1626a`](https://github.com/PrismJS/prism/commit/2c1626a), [`3987711`](https://github.com/PrismJS/prism/commit/3987711)]
|
|
||||||
* __Apache Configuration__:
|
|
||||||
* Don't include the spaces in directive-inline [[`e87efd8`](https://github.com/PrismJS/prism/commit/e87efd8)]
|
|
||||||
* __AppleScript__:
|
|
||||||
* Allow one level of nesting in block comments [[`65894c5`](https://github.com/PrismJS/prism/commit/65894c5)]
|
|
||||||
* Removed duplicates between operators and keywords [[`1ec5a81`](https://github.com/PrismJS/prism/commit/1ec5a81)]
|
|
||||||
* Removed duplicates between keywords and classes [[`e8d09f6`](https://github.com/PrismJS/prism/commit/e8d09f6)]
|
|
||||||
* Move numbers up so they are not broken by operator pattern [[`66dac31`](https://github.com/PrismJS/prism/commit/66dac31)]
|
|
||||||
* __ASP.NET__:
|
|
||||||
* Prevent Markup tags from breaking ASP tags + fix MasterType directive [[`1f0a336`](https://github.com/PrismJS/prism/commit/1f0a336)]
|
|
||||||
* __AutoHotkey__:
|
|
||||||
* Allow tags (labels) to be highlighted at the end of the code [[`0a1fc4b`](https://github.com/PrismJS/prism/commit/0a1fc4b)]
|
|
||||||
* Match all operators + add comma to punctuation [[`f0ccb1b`](https://github.com/PrismJS/prism/commit/f0ccb1b)]
|
|
||||||
* Removed duplicates in keywords lists [[`fe0a068`](https://github.com/PrismJS/prism/commit/fe0a068)]
|
|
||||||
* __Bash__:
|
|
||||||
* Simplify comment regex [[`2700981`](https://github.com/PrismJS/prism/commit/2700981)]
|
|
||||||
* Removed duplicates in keywords + removed unneeded parentheses [[`903b8a4`](https://github.com/PrismJS/prism/commit/903b8a4)]
|
|
||||||
* __C__:
|
|
||||||
* Removed string pattern (inherited from C-like) [[`dcce1a7`](https://github.com/PrismJS/prism/commit/dcce1a7)]
|
|
||||||
* Better support for macro statements [[`4868635`](https://github.com/PrismJS/prism/commit/4868635)]
|
|
||||||
* __C#__:
|
|
||||||
* Fix preprocessor pattern [[`86311f5`](https://github.com/PrismJS/prism/commit/86311f5)]
|
|
||||||
* __C++__:
|
|
||||||
* Removed delete[] and new[] broken keywords [[`42fbeef`](https://github.com/PrismJS/prism/commit/42fbeef)]
|
|
||||||
* __C-like__:
|
|
||||||
* Removed unused 'ignore' pattern [[`b6535dd`](https://github.com/PrismJS/prism/commit/b6535dd)]
|
|
||||||
* Use look-ahead instead of inside to match functions [[`d4194c9`](https://github.com/PrismJS/prism/commit/d4194c9)]
|
|
||||||
* __CoffeeScript__:
|
|
||||||
* Prevent strings from ending with a backslash [[`cb6b824`](https://github.com/PrismJS/prism/commit/cb6b824)]
|
|
||||||
* __CSS__:
|
|
||||||
* Highlight parentheses as punctuation [[`cd0273e`](https://github.com/PrismJS/prism/commit/cd0273e)]
|
|
||||||
* Improved highlighting of at-rules [[`e254088`](https://github.com/PrismJS/prism/commit/e254088)]
|
|
||||||
* Improved URL and strings [[`901812c`](https://github.com/PrismJS/prism/commit/901812c)]
|
|
||||||
* Selector regexp should not include last spaces before brace [[`f2e2718`](https://github.com/PrismJS/prism/commit/f2e2718)]
|
|
||||||
* Handle \r\n [[`15760e1`](https://github.com/PrismJS/prism/commit/15760e1)]
|
|
||||||
* __Eiffel__:
|
|
||||||
* Fix string patterns order + fix /= operator [[`7d1b8d7`](https://github.com/PrismJS/prism/commit/7d1b8d7)]
|
|
||||||
* __Erlang__:
|
|
||||||
* Fixed quoted functions, quoted atoms, variables and <= operator [[`fa286aa`](https://github.com/PrismJS/prism/commit/fa286aa)]
|
|
||||||
* __Fortran__:
|
|
||||||
* Improved pattern for comments inside strings [[`40ae215`](https://github.com/PrismJS/prism/commit/40ae215)]
|
|
||||||
* Fixed order in keyword pattern [[`8a6d32d`](https://github.com/PrismJS/prism/commit/8a6d32d)]
|
|
||||||
* __Handlebars__:
|
|
||||||
* Support blocks with dashes ([#587](https://github.com/PrismJS/prism/issues/587)) [[`f409b13`](https://github.com/PrismJS/prism/commit/f409b13)]
|
|
||||||
* __JavaScript__:
|
|
||||||
* Added support for 'y' and 'u' ES6 JavaScript regex flags ([#596](https://github.com/PrismJS/prism/issues/596)) [[`5d99957`](https://github.com/PrismJS/prism/commit/5d99957)]
|
|
||||||
* Added support for missing ES6 keywords in JavaScript ([#596](https://github.com/PrismJS/prism/issues/596)) [[`ca68b87`](https://github.com/PrismJS/prism/commit/ca68b87)]
|
|
||||||
* Added `async` and `await` keywords ([#575](https://github.com/PrismJS/prism/issues/575)) [[`5458cec`](https://github.com/PrismJS/prism/commit/5458cec)]
|
|
||||||
* Added support for Template strings + interpolation [[`04f72b1`](https://github.com/PrismJS/prism/commit/04f72b1)]
|
|
||||||
* Added support for octal and binary numbers ([#597](https://github.com/PrismJS/prism/issues/597)) [[`a8aa058`](https://github.com/PrismJS/prism/commit/a8aa058)]
|
|
||||||
* Improve regex performance of C-like strings and JS regexps [[`476cbf4`](https://github.com/PrismJS/prism/commit/476cbf4)]
|
|
||||||
* __Markup__:
|
|
||||||
* Allow non-ASCII chars in tag names and attributes (fix [#585](https://github.com/PrismJS/prism/issues/585)) [[`52fd55e`](https://github.com/PrismJS/prism/commit/52fd55e)]
|
|
||||||
* Optimized tag's regexp so that it stops crashing on large unclosed tags [[`75452ba`](https://github.com/PrismJS/prism/commit/75452ba)]
|
|
||||||
* Highlight single quotes in attr-value as punctuation [[`1ebcb8e`](https://github.com/PrismJS/prism/commit/1ebcb8e)]
|
|
||||||
* Doctype and prolog can be multi-line [[`c19a238`](https://github.com/PrismJS/prism/commit/c19a238)]
|
|
||||||
* __Python__:
|
|
||||||
* Added highlighting for function declaration ([#601](https://github.com/PrismJS/prism/issues/601)) [[`a88aae8`](https://github.com/PrismJS/prism/commit/a88aae8)]
|
|
||||||
* Fixed wrong highlighting of variables named a, b, c... f ([#601](https://github.com/PrismJS/prism/issues/601)) [[`a88aae8`](https://github.com/PrismJS/prism/commit/a88aae8)]
|
|
||||||
* __Ruby__:
|
|
||||||
* Added support for string interpolation [[`c36b123`](https://github.com/PrismJS/prism/commit/c36b123)]
|
|
||||||
* __Scss__:
|
|
||||||
* Fixed media queries highlighting [[`bf8e032`](https://github.com/PrismJS/prism/commit/bf8e032)]
|
|
||||||
* Improved highlighting inside at-rules [[`eef4248`](https://github.com/PrismJS/prism/commit/eef4248)]
|
|
||||||
* Match placeholders inside selectors (fix [#238](https://github.com/PrismJS/prism/issues/238)) [[`4e42e26`](https://github.com/PrismJS/prism/commit/4e42e26)]
|
|
||||||
* __Swift__:
|
|
||||||
* Update keywords list (fix [#625](https://github.com/PrismJS/prism/issues/625)) [[`88f44a7`](https://github.com/PrismJS/prism/commit/88f44a7)]
|
|
||||||
|
|
||||||
### Updated plugins
|
|
||||||
|
|
||||||
* __File Highlight__:
|
|
||||||
* Allow to specify the highlighting language. Fix [#607](https://github.com/PrismJS/prism/issues/607) [[`8030db9`](https://github.com/PrismJS/prism/commit/8030db9)]
|
|
||||||
* __Line Highlight__:
|
|
||||||
* Fixed incorrect height in IE9 ([#604](https://github.com/PrismJS/prism/issues/604)) [[`f1705eb`](https://github.com/PrismJS/prism/commit/f1705eb)]
|
|
||||||
* Prevent errors in IE8 [[`5f133c8`](https://github.com/PrismJS/prism/commit/5f133c8)]
|
|
||||||
|
|
||||||
### Other changes
|
|
||||||
|
|
||||||
* Removed moot `version` property from `bower.json` ([#594](https://github.com/PrismJS/prism/issues/594)) [[`4693499`](https://github.com/PrismJS/prism/commit/4693499)]
|
|
||||||
* Added repository to `bower.json` ([#600](https://github.com/PrismJS/prism/issues/600)) [[`8e5ebcc`](https://github.com/PrismJS/prism/commit/8e5ebcc)]
|
|
||||||
* Added `.DS_Store` to `.gitignore` [[`1707e4e`](https://github.com/PrismJS/prism/commit/1707e4e)]
|
|
||||||
* Improve test drive page usability. Fix [#591](https://github.com/PrismJS/prism/issues/591) [[`fe60858`](https://github.com/PrismJS/prism/commit/fe60858)]
|
|
||||||
* Fixed prism-core and prism-file-highlight to prevent errors in IE8 [[`5f133c8`](https://github.com/PrismJS/prism/commit/5f133c8)]
|
|
||||||
* Add Ubuntu Mono font to font stack [[`ed9d7e3`](https://github.com/PrismJS/prism/commit/ed9d7e3)]
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1.0.0 (2015-05-23)
|
|
||||||
|
|
||||||
* First release
|
|
||||||
* Supported languages:
|
|
||||||
* ActionScript
|
|
||||||
* Apache Configuration
|
|
||||||
* AppleScript
|
|
||||||
* ASP.NET (C#)
|
|
||||||
* AutoHotkey
|
|
||||||
* Bash
|
|
||||||
* C
|
|
||||||
* C#
|
|
||||||
* C++
|
|
||||||
* C-like
|
|
||||||
* CoffeeScript
|
|
||||||
* CSS
|
|
||||||
* CSS Extras
|
|
||||||
* Dart
|
|
||||||
* Eiffel
|
|
||||||
* Erlang
|
|
||||||
* F#
|
|
||||||
* Fortran
|
|
||||||
* Gherkin
|
|
||||||
* Git
|
|
||||||
* Go
|
|
||||||
* Groovy
|
|
||||||
* Haml
|
|
||||||
* Handlebars
|
|
||||||
* Haskell
|
|
||||||
* HTTP
|
|
||||||
* Ini
|
|
||||||
* Jade
|
|
||||||
* Java
|
|
||||||
* JavaScript
|
|
||||||
* Julia
|
|
||||||
* LaTeX
|
|
||||||
* Less
|
|
||||||
* LOLCODE
|
|
||||||
* Markdown
|
|
||||||
* Markup
|
|
||||||
* MATLAB
|
|
||||||
* NASM
|
|
||||||
* NSIS
|
|
||||||
* Objective-C
|
|
||||||
* Pascal
|
|
||||||
* Perl
|
|
||||||
* PHP
|
|
||||||
* PHP Extras
|
|
||||||
* PowerShell
|
|
||||||
* Python
|
|
||||||
* R
|
|
||||||
* React JSX
|
|
||||||
* reST
|
|
||||||
* Rip
|
|
||||||
* Ruby
|
|
||||||
* Rust
|
|
||||||
* SAS
|
|
||||||
* Sass (Scss)
|
|
||||||
* Scala
|
|
||||||
* Scheme
|
|
||||||
* Smalltalk
|
|
||||||
* Smarty
|
|
||||||
* SQL
|
|
||||||
* Stylus
|
|
||||||
* Swift
|
|
||||||
* Twig
|
|
||||||
* TypeScript
|
|
||||||
* Wiki markup
|
|
||||||
* YAML
|
|
||||||
* Plugins:
|
|
||||||
* Autolinker
|
|
||||||
* File Highlight
|
|
||||||
* Highlight Keywords
|
|
||||||
* Line Highlight
|
|
||||||
* Line Numbers
|
|
||||||
* Show Invisibles
|
|
||||||
* Show Language
|
|
||||||
* WebPlatform Docs
|
|
21
dashboard-ui/bower_components/prism/LICENSE
vendored
21
dashboard-ui/bower_components/prism/LICENSE
vendored
|
@ -1,21 +0,0 @@
|
||||||
MIT LICENSE
|
|
||||||
|
|
||||||
Copyright (c) 2012 Lea Verou
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
30
dashboard-ui/bower_components/prism/bower.json
vendored
30
dashboard-ui/bower_components/prism/bower.json
vendored
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
"name": "prism",
|
|
||||||
"main": [
|
|
||||||
"prism.js",
|
|
||||||
"themes/prism.css"
|
|
||||||
],
|
|
||||||
"homepage": "http://prismjs.com",
|
|
||||||
"authors": "Lea Verou",
|
|
||||||
"description": "Lightweight, robust, elegant syntax highlighting. A spin-off project from Dabblet.",
|
|
||||||
"license": "MIT",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/PrismJS/prism.git"
|
|
||||||
},
|
|
||||||
"ignore": [
|
|
||||||
"**/.*",
|
|
||||||
"img",
|
|
||||||
"templates",
|
|
||||||
"tests",
|
|
||||||
"CNAME",
|
|
||||||
"*.html",
|
|
||||||
"style.css",
|
|
||||||
"favicon.png",
|
|
||||||
"logo.svg",
|
|
||||||
"download.js",
|
|
||||||
"prefixfree.min.js",
|
|
||||||
"utopia.js",
|
|
||||||
"code.js"
|
|
||||||
]
|
|
||||||
}
|
|
630
dashboard-ui/bower_components/prism/components.js
vendored
630
dashboard-ui/bower_components/prism/components.js
vendored
|
@ -1,630 +0,0 @@
|
||||||
var components = {
|
|
||||||
"core": {
|
|
||||||
"meta": {
|
|
||||||
"path": "components/prism-core.js",
|
|
||||||
"option": "mandatory"
|
|
||||||
},
|
|
||||||
"core": "Core"
|
|
||||||
},
|
|
||||||
"themes": {
|
|
||||||
"meta": {
|
|
||||||
"path": "themes/{id}.css",
|
|
||||||
"link": "index.html?theme={id}",
|
|
||||||
"exclusive": true
|
|
||||||
},
|
|
||||||
"prism": {
|
|
||||||
"title": "Default",
|
|
||||||
"option": "default"
|
|
||||||
},
|
|
||||||
"prism-dark": "Dark",
|
|
||||||
"prism-funky": "Funky",
|
|
||||||
"prism-okaidia": {
|
|
||||||
"title": "Okaidia",
|
|
||||||
"owner": "ocodia"
|
|
||||||
},
|
|
||||||
"prism-twilight": {
|
|
||||||
"title": "Twilight",
|
|
||||||
"owner": "remybach"
|
|
||||||
},
|
|
||||||
"prism-coy": {
|
|
||||||
"title": "Coy",
|
|
||||||
"owner": "tshedor"
|
|
||||||
},
|
|
||||||
"prism-solarizedlight": {
|
|
||||||
"title": "Solarized Light",
|
|
||||||
"owner": "hectormatos2011 "
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"languages": {
|
|
||||||
"meta": {
|
|
||||||
"path": "components/prism-{id}",
|
|
||||||
"noCSS": true,
|
|
||||||
"examplesPath": "examples/prism-{id}",
|
|
||||||
"addCheckAll": true
|
|
||||||
},
|
|
||||||
"markup": {
|
|
||||||
"title": "Markup",
|
|
||||||
"aliasTitles": { "html": "HTML", "xml": "XML", "svg": "SVG", "mathml": "MathML" },
|
|
||||||
"option": "default"
|
|
||||||
},
|
|
||||||
"css": {
|
|
||||||
"title": "CSS",
|
|
||||||
"option": "default"
|
|
||||||
},
|
|
||||||
"clike": {
|
|
||||||
"title": "C-like",
|
|
||||||
"option": "default"
|
|
||||||
},
|
|
||||||
"javascript": {
|
|
||||||
"title": "JavaScript",
|
|
||||||
"option": "default",
|
|
||||||
"require": "clike"
|
|
||||||
},
|
|
||||||
"abap": {
|
|
||||||
"title": "ABAP",
|
|
||||||
"owner": "dellagustin"
|
|
||||||
},
|
|
||||||
"actionscript": {
|
|
||||||
"title": "ActionScript",
|
|
||||||
"require": "javascript",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"apacheconf": {
|
|
||||||
"title": "Apache Configuration",
|
|
||||||
"owner": "GuiTeK"
|
|
||||||
},
|
|
||||||
"apl": {
|
|
||||||
"title": "APL",
|
|
||||||
"owner": "ngn"
|
|
||||||
},
|
|
||||||
"applescript": {
|
|
||||||
"title": "AppleScript",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"asciidoc": {
|
|
||||||
"title": "AsciiDoc",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"aspnet": {
|
|
||||||
"title": "ASP.NET (C#)",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "nauzilus"
|
|
||||||
},
|
|
||||||
"autoit": {
|
|
||||||
"title": "AutoIt",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"autohotkey": {
|
|
||||||
"title": "AutoHotkey",
|
|
||||||
"owner": "aviaryan"
|
|
||||||
},
|
|
||||||
"bash": {
|
|
||||||
"title": "Bash",
|
|
||||||
"owner": "zeitgeist87"
|
|
||||||
},
|
|
||||||
"basic": {
|
|
||||||
"title": "BASIC",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"batch": {
|
|
||||||
"title": "Batch",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"bison": {
|
|
||||||
"title": "Bison",
|
|
||||||
"require": "c",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"brainfuck": {
|
|
||||||
"title": "Brainfuck",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"bro": {
|
|
||||||
"title": "Bro",
|
|
||||||
"owner": "wayward710"
|
|
||||||
},
|
|
||||||
"c": {
|
|
||||||
"title": "C",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "zeitgeist87"
|
|
||||||
},
|
|
||||||
"csharp": {
|
|
||||||
"title": "C#",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "mvalipour"
|
|
||||||
},
|
|
||||||
"cpp": {
|
|
||||||
"title": "C++",
|
|
||||||
"require": "c",
|
|
||||||
"owner": "zeitgeist87"
|
|
||||||
},
|
|
||||||
"coffeescript": {
|
|
||||||
"title": "CoffeeScript",
|
|
||||||
"require": "javascript",
|
|
||||||
"owner": "R-osey"
|
|
||||||
},
|
|
||||||
"crystal": {
|
|
||||||
"title": "Crystal",
|
|
||||||
"require": "ruby",
|
|
||||||
"owner": "MakeNowJust"
|
|
||||||
},
|
|
||||||
"css-extras": {
|
|
||||||
"title": "CSS Extras",
|
|
||||||
"require": "css",
|
|
||||||
"owner": "milesj"
|
|
||||||
},
|
|
||||||
"d": {
|
|
||||||
"title": "D",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"dart": {
|
|
||||||
"title": "Dart",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"diff": {
|
|
||||||
"title": "Diff",
|
|
||||||
"owner": "uranusjr"
|
|
||||||
},
|
|
||||||
"docker": {
|
|
||||||
"title": "Docker",
|
|
||||||
"owner": "JustinBeckwith"
|
|
||||||
},
|
|
||||||
"eiffel": {
|
|
||||||
"title": "Eiffel",
|
|
||||||
"owner": "Conaclos"
|
|
||||||
},
|
|
||||||
"elixir": {
|
|
||||||
"title": "Elixir",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"erlang": {
|
|
||||||
"title": "Erlang",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"fsharp": {
|
|
||||||
"title": "F#",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "simonreynolds7"
|
|
||||||
},
|
|
||||||
"fortran": {
|
|
||||||
"title": "Fortran",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"gherkin": {
|
|
||||||
"title": "Gherkin",
|
|
||||||
"owner": "hason"
|
|
||||||
},
|
|
||||||
"git": {
|
|
||||||
"title": "Git",
|
|
||||||
"owner": "lgiraudel"
|
|
||||||
},
|
|
||||||
"glsl": {
|
|
||||||
"title": "GLSL",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"go": {
|
|
||||||
"title": "Go",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "arnehormann"
|
|
||||||
},
|
|
||||||
"groovy": {
|
|
||||||
"title": "Groovy",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "robfletcher"
|
|
||||||
},
|
|
||||||
"haml": {
|
|
||||||
"title": "Haml",
|
|
||||||
"require": "ruby",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"handlebars": {
|
|
||||||
"title": "Handlebars",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"haskell": {
|
|
||||||
"title": "Haskell",
|
|
||||||
"owner": "bholst"
|
|
||||||
},
|
|
||||||
"haxe": {
|
|
||||||
"title": "Haxe",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"http": {
|
|
||||||
"title": "HTTP",
|
|
||||||
"owner": "danielgtaylor"
|
|
||||||
},
|
|
||||||
"icon": {
|
|
||||||
"title": "Icon",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"inform7": {
|
|
||||||
"title": "Inform 7",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"ini": {
|
|
||||||
"title": "Ini",
|
|
||||||
"owner": "aviaryan"
|
|
||||||
},
|
|
||||||
"j": {
|
|
||||||
"title": "J",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"jade": {
|
|
||||||
"title": "Jade",
|
|
||||||
"require": "javascript",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"java": {
|
|
||||||
"title": "Java",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "sherblot"
|
|
||||||
},
|
|
||||||
"json": {
|
|
||||||
"title": "JSON",
|
|
||||||
"owner": "CupOfTea696"
|
|
||||||
},
|
|
||||||
"julia": {
|
|
||||||
"title": "Julia",
|
|
||||||
"owner": "cdagnino"
|
|
||||||
},
|
|
||||||
"keyman": {
|
|
||||||
"title": "Keyman",
|
|
||||||
"owner": "mcdurdin"
|
|
||||||
},
|
|
||||||
"kotlin": {
|
|
||||||
"title": "Kotlin",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"latex": {
|
|
||||||
"title": "LaTeX",
|
|
||||||
"owner": "japborst"
|
|
||||||
},
|
|
||||||
"less": {
|
|
||||||
"title": "Less",
|
|
||||||
"require": "css",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"lolcode": {
|
|
||||||
"title": "LOLCODE",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"lua": {
|
|
||||||
"title": "Lua",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"makefile": {
|
|
||||||
"title": "Makefile",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"markdown": {
|
|
||||||
"title": "Markdown",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"matlab": {
|
|
||||||
"title": "MATLAB",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"mel": {
|
|
||||||
"title": "MEL",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"mizar": {
|
|
||||||
"title": "Mizar",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"monkey": {
|
|
||||||
"title": "Monkey",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"nasm": {
|
|
||||||
"title": "NASM",
|
|
||||||
"owner": "rbmj"
|
|
||||||
},
|
|
||||||
"nginx": {
|
|
||||||
"title": "nginx",
|
|
||||||
"owner": "westonganger",
|
|
||||||
"require": "clike"
|
|
||||||
},
|
|
||||||
"nim": {
|
|
||||||
"title": "Nim",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"nix": {
|
|
||||||
"title": "Nix",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"nsis": {
|
|
||||||
"title": "NSIS",
|
|
||||||
"owner": "idleberg"
|
|
||||||
},
|
|
||||||
"objectivec": {
|
|
||||||
"title": "Objective-C",
|
|
||||||
"require": "c",
|
|
||||||
"owner": "uranusjr"
|
|
||||||
},
|
|
||||||
"ocaml": {
|
|
||||||
"title": "OCaml",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"oz": {
|
|
||||||
"title": "Oz",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"parigp": {
|
|
||||||
"title": "PARI/GP",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"parser": {
|
|
||||||
"title": "Parser",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"pascal": {
|
|
||||||
"title": "Pascal",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"perl": {
|
|
||||||
"title": "Perl",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"php": {
|
|
||||||
"title": "PHP",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "milesj"
|
|
||||||
},
|
|
||||||
"php-extras": {
|
|
||||||
"title": "PHP Extras",
|
|
||||||
"require": "php",
|
|
||||||
"owner": "milesj"
|
|
||||||
},
|
|
||||||
"powershell": {
|
|
||||||
"title": "PowerShell",
|
|
||||||
"owner": "nauzilus"
|
|
||||||
},
|
|
||||||
"processing": {
|
|
||||||
"title": "Processing",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"prolog": {
|
|
||||||
"title": "Prolog",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"protobuf": {
|
|
||||||
"title": "Protocol Buffers",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "just-boris"
|
|
||||||
},
|
|
||||||
"puppet": {
|
|
||||||
"title": "Puppet",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"pure": {
|
|
||||||
"title": "Pure",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"python": {
|
|
||||||
"title": "Python",
|
|
||||||
"owner": "multipetros"
|
|
||||||
},
|
|
||||||
"q": {
|
|
||||||
"title": "Q",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"qore": {
|
|
||||||
"title": "Qore",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "temnroegg"
|
|
||||||
},
|
|
||||||
"r": {
|
|
||||||
"title": "R",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"jsx":{
|
|
||||||
"title": "React JSX",
|
|
||||||
"require": ["markup", "javascript"],
|
|
||||||
"owner": "vkbansal"
|
|
||||||
},
|
|
||||||
"rest": {
|
|
||||||
"title": "reST (reStructuredText)",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"rip": {
|
|
||||||
"title": "Rip",
|
|
||||||
"owner": "ravinggenius"
|
|
||||||
},
|
|
||||||
"roboconf": {
|
|
||||||
"title": "Roboconf",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"ruby": {
|
|
||||||
"title": "Ruby",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "samflores"
|
|
||||||
},
|
|
||||||
"rust": {
|
|
||||||
"title": "Rust",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"sas": {
|
|
||||||
"title": "SAS",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"sass": {
|
|
||||||
"title": "Sass (Sass)",
|
|
||||||
"require": "css",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"scss": {
|
|
||||||
"title": "Sass (Scss)",
|
|
||||||
"require": "css",
|
|
||||||
"owner": "MoOx"
|
|
||||||
},
|
|
||||||
"scala": {
|
|
||||||
"title": "Scala",
|
|
||||||
"require": "java",
|
|
||||||
"owner": "jozic"
|
|
||||||
},
|
|
||||||
"scheme" : {
|
|
||||||
"title": "Scheme",
|
|
||||||
"owner" : "bacchus123"
|
|
||||||
},
|
|
||||||
"smalltalk": {
|
|
||||||
"title": "Smalltalk",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"smarty": {
|
|
||||||
"title": "Smarty",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"sql": {
|
|
||||||
"title": "SQL",
|
|
||||||
"owner": "multipetros"
|
|
||||||
},
|
|
||||||
"stylus" : {
|
|
||||||
"title": "Stylus",
|
|
||||||
"owner": "vkbansal"
|
|
||||||
},
|
|
||||||
"swift": {
|
|
||||||
"title": "Swift",
|
|
||||||
"require": "clike",
|
|
||||||
"owner": "chrischares"
|
|
||||||
},
|
|
||||||
"tcl": {
|
|
||||||
"title": "Tcl",
|
|
||||||
"owner": "PeterChaplin"
|
|
||||||
},
|
|
||||||
"textile": {
|
|
||||||
"title": "Textile",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"twig": {
|
|
||||||
"title": "Twig",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "brandonkelly"
|
|
||||||
},
|
|
||||||
"typescript":{
|
|
||||||
"title": "TypeScript",
|
|
||||||
"require": "javascript",
|
|
||||||
"owner": "vkbansal"
|
|
||||||
},
|
|
||||||
"verilog": {
|
|
||||||
"title": "Verilog",
|
|
||||||
"owner": "a-rey"
|
|
||||||
},
|
|
||||||
"vhdl": {
|
|
||||||
"title": "VHDL",
|
|
||||||
"owner": "a-rey"
|
|
||||||
},
|
|
||||||
"vim": {
|
|
||||||
"title": "vim",
|
|
||||||
"owner": "westonganger"
|
|
||||||
},
|
|
||||||
"wiki": {
|
|
||||||
"title": "Wiki markup",
|
|
||||||
"require": "markup",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"yaml": {
|
|
||||||
"title": "YAML",
|
|
||||||
"owner": "hason"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"plugins": {
|
|
||||||
"meta": {
|
|
||||||
"path": "plugins/{id}/prism-{id}",
|
|
||||||
"link": "plugins/{id}/"
|
|
||||||
},
|
|
||||||
"line-highlight": "Line Highlight",
|
|
||||||
"line-numbers": {
|
|
||||||
"title": "Line Numbers",
|
|
||||||
"owner": "kuba-kubula"
|
|
||||||
},
|
|
||||||
"show-invisibles": "Show Invisibles",
|
|
||||||
"autolinker": "Autolinker",
|
|
||||||
"wpd": "WebPlatform Docs",
|
|
||||||
"file-highlight": {
|
|
||||||
"title": "File Highlight",
|
|
||||||
"noCSS": true
|
|
||||||
},
|
|
||||||
"show-language": {
|
|
||||||
"title": "Show Language",
|
|
||||||
"owner": "nauzilus"
|
|
||||||
},
|
|
||||||
"jsonp-highlight": {
|
|
||||||
"title": "JSONP Highlight",
|
|
||||||
"noCSS": true,
|
|
||||||
"owner": "nauzilus"
|
|
||||||
},
|
|
||||||
"highlight-keywords": {
|
|
||||||
"title": "Highlight Keywords",
|
|
||||||
"owner": "vkbansal",
|
|
||||||
"noCSS": true
|
|
||||||
},
|
|
||||||
"remove-initial-line-feed": {
|
|
||||||
"title": "Remove initial line feed",
|
|
||||||
"owner": "Golmote",
|
|
||||||
"noCSS": true
|
|
||||||
},
|
|
||||||
"previewer-base": {
|
|
||||||
"title": "Previewer: Base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"previewer-color": {
|
|
||||||
"title": "Previewer: Color",
|
|
||||||
"require": "previewer-base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"previewer-gradient": {
|
|
||||||
"title": "Previewer: Gradient",
|
|
||||||
"require": "previewer-base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"previewer-easing": {
|
|
||||||
"title": "Previewer: Easing",
|
|
||||||
"require": "previewer-base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"previewer-time": {
|
|
||||||
"title": "Previewer: Time",
|
|
||||||
"require": "previewer-base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"previewer-angle": {
|
|
||||||
"title": "Previewer: Angle",
|
|
||||||
"require": "previewer-base",
|
|
||||||
"owner": "Golmote"
|
|
||||||
},
|
|
||||||
"autoloader": {
|
|
||||||
"title": "Autoloader",
|
|
||||||
"owner": "Golmote",
|
|
||||||
"noCSS": true
|
|
||||||
},
|
|
||||||
"keep-markup": {
|
|
||||||
"title": "Keep Markup",
|
|
||||||
"owner": "Golmote",
|
|
||||||
"after": "normalize-whitespace",
|
|
||||||
"noCSS": true
|
|
||||||
},
|
|
||||||
"command-line": {
|
|
||||||
"title": "Command Line",
|
|
||||||
"owner": "chriswells0"
|
|
||||||
},
|
|
||||||
"unescaped-markup": "Unescaped Markup",
|
|
||||||
"normalize-whitespace": {
|
|
||||||
"title": "Normalize Whitespace",
|
|
||||||
"owner": "zeitgeist87",
|
|
||||||
"after": "unescaped-markup",
|
|
||||||
"noCSS": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,17 +0,0 @@
|
||||||
Prism.languages.actionscript = Prism.languages.extend('javascript', {
|
|
||||||
'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,
|
|
||||||
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/
|
|
||||||
});
|
|
||||||
Prism.languages.actionscript['class-name'].alias = 'function';
|
|
||||||
|
|
||||||
if (Prism.languages.markup) {
|
|
||||||
Prism.languages.insertBefore('actionscript', 'string', {
|
|
||||||
'xml': {
|
|
||||||
pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,
|
|
||||||
lookbehind: true,
|
|
||||||
inside: {
|
|
||||||
rest: Prism.languages.markup
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\\1|\\?(?!\1)[\w\W])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:Prism.languages.markup}}});
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,29 +0,0 @@
|
||||||
Prism.languages.apl = {
|
|
||||||
'comment': /(?:⍝|#[! ]).*$/m,
|
|
||||||
'string': /'(?:[^'\r\n]|'')*'/,
|
|
||||||
'number': /¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i,
|
|
||||||
'statement': /:[A-Z][a-z][A-Za-z]*\b/,
|
|
||||||
'system-function': {
|
|
||||||
pattern: /⎕[A-Z]+/i,
|
|
||||||
alias: 'function'
|
|
||||||
},
|
|
||||||
'constant': /[⍬⌾#⎕⍞]/,
|
|
||||||
'function': /[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
|
|
||||||
'monadic-operator': {
|
|
||||||
pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
|
|
||||||
alias: 'operator'
|
|
||||||
},
|
|
||||||
'dyadic-operator': {
|
|
||||||
pattern: /[.⍣⍠⍤∘⌸]/,
|
|
||||||
alias: 'operator'
|
|
||||||
},
|
|
||||||
'assignment': {
|
|
||||||
pattern: /←/,
|
|
||||||
alias: 'keyword'
|
|
||||||
},
|
|
||||||
'punctuation': /[\[;\]()◇⋄]/,
|
|
||||||
'dfn': {
|
|
||||||
pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
|
|
||||||
alias: 'builtin'
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -1 +0,0 @@
|
||||||
Prism.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:/'(?:[^'\r\n]|'')*'/,number:/¯?(?:\d*\.?\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:\d*\.?\d+(?:e[\+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,"function":/[-+×÷⌈⌊∣|⍳?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}};
|
|
|
@ -1,20 +0,0 @@
|
||||||
Prism.languages.applescript = {
|
|
||||||
'comment': [
|
|
||||||
// Allow one level of nesting
|
|
||||||
/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,
|
|
||||||
/--.+/,
|
|
||||||
/#.+/
|
|
||||||
],
|
|
||||||
'string': /"(?:\\?.)*?"/,
|
|
||||||
'number': /\b-?\d*\.?\d+([Ee]-?\d+)?\b/,
|
|
||||||
'operator': [
|
|
||||||
/[&=≠≤≥*+\-\/÷^]|[<>]=?/,
|
|
||||||
/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/
|
|
||||||
],
|
|
||||||
'keyword': /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
|
|
||||||
'class': {
|
|
||||||
pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,
|
|
||||||
alias: 'builtin'
|
|
||||||
},
|
|
||||||
'punctuation': /[{}():,¬«»《》]/
|
|
||||||
};
|
|
|
@ -1 +0,0 @@
|
||||||
Prism.languages.applescript={comment:[/\(\*(?:\(\*[\w\W]*?\*\)|[\w\W])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\?.)*?"/,number:/\b-?\d*\.?\d+([Ee]-?\d+)?\b/,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,"class":{pattern:/\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/,alias:"builtin"},punctuation:/[{}():,¬«»《》]/};
|
|
|
@ -1,271 +0,0 @@
|
||||||
(function (Prism) {
|
|
||||||
|
|
||||||
var attributes = {
|
|
||||||
pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\]\\]|\\.)*\]|[^\]\\]|\\.)*\]/m,
|
|
||||||
lookbehind: true,
|
|
||||||
inside: {
|
|
||||||
'quoted': {
|
|
||||||
pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^[$`]|[$`]$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'interpreted': {
|
|
||||||
pattern: /'(?:[^'\\]|\\.)*'/,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^'|'$/
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'string': /"(?:[^"\\]|\\.)*"/,
|
|
||||||
'variable': /\w+(?==)/,
|
|
||||||
'punctuation': /^\[|\]$|,/,
|
|
||||||
'operator': /=/,
|
|
||||||
// The negative look-ahead prevents blank matches
|
|
||||||
'attr-value': /(?!^\s+$).+/
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Prism.languages.asciidoc = {
|
|
||||||
'comment-block': {
|
|
||||||
pattern: /^(\/{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1/m,
|
|
||||||
alias: 'comment'
|
|
||||||
},
|
|
||||||
'table': {
|
|
||||||
pattern: /^\|={3,}(?:(?:\r?\n|\r).*)*?(?:\r?\n|\r)\|={3,}$/m,
|
|
||||||
inside: {
|
|
||||||
'specifiers': {
|
|
||||||
pattern: /(?!\|)(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*])?(?:[<^>](?:\.[<^>])?|\.[<^>])?[a-z]*)(?=\|)/,
|
|
||||||
alias: 'attr-value'
|
|
||||||
},
|
|
||||||
'punctuation': {
|
|
||||||
pattern: /(^|[^\\])[|!]=*/,
|
|
||||||
lookbehind: true
|
|
||||||
}
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
'passthrough-block': {
|
|
||||||
pattern: /^(\+{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^\++|\++$/
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Literal blocks and listing blocks
|
|
||||||
'literal-block': {
|
|
||||||
pattern: /^(-{4,}|\.{4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Sidebar blocks, quote blocks, example blocks and open blocks
|
|
||||||
'other-block': {
|
|
||||||
pattern: /^(--|\*{4,}|_{4,}|={4,})(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?\1$/m,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// list-punctuation and list-label must appear before indented-block
|
|
||||||
'list-punctuation': {
|
|
||||||
pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,
|
|
||||||
lookbehind: true,
|
|
||||||
alias: 'punctuation'
|
|
||||||
},
|
|
||||||
'list-label': {
|
|
||||||
pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,
|
|
||||||
lookbehind: true,
|
|
||||||
alias: 'symbol'
|
|
||||||
},
|
|
||||||
'indented-block': {
|
|
||||||
pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
|
|
||||||
'comment': /^\/\/.*/m,
|
|
||||||
'title': {
|
|
||||||
pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} +.+|^\.(?![\s.]).*/m,
|
|
||||||
alias: 'important',
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/
|
|
||||||
// See rest below
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'attribute-entry': {
|
|
||||||
pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,
|
|
||||||
alias: 'tag'
|
|
||||||
},
|
|
||||||
'attributes': attributes,
|
|
||||||
'hr': {
|
|
||||||
pattern: /^'{3,}$/m,
|
|
||||||
alias: 'punctuation'
|
|
||||||
},
|
|
||||||
'page-break': {
|
|
||||||
pattern: /^<{3,}$/m,
|
|
||||||
alias: 'punctuation'
|
|
||||||
},
|
|
||||||
'admonition': {
|
|
||||||
pattern: /^(?:TIP|NOTE|IMPORTANT|WARNING|CAUTION):/m,
|
|
||||||
alias: 'keyword'
|
|
||||||
},
|
|
||||||
'callout': [
|
|
||||||
{
|
|
||||||
pattern: /(^[ \t]*)<?\d*>/m,
|
|
||||||
lookbehind: true,
|
|
||||||
alias: 'symbol'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: /<\d+>/,
|
|
||||||
alias: 'symbol'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'macro': {
|
|
||||||
pattern: /\b[a-z\d][a-z\d-]*::?(?:(?:\S+)??\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
|
|
||||||
inside: {
|
|
||||||
'function': /^[a-z\d-]+(?=:)/,
|
|
||||||
'punctuation': /^::?/,
|
|
||||||
'attributes': {
|
|
||||||
pattern: /(?:\[(?:[^\]\\"]|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,
|
|
||||||
inside: attributes.inside
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'inline': {
|
|
||||||
/*
|
|
||||||
The initial look-behind prevents the highlighting of escaped quoted text.
|
|
||||||
|
|
||||||
Quoted text can be multi-line but cannot span an empty line.
|
|
||||||
All quoted text can have attributes before [foobar, 'foobar', baz="bar"].
|
|
||||||
|
|
||||||
First, we handle the constrained quotes.
|
|
||||||
Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char.
|
|
||||||
They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted#
|
|
||||||
|
|
||||||
Then we handle the unconstrained quotes.
|
|
||||||
Those do not have the restrictions of the constrained quotes.
|
|
||||||
They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes))
|
|
||||||
*/
|
|
||||||
pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"]|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?: ['`]|.)+?(?:(?:\r?\n|\r)(?: ['`]|.)+?)*['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"]|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,
|
|
||||||
lookbehind: true,
|
|
||||||
inside: {
|
|
||||||
'attributes': attributes,
|
|
||||||
'url': {
|
|
||||||
pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'attribute-ref': {
|
|
||||||
pattern: /^\{.+\}$/,
|
|
||||||
inside: {
|
|
||||||
'variable': {
|
|
||||||
pattern: /(^\{)[a-z\d,+_-]+/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'operator': /^[=?!#%@$]|!(?=[:}])/,
|
|
||||||
'punctuation': /^\{|\}$|::?/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'italic': {
|
|
||||||
pattern: /^(['_])[\s\S]+\1$/,
|
|
||||||
inside: {
|
|
||||||
'punctuation': /^(?:''?|__?)|(?:''?|__?)$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'bold': {
|
|
||||||
pattern: /^\*[\s\S]+\*$/,
|
|
||||||
inside: {
|
|
||||||
punctuation: /^\*\*?|\*\*?$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'punctuation': /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'replacement': {
|
|
||||||
pattern: /\((?:C|TM|R)\)/,
|
|
||||||
alias: 'builtin'
|
|
||||||
},
|
|
||||||
'entity': /&#?[\da-z]{1,8};/i,
|
|
||||||
'line-continuation': {
|
|
||||||
pattern: /(^| )\+$/m,
|
|
||||||
lookbehind: true,
|
|
||||||
alias: 'punctuation'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Allow some nesting. There is no recursion though, so cloning should not be needed.
|
|
||||||
|
|
||||||
attributes.inside['interpreted'].inside.rest = {
|
|
||||||
'macro': Prism.languages.asciidoc['macro'],
|
|
||||||
'inline': Prism.languages.asciidoc['inline'],
|
|
||||||
'replacement': Prism.languages.asciidoc['replacement'],
|
|
||||||
'entity': Prism.languages.asciidoc['entity']
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.asciidoc['passthrough-block'].inside.rest = {
|
|
||||||
'macro': Prism.languages.asciidoc['macro']
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.asciidoc['literal-block'].inside.rest = {
|
|
||||||
'callout': Prism.languages.asciidoc['callout']
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.asciidoc['table'].inside.rest = {
|
|
||||||
'comment-block': Prism.languages.asciidoc['comment-block'],
|
|
||||||
'passthrough-block': Prism.languages.asciidoc['passthrough-block'],
|
|
||||||
'literal-block': Prism.languages.asciidoc['literal-block'],
|
|
||||||
'other-block': Prism.languages.asciidoc['other-block'],
|
|
||||||
'list-punctuation': Prism.languages.asciidoc['list-punctuation'],
|
|
||||||
'indented-block': Prism.languages.asciidoc['indented-block'],
|
|
||||||
'comment': Prism.languages.asciidoc['comment'],
|
|
||||||
'title': Prism.languages.asciidoc['title'],
|
|
||||||
'attribute-entry': Prism.languages.asciidoc['attribute-entry'],
|
|
||||||
'attributes': Prism.languages.asciidoc['attributes'],
|
|
||||||
'hr': Prism.languages.asciidoc['hr'],
|
|
||||||
'page-break': Prism.languages.asciidoc['page-break'],
|
|
||||||
'admonition': Prism.languages.asciidoc['admonition'],
|
|
||||||
'list-label': Prism.languages.asciidoc['list-label'],
|
|
||||||
'callout': Prism.languages.asciidoc['callout'],
|
|
||||||
'macro': Prism.languages.asciidoc['macro'],
|
|
||||||
'inline': Prism.languages.asciidoc['inline'],
|
|
||||||
'replacement': Prism.languages.asciidoc['replacement'],
|
|
||||||
'entity': Prism.languages.asciidoc['entity'],
|
|
||||||
'line-continuation': Prism.languages.asciidoc['line-continuation']
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.asciidoc['other-block'].inside.rest = {
|
|
||||||
'table': Prism.languages.asciidoc['table'],
|
|
||||||
'list-punctuation': Prism.languages.asciidoc['list-punctuation'],
|
|
||||||
'indented-block': Prism.languages.asciidoc['indented-block'],
|
|
||||||
'comment': Prism.languages.asciidoc['comment'],
|
|
||||||
'attribute-entry': Prism.languages.asciidoc['attribute-entry'],
|
|
||||||
'attributes': Prism.languages.asciidoc['attributes'],
|
|
||||||
'hr': Prism.languages.asciidoc['hr'],
|
|
||||||
'page-break': Prism.languages.asciidoc['page-break'],
|
|
||||||
'admonition': Prism.languages.asciidoc['admonition'],
|
|
||||||
'list-label': Prism.languages.asciidoc['list-label'],
|
|
||||||
'macro': Prism.languages.asciidoc['macro'],
|
|
||||||
'inline': Prism.languages.asciidoc['inline'],
|
|
||||||
'replacement': Prism.languages.asciidoc['replacement'],
|
|
||||||
'entity': Prism.languages.asciidoc['entity'],
|
|
||||||
'line-continuation': Prism.languages.asciidoc['line-continuation']
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.asciidoc['title'].inside.rest = {
|
|
||||||
'macro': Prism.languages.asciidoc['macro'],
|
|
||||||
'inline': Prism.languages.asciidoc['inline'],
|
|
||||||
'replacement': Prism.languages.asciidoc['replacement'],
|
|
||||||
'entity': Prism.languages.asciidoc['entity']
|
|
||||||
};
|
|
||||||
|
|
||||||
// Plugin to make entity title show the real entity, idea by Roman Komarov
|
|
||||||
Prism.hooks.add('wrap', function(env) {
|
|
||||||
if (env.type === 'entity') {
|
|
||||||
env.attributes['title'] = env.content.replace(/&/, '&');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}(Prism));
|
|
File diff suppressed because one or more lines are too long
|
@ -1,36 +0,0 @@
|
||||||
Prism.languages.aspnet = Prism.languages.extend('markup', {
|
|
||||||
'page-directive tag': {
|
|
||||||
pattern: /<%\s*@.*%>/i,
|
|
||||||
inside: {
|
|
||||||
'page-directive tag': /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,
|
|
||||||
rest: Prism.languages.markup.tag.inside
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'directive tag': {
|
|
||||||
pattern: /<%.*%>/i,
|
|
||||||
inside: {
|
|
||||||
'directive tag': /<%\s*?[$=%#:]{0,2}|%>/i,
|
|
||||||
rest: Prism.languages.csharp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// Regexp copied from prism-markup, with a negative look-ahead added
|
|
||||||
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i;
|
|
||||||
|
|
||||||
// match directives of attribute value foo="<% Bar %>"
|
|
||||||
Prism.languages.insertBefore('inside', 'punctuation', {
|
|
||||||
'directive tag': Prism.languages.aspnet['directive tag']
|
|
||||||
}, Prism.languages.aspnet.tag.inside["attr-value"]);
|
|
||||||
|
|
||||||
Prism.languages.insertBefore('aspnet', 'comment', {
|
|
||||||
'asp comment': /<%--[\w\W]*?--%>/
|
|
||||||
});
|
|
||||||
|
|
||||||
// script runat="server" contains csharp, not javascript
|
|
||||||
Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', {
|
|
||||||
'asp script': {
|
|
||||||
pattern: /(<script(?=.*runat=['"]?server['"]?)[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,
|
|
||||||
lookbehind: true,
|
|
||||||
inside: Prism.languages.csharp || {}
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -1 +0,0 @@
|
||||||
Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive tag":{pattern:/<%\s*@.*%>/i,inside:{"page-directive tag":/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,rest:Prism.languages.markup.tag.inside}},"directive tag":{pattern:/<%.*%>/i,inside:{"directive tag":/<%\s*?[$=%#:]{0,2}|%>/i,rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,Prism.languages.insertBefore("inside","punctuation",{"directive tag":Prism.languages.aspnet["directive tag"]},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp comment":/<%--[\w\W]*?--%>/}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp script":{pattern:/(<script(?=.*runat=['"]?server['"]?)[\w\W]*?>)[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.csharp||{}}});
|
|
|
@ -1,27 +0,0 @@
|
||||||
// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
|
|
||||||
Prism.languages.autohotkey= {
|
|
||||||
'comment': {
|
|
||||||
pattern: /(^[^";\n]*("[^"\n]*?"[^"\n]*?)*)(;.*$|^\s*\/\*[\s\S]*\n\*\/)/m,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'string': /"(([^"\n\r]|"")*)"/m,
|
|
||||||
'function': /[^\(\); \t,\n\+\*\-=\?>:\\\/<&%\[\]]+?(?=\()/m, //function - don't use .*\) in the end bcoz string locks it
|
|
||||||
'tag': /^[ \t]*[^\s:]+?(?=:(?:[^:]|$))/m, //labels
|
|
||||||
'variable': /%\w+%/,
|
|
||||||
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
|
|
||||||
'operator': /\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,
|
|
||||||
'punctuation': /[\{}[\]\(\):,]/,
|
|
||||||
'boolean': /\b(true|false)\b/,
|
|
||||||
|
|
||||||
'selector': /\b(AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,
|
|
||||||
|
|
||||||
'constant': /\b(a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\b/i,
|
|
||||||
|
|
||||||
'builtin': /\b(abs|acos|asc|asin|atan|ceil|chr|class|cos|dllcall|exp|fileexist|Fileopen|floor|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|IsObject|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|strsplit|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__New|__Call|__Get|__Set)\b/i,
|
|
||||||
|
|
||||||
'symbol': /\b(alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,
|
|
||||||
|
|
||||||
'important': /#\b(AllowSameLineComments|ClipboardTimeout|CommentFlag|ErrorStdOut|EscapeChar|HotkeyInterval|HotkeyModifierTimeout|Hotstring|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Include|IncludeAgain|InstallKeybdHook|InstallMouseHook|KeyHistory|LTrim|MaxHotkeysPerInterval|MaxMem|MaxThreads|MaxThreadsBuffer|MaxThreadsPerHotkey|NoEnv|NoTrayIcon|Persistent|SingleInstance|UseHook|WinActivateForce)\b/i,
|
|
||||||
|
|
||||||
'keyword': /\b(Abort|AboveNormal|Add|ahk_class|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Region|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|TryAgain|Type|UnCheck|underline|Unicode|Unlock|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i
|
|
||||||
};
|
|
File diff suppressed because one or more lines are too long
|
@ -1,33 +0,0 @@
|
||||||
Prism.languages.autoit = {
|
|
||||||
"comment": [
|
|
||||||
/;.*/,
|
|
||||||
{
|
|
||||||
// The multi-line comments delimiters can actually be commented out with ";"
|
|
||||||
pattern: /(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m,
|
|
||||||
lookbehind: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"url": {
|
|
||||||
pattern: /(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
"string": {
|
|
||||||
pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,
|
|
||||||
inside: {
|
|
||||||
"variable": /([%$@])\w+\1/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"directive": {
|
|
||||||
pattern: /(^\s*)#\w+/m,
|
|
||||||
lookbehind: true,
|
|
||||||
alias: 'keyword'
|
|
||||||
},
|
|
||||||
"function": /\b\w+(?=\()/,
|
|
||||||
// Variables and macros
|
|
||||||
"variable": /[$@]\w+/,
|
|
||||||
"keyword": /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,
|
|
||||||
"number": /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,
|
|
||||||
"boolean": /\b(?:True|False)\b/i,
|
|
||||||
"operator": /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,
|
|
||||||
"punctuation": /[\[\]().,:]/
|
|
||||||
};
|
|
|
@ -1 +0,0 @@
|
||||||
Prism.languages.autoit={comment:[/;.*/,{pattern:/(^\s*)#(?:comments-start|cs)[\s\S]*?^\s*#(?:comments-end|ce)/m,lookbehind:!0}],url:{pattern:/(^\s*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^\s*)#\w+/m,lookbehind:!0,alias:"keyword"},"function":/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,"boolean":/\b(?:True|False)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Or|Not)\b/i,punctuation:/[\[\]().,:]/};
|
|
|
@ -1,80 +0,0 @@
|
||||||
(function(Prism) {
|
|
||||||
var insideString = {
|
|
||||||
variable: [
|
|
||||||
// Arithmetic Environment
|
|
||||||
{
|
|
||||||
pattern: /\$?\(\([\w\W]+?\)\)/,
|
|
||||||
inside: {
|
|
||||||
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
||||||
variable: [{
|
|
||||||
pattern: /(^\$\(\([\w\W]+)\)\)/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
/^\$\(\(/,
|
|
||||||
],
|
|
||||||
number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,
|
|
||||||
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
||||||
operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,
|
|
||||||
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
||||||
punctuation: /\(\(?|\)\)?|,|;/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Command Substitution
|
|
||||||
{
|
|
||||||
pattern: /\$\([^)]+\)|`[^`]+`/,
|
|
||||||
inside: {
|
|
||||||
variable: /^\$\(|^`|\)$|`$/
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
Prism.languages.bash = {
|
|
||||||
'shebang': {
|
|
||||||
pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,
|
|
||||||
alias: 'important'
|
|
||||||
},
|
|
||||||
'comment': {
|
|
||||||
pattern: /(^|[^"{\\])#.*/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'string': [
|
|
||||||
//Support for Here-Documents https://en.wikipedia.org/wiki/Here_document
|
|
||||||
{
|
|
||||||
pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,
|
|
||||||
lookbehind: true,
|
|
||||||
greedy: true,
|
|
||||||
inside: insideString
|
|
||||||
},
|
|
||||||
{
|
|
||||||
pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g,
|
|
||||||
greedy: true,
|
|
||||||
inside: insideString
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'variable': insideString.variable,
|
|
||||||
// Originally based on http://ss64.com/bash/
|
|
||||||
'function': {
|
|
||||||
pattern: /(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'keyword': {
|
|
||||||
pattern: /(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'boolean': {
|
|
||||||
pattern: /(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,
|
|
||||||
lookbehind: true
|
|
||||||
},
|
|
||||||
'operator': /&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,
|
|
||||||
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];]/
|
|
||||||
};
|
|
||||||
|
|
||||||
var inside = insideString.variable[1].inside;
|
|
||||||
inside['function'] = Prism.languages.bash['function'];
|
|
||||||
inside.keyword = Prism.languages.bash.keyword;
|
|
||||||
inside.boolean = Prism.languages.bash.boolean;
|
|
||||||
inside.operator = Prism.languages.bash.operator;
|
|
||||||
inside.punctuation = Prism.languages.bash.punctuation;
|
|
||||||
})(Prism);
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue