UNPKG

webgme-engine

Version:

WebGME server and Client API without a GUI

13 lines 14.4 kB
/*eslint-disable*/ /* Generated file based on ejs templates */ define([], function() { return { "DiagramDesigner/__ID__Decorator.DiagramDesignerWidget.css.ejs": "/**\r\n * Generated by DecoratorGenerator\r\n */\r\n.<%=id%>-decorator {\r\n min-width: 65px;\r\n height: 40px;\r\n border: 1px solid black;\r\n background-color: #dedede;\r\n padding: 3px;\r\n text-align: center; }\r\n .<%=id%>-decorator .name {\r\n margin-top: 10px;\r\n white-space: nowrap;\r\n font-size: 11px;\r\n font-weight: bold;\r\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\r\n text-align: center; }\r\n .<%=id%>-decorator .connector {\r\n background-color: #fefefe;\r\n height: 14px;\r\n width: 14px;\r\n position: absolute;\r\n cursor: pointer;\r\n border: 1px solid blue;\r\n z-index: 10;\r\n margin-left: -8px;\r\n left: 50%; }\r\n .<%=id%>-decorator .connector:hover {\r\n border-color: rgba(82, 168, 236, 0.8);\r\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n height: 24px;\r\n width: 24px;\r\n margin-left: -12px;\r\n z-index: 12; }\r\n .<%=id%>-decorator .connector:hover.top {\r\n top: -16px; }\r\n .<%=id%>-decorator .connector:hover.bottom {\r\n bottom: -16px; }\r\n .<%=id%>-decorator .connector.top {\r\n top: -8px; }\r\n .<%=id%>-decorator .connector.bottom {\r\n bottom: -8px; }\r\n\r\n.selected .<%=id%>-decorator {\r\n border: 1px solid #52a8ec;\r\n background-color: #dbeafc; }\r\n", "DiagramDesigner/__ID__Decorator.DiagramDesignerWidget.html.ejs": "<div class=\"<%=id%>-decorator\">\r\n <div class=\"name\"></div>\r\n <div class='connector bottom'></div>\r\n <div class='connector top'></div>\r\n</div>", "DiagramDesigner/__ID__Decorator.DiagramDesignerWidget.js.ejs": "/*globals define, _, $*/\r\n\r\n/**\r\n * Generated by DecoratorGenerator\r\n */\r\n\r\ndefine([\r\n 'js/Constants',\r\n 'js/NodePropertyNames',\r\n 'js/Widgets/DiagramDesigner/DiagramDesignerWidget.DecoratorBase',\r\n 'text!./<%=id%>Decorator.DiagramDesignerWidget.html',\r\n 'css!./<%=id%>Decorator.DiagramDesignerWidget.css'\r\n], function (CONSTANTS, nodePropertyNames, DiagramDesignerWidgetDecoratorBase, <%=id%>DecoratorTemplate) {\r\n\r\n 'use strict';\r\n\r\n var DECORATOR_ID = '<%=id%>Decorator';\r\n\r\n function <%=id%>Decorator(options) {\r\n var opts = _.extend({}, options);\r\n\r\n DiagramDesignerWidgetDecoratorBase.apply(this, [opts]);\r\n\r\n this.name = '';\r\n\r\n this.logger.debug('<%=id%>Decorator ctor');\r\n }\r\n\r\n _.extend(<%=id%>Decorator.prototype, DiagramDesignerWidgetDecoratorBase.prototype);\r\n <%=id%>Decorator.prototype.DECORATORID = DECORATOR_ID;\r\n\r\n /*********************** OVERRIDE DiagramDesignerWidgetDecoratorBase MEMBERS **************************/\r\n\r\n <%=id%>Decorator.prototype.$DOMBase = $(<%=id%>DecoratorTemplate);\r\n\r\n <%=id%>Decorator.prototype.on_addTo = function () {\r\n var self = this;\r\n\r\n this._renderName();\r\n\r\n // set title editable on double-click\r\n this.skinParts.$name.on('dblclick.editOnDblClick', null, function (event) {\r\n if (self.hostDesignerItem.canvas.getIsReadOnlyMode() !== true) {\r\n $(this).editInPlace({\r\n class: '',\r\n onChange: function (oldValue, newValue) {\r\n self._onNodeTitleChanged(oldValue, newValue);\r\n }\r\n });\r\n }\r\n event.stopPropagation();\r\n event.preventDefault();\r\n });\r\n\r\n //let the parent decorator class do its job first\r\n DiagramDesignerWidgetDecoratorBase.prototype.on_addTo.apply(this, arguments);\r\n };\r\n\r\n <%=id%>Decorator.prototype._renderName = function () {\r\n var client = this._control._client,\r\n nodeObj = client.getNode(this._metaInfo[CONSTANTS.GME_ID]);\r\n\r\n //render GME-ID in the DOM, for debugging\r\n this.$el.attr({'data-id': this._metaInfo[CONSTANTS.GME_ID]});\r\n\r\n if (nodeObj) {\r\n this.name = nodeObj.getAttribute(nodePropertyNames.Attributes.name) || '';\r\n }\r\n\r\n //find name placeholder\r\n this.skinParts.$name = this.$el.find('.name');\r\n this.skinParts.$name.text(this.name);\r\n };\r\n\r\n <%=id%>Decorator.prototype.update = function () {\r\n var client = this._control._client,\r\n nodeObj = client.getNode(this._metaInfo[CONSTANTS.GME_ID]),\r\n newName = '';\r\n\r\n if (nodeObj) {\r\n newName = nodeObj.getAttribute(nodePropertyNames.Attributes.name) || '';\r\n\r\n if (this.name !== newName) {\r\n this.name = newName;\r\n this.skinParts.$name.text(this.name);\r\n }\r\n }\r\n };\r\n\r\n <%=id%>Decorator.prototype.getConnectionAreas = function (id /*, isEnd, connectionMetaInfo*/) {\r\n var result = [],\r\n edge = 10,\r\n LEN = 20;\r\n\r\n //by default return the bounding box edge's midpoints\r\n\r\n if (id === undefined || id === this.hostDesignerItem.id) {\r\n //NORTH\r\n result.push({\r\n id: '0',\r\n x1: edge,\r\n y1: 0,\r\n x2: this.hostDesignerItem.getWidth() - edge,\r\n y2: 0,\r\n angle1: 270,\r\n angle2: 270,\r\n len: LEN\r\n });\r\n\r\n //EAST\r\n result.push({\r\n id: '1',\r\n x1: this.hostDesignerItem.getWidth(),\r\n y1: edge,\r\n x2: this.hostDesignerItem.getWidth(),\r\n y2: this.hostDesignerItem.getHeight() - edge,\r\n angle1: 0,\r\n angle2: 0,\r\n len: LEN\r\n });\r\n\r\n //SOUTH\r\n result.push({\r\n id: '2',\r\n x1: edge,\r\n y1: this.hostDesignerItem.getHeight(),\r\n x2: this.hostDesignerItem.getWidth() - edge,\r\n y2: this.hostDesignerItem.getHeight(),\r\n angle1: 90,\r\n angle2: 90,\r\n len: LEN\r\n });\r\n\r\n //WEST\r\n result.push({\r\n id: '3',\r\n x1: 0,\r\n y1: edge,\r\n x2: 0,\r\n y2: this.hostDesignerItem.getHeight() - edge,\r\n angle1: 180,\r\n angle2: 180,\r\n len: LEN\r\n });\r\n }\r\n\r\n return result;\r\n };\r\n\r\n /**************** EDIT NODE TITLE ************************/\r\n\r\n <%=id%>Decorator.prototype._onNodeTitleChanged = function (oldValue, newValue) {\r\n var client = this._control._client;\r\n\r\n client.setAttribute(this._metaInfo[CONSTANTS.GME_ID], nodePropertyNames.Attributes.name, newValue);\r\n };\r\n\r\n /**************** END OF - EDIT NODE TITLE ************************/\r\n\r\n <%=id%>Decorator.prototype.doSearch = function (searchDesc) {\r\n var searchText = searchDesc.toString();\r\n if (this.name && this.name.toLowerCase().indexOf(searchText.toLowerCase()) !== -1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n };\r\n\r\n return <%=id%>Decorator;\r\n});\r\n", "DiagramDesigner/__ID__Decorator.DiagramDesignerWidget.scss.ejs": "/**\r\n * Generated by DecoratorGenerator\r\n */\r\n$font_family_1: \"Helvetica Neue\",Helvetica,Arial,sans-serif;\r\n$background_color_1: #dedede;\r\n$background_color_2: #fefefe;\r\n$background_color_3: #dbeafc;\r\n$border_color_1: rgba(82, 168, 236, 0.8);\r\n\r\n.<%=id%>-decorator {\r\n min-width: 65px;\r\n height: 40px;\r\n border: 1px solid black;\r\n background-color: $background_color_1;\r\n padding: 3px;\r\n text-align: center;\r\n .name {\r\n margin-top: 10px;\r\n white-space: nowrap;\r\n font-size: 11px;\r\n font-weight: bold;\r\n font-family: $font_family_1;\r\n text-align: center;\r\n }\r\n .connector {\r\n background-color: $background_color_2;\r\n height: 14px;\r\n width: 14px;\r\n position: absolute;\r\n cursor: pointer;\r\n border: 1px solid blue;\r\n z-index: 10;\r\n margin-left: -8px;\r\n left: 50%;\r\n &:hover {\r\n border-color: $border_color_1;\r\n -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\r\n height: 24px;\r\n width: 24px;\r\n margin-left: -12px;\r\n z-index: 12;\r\n &.top {\r\n top: -16px;\r\n }\r\n &.bottom {\r\n bottom: -16px;\r\n }\r\n }\r\n &.top {\r\n top: -8px;\r\n }\r\n &.bottom {\r\n bottom: -8px;\r\n }\r\n }\r\n}\r\n.selected {\r\n .<%=id%>-decorator {\r\n border: 1px solid #52a8ec;\r\n background-color: $background_color_3;\r\n }\r\n}\r\n\r\n", "PartBrowser/__ID__Decorator.PartBrowserWidget.css.ejs": "/**\r\n * Generated by DecoratorGenerator\r\n */\r\n.part-browser .<%=id%>-decorator .name {\r\n max-width: 150px;\r\n overflow: hidden;\r\n text-overflow: ellipsis; }\r\n", "PartBrowser/__ID__Decorator.PartBrowserWidget.js.ejs": "/*globals define, _, DEBUG, $*/\r\n/*eslint-env browser*/\r\n\r\n/**\r\n * Generated by DecoratorGenerator\r\n */\r\n\r\n\r\ndefine([\r\n 'js/Constants',\r\n 'js/NodePropertyNames',\r\n 'js/Widgets/PartBrowser/PartBrowserWidget.DecoratorBase',\r\n 'js/Widgets/DiagramDesigner/DiagramDesignerWidget.Constants',\r\n 'text!../DiagramDesigner/<%=id%>Decorator.DiagramDesignerWidget.html',\r\n 'css!../DiagramDesigner/<%=id%>Decorator.DiagramDesignerWidget.css',\r\n 'css!./<%=id%>Decorator.PartBrowserWidget.css'\r\n], function (CONSTANTS,\r\n nodePropertyNames,\r\n PartBrowserWidgetDecoratorBase,\r\n DiagramDesignerWidgetConstants,\r\n <%=id%>DecoratorDiagramDesignerWidgetTemplate) {\r\n\r\n 'use strict';\r\n\r\n var DECORATOR_ID = '<%=id%>DecoratorPartBrowserWidget';\r\n\r\n function <%=id%>DecoratorPartBrowserWidget(options) {\r\n var opts = _.extend({}, options);\r\n\r\n PartBrowserWidgetDecoratorBase.apply(this, [opts]);\r\n\r\n this.logger.debug('<%=id%>DecoratorPartBrowserWidget ctor');\r\n }\r\n\r\n _.extend(<%=id%>DecoratorPartBrowserWidget.prototype, PartBrowserWidgetDecoratorBase.prototype);\r\n <%=id%>DecoratorPartBrowserWidget.prototype.DECORATORID = DECORATOR_ID;\r\n\r\n /*********************** OVERRIDE DiagramDesignerWidgetDecoratorBase MEMBERS **************************/\r\n\r\n <%=id%>DecoratorPartBrowserWidget.prototype.$DOMBase = (function () {\r\n var el = $(<%=id%>DecoratorDiagramDesignerWidgetTemplate);\r\n //use the same HTML template as the <%=id%>Decorator.DiagramDesignerWidget\r\n //but remove the connector DOM elements since they are not needed in the PartBrowser\r\n el.find('.' + DiagramDesignerWidgetConstants.CONNECTOR_CLASS).remove();\r\n return el;\r\n })();\r\n\r\n <%=id%>DecoratorPartBrowserWidget.prototype.beforeAppend = function () {\r\n this.$el = this.$DOMBase.clone();\r\n\r\n //find name placeholder\r\n this.skinParts.$name = this.$el.find('.name');\r\n\r\n this._renderContent();\r\n };\r\n\r\n <%=id%>DecoratorPartBrowserWidget.prototype.afterAppend = function () {\r\n };\r\n\r\n <%=id%>DecoratorPartBrowserWidget.prototype._renderContent = function () {\r\n var client = this._control._client,\r\n nodeObj = client.getNode(this._metaInfo[CONSTANTS.GME_ID]);\r\n\r\n //render GME-ID in the DOM, for debugging\r\n if (DEBUG) {\r\n this.$el.attr({'data-id': this._metaInfo[CONSTANTS.GME_ID]});\r\n }\r\n\r\n if (nodeObj) {\r\n this.skinParts.$name.text(nodeObj.getAttribute(nodePropertyNames.Attributes.name) || '');\r\n }\r\n };\r\n\r\n <%=id%>DecoratorPartBrowserWidget.prototype.update = function () {\r\n this._renderContent();\r\n };\r\n\r\n return <%=id%>DecoratorPartBrowserWidget;\r\n});\r\n", "PartBrowser/__ID__Decorator.PartBrowserWidget.scss.ejs": "/**\r\n * Generated by DecoratorGenerator\r\n */\r\n.part-browser {\r\n .<%=id%>-decorator {\r\n .name {\r\n max-width: 150px;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n }\r\n}\r\n", "__ID__Decorator.js.ejs": "/*globals define, _*/\r\n\r\n/**\r\n * Generated by DecoratorGenerator\r\n */\r\n\r\ndefine([\r\n 'js/Decorators/DecoratorBase',\r\n './DiagramDesigner/<%=id%>Decorator.DiagramDesignerWidget',\r\n './PartBrowser/<%=id%>Decorator.PartBrowserWidget'\r\n], function (DecoratorBase, <%=id%>DecoratorDiagramDesignerWidget, <%=id%>DecoratorPartBrowserWidget) {\r\n\r\n 'use strict';\r\n\r\n var DECORATOR_ID = '<%=id%>Decorator';\r\n\r\n function <%=id%>Decorator(params) {\r\n var opts = _.extend({loggerName: this.DECORATORID}, params);\r\n\r\n DecoratorBase.apply(this, [opts]);\r\n\r\n this.logger.debug('<%=id%>Decorator ctor');\r\n }\r\n\r\n _.extend(<%=id%>Decorator.prototype, DecoratorBase.prototype);\r\n <%=id%>Decorator.prototype.DECORATORID = DECORATOR_ID;\r\n\r\n /*********************** OVERRIDE DecoratorBase MEMBERS **************************/\r\n\r\n <%=id%>Decorator.prototype.initializeSupportedWidgetMap = function () {\r\n this.supportedWidgetMap = {\r\n DiagramDesigner: <%=id%>DecoratorDiagramDesignerWidget,\r\n PartBrowser: <%=id%>DecoratorPartBrowserWidget\r\n };\r\n };\r\n\r\n return <%=id%>Decorator;\r\n});\r\n" }});