Skip to content

Commit

Permalink
fix elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliott Marquez committed Jul 26, 2018
1 parent 3ad7d7c commit 94d0600
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 53 deletions.
35 changes: 15 additions & 20 deletions prism-highlighter.js
Original file line number Diff line number Diff line change
@@ -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/).
Expand All @@ -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 [`<marked-element>`](https://github.com/PolymerElements/marked-element).
This flow is supported by
[`<marked-element>`](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: {
Expand Down Expand Up @@ -132,5 +128,4 @@ Polymer({
return Prism.languages.markup;
}
},

});
20 changes: 7 additions & 13 deletions prism-import.js
Original file line number Diff line number Diff line change
@@ -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';
36 changes: 16 additions & 20 deletions prism-theme-default.js
Original file line number Diff line number Diff line change
@@ -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 = `<dom-module id="prism-theme-default">
const template = html`
<dom-module id="prism-theme-default">
<template>
<style>
/**
Expand Down Expand Up @@ -144,20 +156,4 @@ $_documentContainer.innerHTML = `<dom-module id="prism-theme-default">
</template>
</dom-module>`;

document.head.appendChild($_documentContainer.content);

/**
@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
*/
/*
FIXME(polymer-modulizer): the above comments were extracted
from HTML and may be out of place here. Review them and
then delete this comment!
*/
;
document.head.appendChild(template.content);

0 comments on commit 94d0600

Please sign in to comment.