From 94d0600742d0196749b56372d6af29ff1c65a8d4 Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Wed, 25 Jul 2018 19:40:29 -0700 Subject: [PATCH] fix elements --- prism-highlighter.js | 35 +++++++++++++++-------------------- prism-import.js | 20 +++++++------------- prism-theme-default.js | 36 ++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 53 deletions(-) diff --git a/prism-highlighter.js b/prism-highlighter.js index f7eeec2..adf265b 100644 --- a/prism-highlighter.js +++ b/prism-highlighter.js @@ -1,12 +1,20 @@ /** @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 +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 */ +import './prism-import.js'; + +import {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js'; +import {Base} from '@polymer/polymer/polymer-legacy.js'; + +var HIGHLIGHT_EVENT = 'syntax-highlight'; + /** Syntax highlighting via [Prism](http://prismjs.com/). @@ -18,25 +26,13 @@ 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 [``](https://github.com/PolymerElements/marked-element). +This flow is supported by +[``](https://github.com/PolymerElements/marked-element). @element prism-highlighter @demo demo/index.html */ -/* - FIXME(polymer-modulizer): the above comments were extracted - from HTML and may be out of place here. Review them and - then delete this comment! -*/ -import { Base } from '@polymer/polymer/polymer-legacy.js'; - -import './prism-import.js'; -import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js'; - -var HIGHLIGHT_EVENT = 'syntax-highlight'; - Polymer({ - is: 'prism-highlighter', properties: { @@ -132,5 +128,4 @@ Polymer({ return Prism.languages.markup; } }, - }); diff --git a/prism-import.js b/prism-import.js index 1232eda..d97c672 100644 --- a/prism-import.js +++ b/prism-import.js @@ -1,17 +1,11 @@ -import 'prismjs/prism.js'; - /** @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 +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 */ -/* - FIXME(polymer-modulizer): the above comments were extracted - from HTML and may be out of place here. Review them and - then delete this comment! -*/ -; +import 'prismjs/prism.js'; \ No newline at end of file diff --git a/prism-theme-default.js b/prism-theme-default.js index b1e9c72..6db1ebf 100644 --- a/prism-theme-default.js +++ b/prism-theme-default.js @@ -1,7 +1,19 @@ -const $_documentContainer = document.createElement('template'); -$_documentContainer.setAttribute('style', 'display: none;'); +/** +@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 +*/ +import '@polymer/polymer/lib/elements/dom-module.js'; + +import {html} from '@polymer/polymer/lib/utils/html-tag.js'; -$_documentContainer.innerHTML = ` +const template = html` +