Socket
Socket
Sign inDemoInstall

live-guide

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

live-guide - npm Package Compare versions

Comparing version 0.8.0 to 0.9.0

assets/css/src/_icon.css

28

assets/js/app.js
(function() {
window.$ = window.$ || function(query) { return [].concat.apply([], document.querySelectorAll(query)); }
window.addEventListener('message', function(event) {

@@ -7,3 +9,29 @@ var element = document.getElementById(event.data.id);

element.style.height = event.data.height + 'px';
if (event.data.height === 0) {
element.className += ' hidden';
element.nextElementSibling.className += ' hidden';
element.nextElementSibling.nextElementSibling.className = element.nextElementSibling.nextElementSibling.className.replace('hidden', '').trim();
}
}, false)
document.addEventListener('DOMContentLoaded', function() {
$('.js-showsource').forEach(function(node) {
/**
* add click listener if iframe is shown
*/
node.addEventListener('click', function(event) {
var code = node.nextElementSibling,
addClass = 'hidden';
if(new RegExp(addClass).test(code.className)) {
code.className = code.className.replace(addClass, '').trim();
node.innerHTML = node.innerHTML.replace('show', 'hide');
} else {
code.className += ' ' + addClass;
node.innerHTML = node.innerHTML.replace('hide', 'show');
}
}, false);
});
});
})();

12

lib/markdown-render/index.js

@@ -32,3 +32,13 @@ 'use strict';

<iframe class="code-sample" id="${frameId}" src="${fileName}"></iframe>
<code language='${language}' class="hljs" >${highlighted}</code>
<button class="btn js-showsource">
<svg viewbox="0 0 32 22" class="icon eye">
<polygon points="0,11 9,2.5 9,19.5" class="lid-shape left" />
<polygon points="32,11 23,2.5 23,19.5" class="lid-shape right" />
<circle r="9" cy="11" cx="16" stroke-width="4" class="outer-eye" />
<circle r="2" cy="11" cx="16" class="inner-eye" />
</svg>
show source
</button>
<code language='${language}' class="hljs hidden" >${highlighted}</code>
</section>`;

@@ -35,0 +45,0 @@

2

package.json
{
"name": "live-guide",
"version": "0.8.0",
"version": "0.9.0",
"description": "Generate style guides based on commented style sheets.",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc