Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements in component templates for plugin generators #147

Merged
merged 3 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/client/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ define([

// general notification event
NOTIFICATION: 'NOTIFICATION',
PLUGIN_NOTIFICATION: 'PLUGIN_NOTIFICATION',
CONNECTED_USERS_CHANGED: 'CONNECTED_USERS_CHANGED',

// Constraint Checking
META_RULES_RESULT: 'META_RULES_RESULT',
CONSTRAINT_RESULT: 'CONSTRAINT_RESULT'
};
});
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*globals define, _*/
/**
* Generated by DecoratorGenerator
* This decorator inherits from the ModelDecorator.DiagramDesignerWidget.
* With no changes to the methods - it will functions just like the ModelDecorator.
*
* For more methods see the ModelDecorator.DiagramDesignerWidget.js in the webgme repository.
*
* @author pmeijer / https://github.com/pmeijer
*/

define([
Expand All @@ -21,16 +20,15 @@ define([

'use strict';

var <%=id%>Decorator,
DECORATOR_ID = '<%=id%>Decorator';
var DECORATOR_ID = '<%=id%>Decorator';

<%=id%>Decorator = function (options) {
function <%=id%>Decorator(options) {
var opts = _.extend({}, options);

ModelDecoratorDiagramDesignerWidget.apply(this, [opts]);

this.logger.debug('<%=id%>Decorator ctor');
};
}

<%=id%>Decorator.prototype = Object.create(ModelDecoratorDiagramDesignerWidget.prototype);
<%=id%>Decorator.prototype.constructor = <%=id%>Decorator;
Expand Down Expand Up @@ -60,4 +58,4 @@ define([
};

return <%=id%>Decorator;
});
});
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*globals define, _*/
/**
* Generated by DecoratorGenerator
* This decorator inherits from the ModelDecorator.PartBrowserWidget.
* With no changes to the methods - it will functions just like the ModelDecorator.
*
* For more methods see the ModelDecorator.PartBrowserWidget.js in the webgme repository.
*
* @author pmeijer / https://github.com/pmeijer
*/

define([
Expand All @@ -16,16 +16,15 @@ define([

'use strict';

var <%=id%>DecoratorPartBrowserWidget,
DECORATOR_ID = '<%=id%>DecoratorPartBrowserWidget';
var DECORATOR_ID = '<%=id%>DecoratorPartBrowserWidget';

<%=id%>DecoratorPartBrowserWidget = function (options) {
function <%=id%>DecoratorPartBrowserWidget(options) {
var opts = _.extend({}, options);

ModelDecoratorPartBrowserWidget.apply(this, [opts]);

this.logger.debug('<%=id%>DecoratorPartBrowserWidget ctor');
};
}

_.extend(<%=id%>DecoratorPartBrowserWidget.prototype, ModelDecoratorPartBrowserWidget.prototype);
<%=id%>DecoratorPartBrowserWidget.prototype.DECORATORID = DECORATOR_ID;
Expand All @@ -45,4 +44,4 @@ define([
};

return <%=id%>DecoratorPartBrowserWidget;
});
});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*globals define, _*/
/**
* @author pmeijer / https://github.com/pmeijer
* Generated by DecoratorGenerator
*/

define([
Expand All @@ -11,16 +11,15 @@ define([

'use strict';

var <%=id%>Decorator,
DECORATOR_ID = '<%=id%>Decorator';
var DECORATOR_ID = '<%=id%>Decorator';

<%=id%>Decorator = function (params) {
function <%=id%>Decorator(params) {
var opts = _.extend({loggerName: this.DECORATORID}, params);

DecoratorBase.apply(this, [opts]);

this.logger.debug('<%=id%>Decorator ctor');
};
}

_.extend(<%=id%>Decorator.prototype, DecoratorBase.prototype);
<%=id%>Decorator.prototype.DECORATORID = DECORATOR_ID;
Expand All @@ -35,4 +34,4 @@ define([
};

return <%=id%>Decorator;
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author rkereskenyi / https://github.com/rkereskenyi
* Generated by DecoratorGenerator
*/
.<%=id%>-decorator {
min-width: 65px;
Expand All @@ -13,27 +13,35 @@
white-space: nowrap;
font-size: 11px;
font-weight: bold;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center; }
.<%=id%>-decorator .connector {
background-color: #fefefe;
height: 10px;
width: 10px;
height: 14px;
width: 14px;
position: absolute;
cursor: pointer;
border: 1px solid blue;
z-index: 10;
margin-left: -6px;
margin-left: -8px;
left: 50%; }
.<%=id%>-decorator .connector:hover {
border-color: rgba(82, 168, 236, 0.8);
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6); }
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
height: 24px;
width: 24px;
margin-left: -12px;
z-index: 12; }
.<%=id%>-decorator .connector:hover.top {
top: -16px; }
.<%=id%>-decorator .connector:hover.bottom {
bottom: -16px; }
.<%=id%>-decorator .connector.top {
top: -6px; }
top: -8px; }
.<%=id%>-decorator .connector.bottom {
bottom: -6px; }
bottom: -8px; }

.selected .<%=id%>-decorator {
border: 1px solid #52a8ec;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*globals define, _, $*/

/**
* @author rkereskenyi / https://github.com/rkereskenyi
* Generated by DecoratorGenerator
*/

define([
Expand All @@ -14,22 +14,19 @@ define([

'use strict';

var <%=id%>Decorator,
__parent__ = DiagramDesignerWidgetDecoratorBase,
__parent_proto__ = DiagramDesignerWidgetDecoratorBase.prototype,
DECORATOR_ID = '<%=id%>Decorator';
var DECORATOR_ID = '<%=id%>Decorator';

<%=id%>Decorator = function (options) {
function <%=id%>Decorator(options) {
var opts = _.extend({}, options);

__parent__.apply(this, [opts]);
DiagramDesignerWidgetDecoratorBase.apply(this, [opts]);

this.name = '';

this.logger.debug('<%=id%>Decorator ctor');
};
}

_.extend(<%=id%>Decorator.prototype, __parent_proto__);
_.extend(<%=id%>Decorator.prototype, DiagramDesignerWidgetDecoratorBase.prototype);
<%=id%>Decorator.prototype.DECORATORID = DECORATOR_ID;

/*********************** OVERRIDE DiagramDesignerWidgetDecoratorBase MEMBERS **************************/
Expand All @@ -56,7 +53,7 @@ define([
});

//let the parent decorator class do its job first
__parent_proto__.on_addTo.apply(this, arguments);
DiagramDesignerWidgetDecoratorBase.prototype.on_addTo.apply(this, arguments);
};

<%=id%>Decorator.prototype._renderName = function () {
Expand Down Expand Up @@ -170,4 +167,4 @@ define([
};

return <%=id%>Decorator;
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Generated by DecoratorGenerator
*/
$font_family_1: "Helvetica Neue",Helvetica,Arial,sans-serif;
$background_color_1: #dedede;
$background_color_2: #fefefe;
$background_color_3: #dbeafc;
$border_color_1: rgba(82, 168, 236, 0.8);

.<%=id%>-decorator {
min-width: 65px;
height: 40px;
border: 1px solid black;
background-color: $background_color_1;
padding: 3px;
text-align: center;
.name {
margin-top: 10px;
white-space: nowrap;
font-size: 11px;
font-weight: bold;
font-family: $font_family_1;
text-align: center;
}
.connector {
background-color: $background_color_2;
height: 14px;
width: 14px;
position: absolute;
cursor: pointer;
border: 1px solid blue;
z-index: 10;
margin-left: -8px;
left: 50%;
&:hover {
border-color: $border_color_1;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
height: 24px;
width: 24px;
margin-left: -12px;
z-index: 12;
&.top {
top: -16px;
}
&.bottom {
bottom: -16px;
}
}
&.top {
top: -8px;
}
&.bottom {
bottom: -8px;
}
}
}
.selected {
.<%=id%>-decorator {
border: 1px solid #52a8ec;
background-color: $background_color_3;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author rkereskenyi / https://github.com/rkereskenyi
* Generated by DecoratorGenerator
*/
.part-browser .<%=id%>-decorator .name {
max-width: 150px;
Expand Down
Loading