mirror of
https://github.com/hydra-synth/hydra.git
synced 2025-12-20 05:39:58 +01:00
eval line and eval block working
This commit is contained in:
@@ -26038,6 +26038,7 @@ module.exports = function store (state, emitter) {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
emitter.on('editor:randomize', function(evt) {
|
emitter.on('editor:randomize', function(evt) {
|
||||||
const editor = state.editor.editor
|
const editor = state.editor.editor
|
||||||
if (evt.shiftKey) {
|
if (evt.shiftKey) {
|
||||||
@@ -26066,6 +26067,16 @@ module.exports = function store (state, emitter) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
emitter.on('editor:evalLine', (line) => {
|
||||||
|
console.log('EVALUATING', line)
|
||||||
|
repl.eval(line)
|
||||||
|
})
|
||||||
|
|
||||||
|
emitter.on('editor:evalBlock', (block) => {
|
||||||
|
console.log('evaluating block')
|
||||||
|
repl.eval(block)
|
||||||
|
})
|
||||||
|
|
||||||
emitter.on('gallery:shareSketch', function (editor) {
|
emitter.on('gallery:shareSketch', function (editor) {
|
||||||
console.log('waiting to share', state.editor.editor.getValue())
|
console.log('waiting to share', state.editor.editor.getValue())
|
||||||
})
|
})
|
||||||
@@ -26109,8 +26120,8 @@ module.exports = class Editor extends Component {
|
|||||||
|
|
||||||
load (element) {
|
load (element) {
|
||||||
this.editor = new HydraEditor(this.textEl)
|
this.editor = new HydraEditor(this.textEl)
|
||||||
this.editor.on("*", (e, t) => {
|
this.editor.on("*", (e, args) => {
|
||||||
this.emit(e)
|
this.emit(e, args)
|
||||||
})
|
})
|
||||||
// hacky, maybe not necessary
|
// hacky, maybe not necessary
|
||||||
this.innerText = document.getElementsByClassName('CodeMirror')[0]
|
this.innerText = document.getElementsByClassName('CodeMirror')[0]
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ module.exports = function store (state, emitter) {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
emitter.on('editor:randomize', function(evt) {
|
emitter.on('editor:randomize', function(evt) {
|
||||||
const editor = state.editor.editor
|
const editor = state.editor.editor
|
||||||
if (evt.shiftKey) {
|
if (evt.shiftKey) {
|
||||||
@@ -42,6 +43,16 @@ module.exports = function store (state, emitter) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
emitter.on('editor:evalLine', (line) => {
|
||||||
|
console.log('EVALUATING', line)
|
||||||
|
repl.eval(line)
|
||||||
|
})
|
||||||
|
|
||||||
|
emitter.on('editor:evalBlock', (block) => {
|
||||||
|
console.log('evaluating block')
|
||||||
|
repl.eval(block)
|
||||||
|
})
|
||||||
|
|
||||||
emitter.on('gallery:shareSketch', function (editor) {
|
emitter.on('gallery:shareSketch', function (editor) {
|
||||||
console.log('waiting to share', state.editor.editor.getValue())
|
console.log('waiting to share', state.editor.editor.getValue())
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ module.exports = class Editor extends Component {
|
|||||||
|
|
||||||
load (element) {
|
load (element) {
|
||||||
this.editor = new HydraEditor(this.textEl)
|
this.editor = new HydraEditor(this.textEl)
|
||||||
this.editor.on("*", (e, t) => {
|
this.editor.on("*", (e, args) => {
|
||||||
this.emit(e)
|
this.emit(e, args)
|
||||||
})
|
})
|
||||||
// hacky, maybe not necessary
|
// hacky, maybe not necessary
|
||||||
this.innerText = document.getElementsByClassName('CodeMirror')[0]
|
this.innerText = document.getElementsByClassName('CodeMirror')[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user