Added Polymer

This commit is contained in:
Thaum
2014-11-26 10:18:35 +00:00
parent 5eea4714b2
commit 3408ba9e8d
1210 changed files with 394645 additions and 47 deletions

View File

@@ -0,0 +1,19 @@
{
"name": "marked-element",
"private": true,
"dependencies": {
"marked": "*",
"polymer": "Polymer/polymer#^0.5.0"
},
"version": "0.5.1",
"homepage": "https://github.com/PolymerLabs/marked-element",
"_release": "0.5.1",
"_resolution": {
"type": "version",
"tag": "0.5.1",
"commit": "02c950325d999dfce7e84b026d44524116f6b62d"
},
"_source": "git://github.com/PolymerLabs/marked-element.git",
"_target": "^0.5.0",
"_originalSource": "PolymerLabs/marked-element"
}

View File

@@ -0,0 +1,4 @@
marked-element
==============
See the [component page](http://polymer.github.io/marked-element) for more information.

View File

@@ -0,0 +1,9 @@
{
"name": "marked-element",
"private": true,
"dependencies": {
"marked": "*",
"polymer": "Polymer/polymer#^0.5.0"
},
"version": "0.5.1"
}

View File

@@ -0,0 +1,52 @@
<!doctype html>
<!--
Copyright (c) 2014 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>marked-element demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="marked-element.html">
</head>
<body unresolved>
<h3>Inline Text</h3>
<hr>
<marked-element>
## Markdown Renderer
* implemented in `JavaScript`
* realtime formatting
Example:
<div>
<core-overlay>
<h2>Dialog</h2>
<input placeholder="say something..." autofocus>
<div>I agree with this wholeheartedly.</div>
<button core-overlay-toggle>OK</button>
</core-overlay>
</div>
_Nifty_ features.
</marked-element>
<br>
<h3>Text via Attribute</h3>
<hr>
<marked-element text=" <div>div</div>"></marked-element>
</body>
</html>

View File

@@ -0,0 +1,22 @@
<!doctype html>
<!--
Copyright (c) 2014 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>
<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="../core-component-page/core-component-page.html">
</head>
<body unresolved>
<core-component-page></core-component-page>
</body>
</html>

View File

@@ -0,0 +1,52 @@
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="marked-import.html">
<!--
Element wrapper for the `marked` (http://marked.org/) library.
@class marked-element
@blurb Element wrapper for the marked library.
@status alpha
@snap snap.png
-->
<polymer-element name="marked-element" attributes="text">
<script>
Polymer('marked-element', {
text: '',
attached: function() {
marked.setOptions({
highlight: this.highlight.bind(this)
});
if (!this.text) {
this.text = this.innerHTML;
}
},
textChanged: function (oldVal, newVal) {
if (newVal) {
this.innerHTML = marked(this.text);
}
},
highlight: function(code, lang) {
var event = this.fire('marked-js-highlight', {code: code, lang: lang});
return event.detail.code || code;
}
});
</script>
</polymer-element>

View File

@@ -0,0 +1,10 @@
<!--
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<script src='../marked/lib/marked.js'></script>