Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createEditorWidget(): CodeEditorWrapper {
let model = new CodeEditor.Model();
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
}
function createEditorWidget(): CodeEditorWrapper {
const model = new CodeEditor.Model();
const factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
}
export function createCellEditor(model?: CodeCellModel): CodeEditorWrapper {
return new CodeEditorWrapper({
model: model || new CodeCellModel({}),
factory: editorFactory
});
}
function createEditorWidget(): CodeEditorWrapper {
const model = new CodeEditor.Model();
const factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
}
function createEditorWidget(): CodeEditorWrapper {
let model = new CodeEditor.Model();
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
}
function createEditorWidget(): CodeEditorWrapper {
let model = new CodeEditor.Model();
let factory = (options: CodeEditor.IOptions) => {
return new CodeMirrorEditor(options);
};
return new CodeEditorWrapper({ factory, model });
}
let cellLoc = (this._cellModel = activeCell.editor.model);
this._valueListener = DatastoreExt.listenField(
{ ...cellLoc.record, field: 'text' },
this._onValueChanged,
this
);
this._mimeTypeListener = DatastoreExt.listenField(
{ ...cellLoc.record, field: 'mimeType' },
this._onMimeTypeChanged,
this
);
this._model.value = activeCell.editor.model.value.split('\n')[0];
this._model.mimeType = activeCell.editor.model.mimeType;
let model = this._model;
let editorWidget = new CodeEditorWrapper({ model, factory });
editorWidget.addClass('jp-InputArea-editor');
editorWidget.addClass('jp-InputArea-editor');
editorWidget.editor.setOption('readOnly', true);
layout.addWidget(prompt);
layout.addWidget(editorWidget);
}
return;
}
let promptNode = activeCell.promptNode
? (activeCell.promptNode.cloneNode(true) as HTMLElement)
: null;
let prompt = new Widget({ node: promptNode });
let factory = activeCell.contentFactory.editorFactory;
let cellModel = (this._cellModel = activeCell.model);
cellModel.value.changed.connect(this._onValueChanged, this);
cellModel.mimeTypeChanged.connect(this._onMimeTypeChanged, this);
this._model.value.text = cellModel.value.text.split('\n')[0];
this._model.mimeType = cellModel.mimeType;
let model = this._model;
let editorWidget = new CodeEditorWrapper({ model, factory });
editorWidget.addClass('jp-InputArea-editor');
editorWidget.addClass('jp-InputArea-editor');
editorWidget.editor.setOption('readOnly', true);
layout.addWidget(prompt);
layout.addWidget(editorWidget);
}
let factory = activeCell.contentFactory.editorFactory;
let cellModel = (this._cellModel = activeCell.model);
cellModel.value.changed.connect(
this._onValueChanged,
this
);
cellModel.mimeTypeChanged.connect(
this._onMimeTypeChanged,
this
);
this._model.value.text = cellModel.value.text.split('\n')[0];
this._model.mimeType = cellModel.mimeType;
let model = this._model;
let editorWidget = new CodeEditorWrapper({ model, factory });
editorWidget.addClass('jp-InputArea-editor');
editorWidget.addClass('jp-InputArea-editor');
editorWidget.editor.setOption('readOnly', true);
layout.addWidget(prompt);
layout.addWidget(editorWidget);
}