Comparing version 1.0.5 to 1.0.6
{ | ||
"name": "jupyter.js", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Enables live code blocks in markdown files", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -42,2 +42,3 @@ | ||
code, | ||
els, i, il, | ||
srcEl; | ||
@@ -58,7 +59,8 @@ //console.log(cmd); | ||
case 'init-editors': | ||
document.querySelectorAll('pre > code').forEach(function(item, index) { | ||
if (item.firstChild.innerHTML !== '/* jupyter:active */') return; | ||
els = document.querySelectorAll('pre > code'); | ||
for (i=0, il=els.length; i<il; i++) { | ||
if (els[i].firstChild.innerHTML !== '/* jupyter:active */') return; | ||
var _cm = cm, | ||
language = item.className.split('-')[1], | ||
code = item.textContent.split('\n').slice(1), | ||
language = els[i].className.split('-')[1], | ||
code = els[i].textContent.split('\n').slice(1), | ||
cmOptions = { | ||
@@ -75,8 +77,8 @@ mode: _cm.types[language], | ||
code.unshift(code.pop()); | ||
item.setAttribute('data-editor_index', index); | ||
item.classList.add('active'); | ||
item.innerHTML = '<textarea>'+ code.join('\n') +'</textarea>'+ | ||
els[i].setAttribute('data-editor_index', i); | ||
els[i].classList.add('active'); | ||
els[i].innerHTML = '<textarea>'+ code.join('\n') +'</textarea>'+ | ||
'<div data-cmd="active-play-toggle"></div>'+ | ||
'<sidebar><div class="rows"></div></sidebar>'; | ||
textarea = item.querySelector('textarea'); | ||
textarea = els[i].querySelector('textarea'); | ||
editor = CodeMirror.fromTextArea(textarea, cmOptions); | ||
@@ -95,7 +97,7 @@ /* | ||
*/ | ||
_cm.editors[index] = editor; | ||
_cm.editors[i] = editor; | ||
//if (index === 1) jupyter.sandbox(editor); | ||
//console.log(index, editor.getValue()); | ||
}); | ||
} | ||
break; | ||
@@ -102,0 +104,0 @@ case 'explore-arguments': |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1173629
25
12837
8