e7d554578d
WIP #99 Updated code style violations
49 linhas
1.3 KiB
JavaScript
49 linhas
1.3 KiB
JavaScript
/*globals define */
|
|
/*jshint browser: true*/
|
|
|
|
/**
|
|
* Generated by VisualizerGenerator 1.7.0 from webgme on Wed May 18 2016 12:00:46 GMT-0500 (CDT).
|
|
*/
|
|
|
|
define([
|
|
'widgets/TextEditor/TextEditorWidget',
|
|
'underscore',
|
|
'css!./styles/OperationEditorWidget.css'
|
|
], function (
|
|
TextEditorWidget,
|
|
_
|
|
) {
|
|
'use strict';
|
|
|
|
var OperationEditorWidget;
|
|
//WIDGET_CLASS = 'operation-editor';
|
|
|
|
OperationEditorWidget = function (logger, container) {
|
|
TextEditorWidget.call(this, logger, container);
|
|
};
|
|
|
|
_.extend(OperationEditorWidget.prototype, TextEditorWidget.prototype);
|
|
|
|
OperationEditorWidget.prototype.getHeader = function (desc) {
|
|
// Add comment about the inputs, attributes and references
|
|
var inputs = desc.inputs.map(pair => `-- ${pair[0]} (${pair[1]})`).join('\n'),
|
|
refs = desc.references.map(name => `-- ${name}`).join('\n'),
|
|
header = [
|
|
`-- Editing "${desc.name}"`,
|
|
'-- ',
|
|
'-- Defined variables:'
|
|
];
|
|
|
|
if (inputs) {
|
|
header.push(inputs);
|
|
}
|
|
if (refs) {
|
|
header.push(refs);
|
|
}
|
|
header.push('--');
|
|
return header.join('\n');
|
|
};
|
|
|
|
return OperationEditorWidget;
|
|
});
|