Skip to content

Commit 7d69ae4

Browse files
committed
[Frontend] Refactoring glyphs to classes
fixes #1047 In-progress, converting types, mods to Create Menu template
1 parent 18d9f3d commit 7d69ae4

File tree

15 files changed

+30
-27
lines changed

15 files changed

+30
-27
lines changed

example/eventGenerator/bundle.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ define([
5050
"key": "eventGenerator",
5151
"name": "Event Message Generator",
5252
"glyph": "\u0066",
53+
"cssclass": "icon-folder-new",
5354
"description": "For development use. Creates sample event message data that mimics a live data stream.",
5455
"priority": 10,
5556
"features": "creation",

example/generator/bundle.js

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ define([
8787
"key": "generator",
8888
"name": "Sine Wave Generator",
8989
"glyph": "\u0054",
90+
"cssclass": "icon-telemetry",
9091
"description": "For development use. Generates example streaming telemetry data using a simple sine wave algorithm.",
9192
"priority": 10,
9293
"features": "creation",

example/imagery/bundle.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ define([
5050
"key": "imagery",
5151
"name": "Example Imagery",
5252
"glyph": "\u00e3",
53+
"cssclass": "icon-image",
5354
"features": "creation",
5455
"description": "For development use. Creates example imagery data that mimics a live imagery stream.",
5556
"priority": 10,

platform/commonUI/browse/res/templates/items/grid-item.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
<div class='item-main abs lg'>
3030
<span class="t-item-icon" ng-class="{ 'l-icon-link':location.isLink() }">
31-
<span class="t-item-icon-glyph ng-binding">{{type.getGlyph()}}</span>
31+
<span class="t-item-icon-glyph ng-binding {{type.getCssClass()}}"></span>
3232
</span>
3333
<div class='ui-symbol abs item-open'>}</div>
3434
</div>

platform/commonUI/edit/res/templates/create/create-menu.html

+4-11
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,17 @@
2222
<div class="contents" ng-controller="CreateMenuController">
2323
<div class="pane left menu-items">
2424
<ul>
25-
2625
<li ng-repeat="createAction in createActions" ng-click="createAction.perform()">
27-
<a
28-
ng-mouseover="representation.activeMetadata = createAction.getMetadata()"
29-
ng-mouseleave="representation.activeMetadata = undefined">
30-
<span class="ui-symbol icon type-icon">
31-
{{createAction.getMetadata().glyph}}
32-
</span>
26+
<a ng-mouseover="representation.activeMetadata = createAction.getMetadata()"
27+
ng-mouseleave="representation.activeMetadata = undefined"
28+
class="{{ createAction.getMetadata().cssclass }}">
3329
{{createAction.getMetadata().name}}
3430
</a>
3531
</li>
36-
3732
</ul>
3833
</div>
3934
<div class="pane right menu-item-description">
40-
<div class="desc-area ui-symbol icon type-icon">
41-
{{representation.activeMetadata.glyph}}
42-
</div>
35+
<div class="desc-area ui-symbol icon type-icon {{ representation.activeMetadata.cssclass }}"></div>
4336
<div class="desc-area title">
4437
{{representation.activeMetadata.name}}
4538
</div>

platform/commonUI/edit/src/creation/CreateAction.js

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ define(
4848
this.metadata = {
4949
key: 'create',
5050
glyph: type.getGlyph(),
51+
cssclass: type.getCssClass(),
5152
name: type.getName(),
5253
type: type.getKey(),
5354
description: type.getDescription(),

platform/commonUI/general/res/sass/_glyphs.scss

-11
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55
}
66
}
77

8-
//[class*="icon-"]:before {
9-
// font-family: 'symbolsfont';
10-
//}
11-
12-
.ui-symbol,
13-
.icon {
14-
// TO-DO: refactor markup to use "icon-" approach
15-
&.mobile-info { @include glyph('\e920'); }
16-
//&.context-available { @include glyph('\e902'); }
17-
}
18-
198
.icon-alert-rect { @include glyph('\e900'); }
209
.icon-alert-triangle { @include glyph('\e901'); }
2110
.icon-arrow-down { @include glyph('\e902'); }

platform/commonUI/inspect/res/templates/info-button.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
-->
2222

2323
<!--The icon for the info button appearing in a grid item (list in folder)-->
24-
<a class='ui-symbol icon mobile-info'></a>
24+
<a class='ui-symbol icon icon-info'></a>

platform/core/bundle.js

+1
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ define([
264264
"key": "folder",
265265
"name": "Folder",
266266
"glyph": "\u0046",
267+
"cssclass": "icon-folder",
267268
"features": "creation",
268269
"description": "Create folders to organize other objects or links to objects.",
269270
"priority": 1000,

platform/core/src/types/TypeImpl.js

+4
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ define(
148148
return this.typeDef.glyph;
149149
};
150150

151+
TypeImpl.prototype.getCssClass = function () {
152+
return this.typeDef.cssclass;
153+
};
154+
151155
TypeImpl.prototype.getProperties = function () {
152156
return (this.typeDef.properties || []).map(function (propertyDef) {
153157
return new TypeProperty(propertyDef);

platform/features/clock/bundle.js

+2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ define([
156156
"key": "clock",
157157
"name": "Clock",
158158
"glyph": "\u0043",
159+
"cssclass": "icon-clock",
159160
"description": "A UTC-based clock that supports a variety of display formats. Clocks can be added to Display Layouts.",
160161
"priority": 101,
161162
"features": [
@@ -213,6 +214,7 @@ define([
213214
"key": "timer",
214215
"name": "Timer",
215216
"glyph": "\u00f5",
217+
"cssclass": "icon-timer",
216218
"description": "A timer that counts up or down to a datetime. Timers can be started, stopped and reset whenever needed, and support a variety of display formats. Each Timer displays the same value to all users. Timers can be added to Display Layouts.",
217219
"priority": 100,
218220
"features": [

platform/features/layout/bundle.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ define([
5757
"key": "layout",
5858
"name": "Display Layout",
5959
"glyph": "\u004c",
60+
"cssclass": "icon-layout",
6061
"type": "layout",
6162
"template": layoutTemplate,
6263
"editable": true,
@@ -77,7 +78,7 @@ define([
7778
"items": [
7879
{
7980
"method": "add",
80-
"glyph": "\u002b",
81+
"cssclass": "icon-plus",
8182
"control": "menu-button",
8283
"text": "Add",
8384
"options": [
@@ -109,8 +110,7 @@ define([
109110
"items": [
110111
{
111112
"method": "order",
112-
"glyph": "á",
113-
"cssclass": "i-layers",
113+
"cssclass": "icon-layers",
114114
"control": "menu-button",
115115
"options": [
116116
{
@@ -260,6 +260,7 @@ define([
260260
"key": "layout",
261261
"name": "Display Layout",
262262
"glyph": "\u004c",
263+
"cssclass": "icon-layout",
263264
"description": "Assemble other objects and components together into a reusable screen layout. Working in a simple canvas workspace, simply drag in the objects you want, position and size them. Save your design and view or edit it at any time.",
264265
"priority": 900,
265266
"features": "creation",
@@ -292,6 +293,7 @@ define([
292293
"key": "telemetry.panel",
293294
"name": "Telemetry Panel",
294295
"glyph": "t",
296+
"cssclass": "icon-telemetry-panel",
295297
"description": "A panel for collecting telemetry elements.",
296298
"priority": 899,
297299
"delegates": [

platform/features/pages/bundle.js

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ define([
3737
"key": "example.page",
3838
"name": "Web Page",
3939
"glyph": "\u00ea",
40+
"cssclass": "icon-page",
4041
"description": "Embed a web page or web-based image in a resizeable window component. Can be added to Display Layouts. Note that the URL being embedded must allow iframing.",
4142
"priority": 50,
4243
"features": [

platform/features/table/bundle.js

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ define([
6161
"key": "table",
6262
"name": "Historical Telemetry Table",
6363
"glyph": "\ue604",
64+
"cssclass": "icon-tabular",
6465
"description": "A static table of all values over time for all included telemetry elements. Rows are timestamped data values for each telemetry element; columns are data fields. The number of rows is based on the range of your query. New incoming data must be manually re-queried for.",
6566
"priority": 861,
6667
"features": "creation",
@@ -84,6 +85,7 @@ define([
8485
"key": "rttable",
8586
"name": "Real-time Telemetry Table",
8687
"glyph": "\ue620",
88+
"cssclass": "icon-tabular-realtime",
8789
"description": "A scrolling table of latest values for all included telemetry elements. Rows are timestamped data values for each telemetry element; columns are data fields. New incoming data is automatically added to the view.",
8890
"priority": 860,
8991
"features": "creation",

platform/features/timeline/bundle.js

+5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ define([
152152
"key": "timeline",
153153
"name": "Timeline",
154154
"glyph": "\u0053",
155+
"cssclass": "icon-timeline",
155156
"description": "A time-oriented container that lets you enclose and organize other Timelines and Activities. The Timeline view provides both tabular and Gantt views as well as resource utilization graphing of Activities.",
156157
"priority": 502,
157158
"features": [
@@ -195,6 +196,7 @@ define([
195196
"key": "activity",
196197
"name": "Activity",
197198
"glyph": "\u0061",
199+
"cssclass": "icon-activity",
198200
"features": [
199201
"creation"
200202
],
@@ -241,6 +243,7 @@ define([
241243
"key": "mode",
242244
"name": "Activity Mode",
243245
"glyph": "\u0041",
246+
"cssclass": "icon-activity-mode",
244247
"features": [
245248
"creation"
246249
],
@@ -309,11 +312,13 @@ define([
309312
{
310313
"name": "Timeline",
311314
"glyph": "\u0053",
315+
"cssclass": "icon-timeline",
312316
"key": "timeline"
313317
},
314318
{
315319
"name": "Activity",
316320
"glyph": "\u0061",
321+
"cssclass": "icon-activity",
317322
"key": "activity"
318323
}
319324
]

0 commit comments

Comments
 (0)