Lines Matching refs:editor

2  * By Jeremy Dorn - https://github.com/jdorn/json-editor/
255 // Create the root editor
395 if(!classname) throw "Unknown editor for schema "+JSON.stringify(schema);
396 if(!JSONEditor.defaults.editors[classname]) throw "Unknown editor "+classname;
476 registerEditor: function(editor) {
478 this.editors[editor.path] = editor;
481 unregisterEditor: function(editor) {
483 this.editors[editor.path] = null;
1335 onChildEditorChange: function(editor) {
1472 var btnClass = 'json-editor-btn-'+icon;
1569 var val,editor;
1572 editor = self.jsoneditor.getEditor(this.watched[name]);
1573 val = editor? editor.getValue() : null;
2049 // Skip in case the input is only a temporary editor,
2080 // Code editor
2082 // WYSIWYG html and bbcode editor
2099 // Get editor's value
2133 // ACE editor for everything else
2176 // If using SCEditor, destroy the editor instance
2207 // If this editor needs to be rendered by a macro template
2335 var editor = self.editors[key];
2336 if(editor.property_removed) return;
2338 var width = editor.options.hidden? 0 : (editor.options.grid_columns || editor.getNumColumns());
2339 var height = editor.options.hidden? 0 : editor.container.offsetHeight;
2340 // See if the editor will fit in any of the existing rows first
2342 // If the editor will fit in the row horizontally
2344 // If the editor is close to the other elements in height
2345 // i.e. Don't put a really tall editor in an otherwise short row or vice versa
2365 //editor: editor,
2376 // Any left over space goes to the biggest editor
2405 var editor = this.editors[key];
2407 if(editor.options.hidden) editor.container.style.display = 'none';
2408 else this.theme.setGridColumnSize(editor.container,rows[i].editors[j].width);
2409 row.appendChild(editor.container);
2417 var editor = self.editors[key];
2418 if(editor.property_removed) return;
2422 if(editor.options.hidden) editor.container.style.display = 'none';
2423 else self.theme.setGridColumnSize(editor.container,12);
2424 row.appendChild(editor.container);
2473 var editor = self.jsoneditor.getEditorClass(schema);
2474 self.editors[key] = self.jsoneditor.createEditor(editor,{
2530 $each(this.editors, function(key,editor) {
2534 editor.setContainer(holder);
2535 editor.build();
2536 editor.postBuild();
2631 // Container for child editor area
2640 $each(this.editors, function(key,editor) {
2644 editor.setContainer(holder);
2645 editor.build();
2646 editor.postBuild();
2893 var editor = self.jsoneditor.getEditorClass(schema);
2895 self.editors[name] = self.jsoneditor.createEditor(editor,{
2920 onChildEditorChange: function(editor) {
2922 this._super(editor);
3022 // Additional addproperty checkboxes not tied to a current editor
3049 isRequired: function(editor) {
3050 if(typeof editor.schema.required === "boolean") return editor.schema.required;
3051 else if(Array.isArray(this.schema.required)) return this.schema.required.indexOf(editor.key) > -1;
3062 $each(this.cached_editors, function(i,editor) {
3066 editor.setValue(value[i],initial);
3069 else if(!initial && !self.isRequired(editor)) {
3074 editor.setValue(editor.getDefault(),initial);
3092 // Get all the errors that pertain to this editor
3104 // Show errors for this editor
3131 $each(this.editors, function(i,editor) {
3132 editor.showValidationErrors(other_errors);
3256 onChildEditorChange: function(editor) {
3259 this._super(editor);
3320 var editor = this.jsoneditor.getEditorClass(schema);
3335 var ret = this.jsoneditor.createEditor(editor,{
3489 $each(this.rows,function(i,editor) {
3490 // Get the value for this editor
3491 self.value[i] = editor.getValue();
3498 $each(this.rows,function(i,editor) {
3500 if(editor.movedown_button) {
3502 editor.movedown_button.style.display = 'none';
3505 editor.movedown_button.style.display = '';
3510 if(editor.delete_button) {
3512 editor.delete_button.style.display = 'none';
3515 editor.delete_button.style.display = '';
3519 // Get the value for this editor
3520 self.value[i] = editor.getValue();
3735 // Add "new row" and "delete last" buttons below editor
3804 // Get all the errors that pertain to this editor
3816 // Show errors for this editor
3930 onChildEditorChange: function(editor) {
3942 var editor = this.jsoneditor.getEditorClass(schema_copy, this.jsoneditor);
3950 var ret = this.jsoneditor.createEditor(editor,{
4044 $each(this.rows,function(i,editor) {
4046 if(editor.movedown_button) {
4048 editor.movedown_button.style.display = 'none';
4052 editor.movedown_button.style.display = '';
4057 if(editor.delete_button) {
4059 editor.delete_button.style.display = 'none';
4063 editor.delete_button.style.display = '';
4067 if(editor.moveup_button) {
4073 $each(this.rows,function(i,editor) {
4075 editor.controls_cell.style.display = '';
4078 editor.controls_cell.style.display = 'none';
4142 $each(this.rows,function(i,editor) {
4143 // Get the value for this editor
4144 self.value[i] = editor.getValue();
4260 // Add "new row" and "delete last" buttons below editor
4355 $each(self.editors,function(type,editor) {
4356 if(!editor) return;
4358 if(self.keep_values) editor.setValue(current_value,true);
4359 editor.container.style.display = '';
4361 else editor.container.style.display = 'none';
4388 var editor = self.jsoneditor.getEditorClass(schema);
4390 self.editors[i] = self.jsoneditor.createEditor(editor,{
4504 onChildEditorChange: function(editor) {
4540 $each(this.editors, function(type,editor) {
4541 if(editor) editor.destroy();
4552 $each(this.editors,function(i,editor) {
4553 if(!editor) return;
4564 editor.showValidationErrors(new_errors);
4568 $each(this.editors,function(type,editor) {
4569 if(!editor) return;
4570 editor.showValidationErrors(errors);
4855 throw "'select' editor requires the enum property to be set.";
4920 // If this editor uses a dynamic select box
5189 throw "'select' editor requires the enum property to be set.";
5255 // If this editor uses a dynamic select box
5608 if(!window.FileReader) throw "FileReader required for base64 editor";
5703 if(!this.jsoneditor.options.upload) throw "Upload handler required for upload editor";
5949 // Get all the errors that pertain to this editor
5961 // Show errors for this editor
7584 // Default per-editor options
7595 // If the type is set and it's a basic type, use the primitive editor
7611 // Use the multiple editor for schemas where the `type` is set to "any"
7629 // Use the table editor for arrays with the format set to `table`
7636 // Use the `select` editor for dynamic enumSource enums
7651 // Use the 'multiselect' editor for arrays of enumerated strings/numbers/integers
7657 // Use the multiple editor for schemas with `oneOf` set
7679 var editor = this.data('jsoneditor');
7681 if(!editor) throw "Must initialize jsoneditor before getting/setting the value";
7685 editor.setValue(arguments[1]);
7689 return editor.getValue();
7693 if(!editor) throw "Must initialize jsoneditor before validating";
7697 return editor.validate(arguments[1]);
7701 return editor.validate();
7705 if(editor) {
7706 editor.destroy();
7712 if(editor) {
7713 editor.destroy();
7716 // Create editor
7717 editor = new JSONEditor(this.get(0),options);
7718 this.data('jsoneditor',editor);
7721 editor.on('change',function() {
7724 editor.on('ready',function() {