Skip to content

Commit

Permalink
[Frontend] Refactoring glyphs to classes
Browse files Browse the repository at this point in the history
Fixes #1047
In-progress; plot options, imagery buttons,
cleanups in buttons.scss, edit-action buttons,
.s-btn .no-label class added.
  • Loading branch information
charlesh88 committed Jun 28, 2016
1 parent 8bb8db6 commit 521db3c
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 58 deletions.
5 changes: 4 additions & 1 deletion platform/commonUI/edit/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ define([
"category": "conclude-editing",
"implementation": SaveAction,
"name": "Save",
"cssclass": "icon-save",
"description": "Save changes made to these objects.",
"depends": [
"dialogService"
Expand All @@ -218,7 +219,8 @@ define([
"key": "save",
"category": "conclude-editing",
"implementation": SaveAsAction,
"name": "Save",
"name": "Save As...",
"cssclass": "icon-save",
"description": "Save changes made to these objects.",
"depends": [
"$injector",
Expand All @@ -234,6 +236,7 @@ define([
"category": "conclude-editing",
"implementation": CancelAction,
"name": "Cancel",
"cssclass": "icon-x no-label",
"description": "Discard changes made to these objects.",
"depends": []
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->
<span ng-controller="EditActionController">
<span ng-repeat="currentAction in editActions">
<a class='s-btn t-{{currentAction.getMetadata().key}}'
<a class='s-btn {{currentAction.getMetadata().cssclass}}'
title='{{currentAction.getMetadata().name}}'
ng-click="currentAction.perform()"
ng-class="{ major: $index === 0 }">
Expand Down
43 changes: 11 additions & 32 deletions platform/commonUI/general/res/sass/controls/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ $pad: $interiorMargin * $baseRatio;
vertical-align: top;
@include btnSubtle($colorBtnBg, $colorBtnBgHov, $colorBtnFg, $colorBtnIcon);

&:before {
// Icon when it's included
margin-right: $interiorMarginSm;
}

&.lg {
font-size: 1rem;
}
Expand All @@ -56,45 +61,19 @@ $pad: $interiorMargin * $baseRatio;
@include btnSubtle($bg, $hc, $colorBtnMajorFg, $colorBtnMajorFg);
}

&.t-save {
@extend .icon-save;
}
&.t-save-as:before {
content:'\e612';
font-family: symbolsfont;
margin-right: $interiorMarginSm;
}
&.t-cancel {
@extend .icon-x;
.title-label { display: none; }
&.no-label {
.label, .title-label { display: none; }
}

&.pause-play {
// TO-DO: glyph refactoring
.icon:before {
content: "\0000F1";
}
@extend .icon-pause;
&.paused {
@include btnSubtle($colorPausedBg, pushBack($colorPausedBg, 10%), $colorPausedFg, $colorPausedFg);
.icon {
@include pulse($dur: 1000ms);
:before {
content: "\0000EF";
}
}
@extend .icon-play;
&:before { @include pulse($dur: 1000ms); }
}
}

&.show-thumbs {
.icon:before {
content: "\000039";
}
}

&.t-export {
@extend .icon-download;
}

.icon {
font-size: 0.8rem;
}
Expand All @@ -105,7 +84,7 @@ $pad: $interiorMargin * $baseRatio;
}

.s-icon-btn {
// TO-DO: glyph refactoring
// TODO: glyph refactoring
$c: $colorKey;
@extend .s-btn;
&:before {
Expand Down
2 changes: 1 addition & 1 deletion platform/commonUI/general/res/sass/controls/_menus.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

.menu {
// TO-DO: reduce size of icons
// TODO: reduce size of icons
@extend .s-menu;
display: block;
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions platform/features/imagery/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ define([
"name": "Imagery",
"key": "imagery",
"glyph": "ã",
"cssclass": "icon-image",
"template": imageryTemplate,
"priority": "preferred",
"needs": [
Expand Down
18 changes: 8 additions & 10 deletions platform/features/imagery/res/templates/imagery.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@
<div
class="l-local-controls s-local-controls"
ng-show="false && showLocalControls">
<a class="s-btn"
<a class="s-btn icon-arrow-left"
ng-click="plot.stepBackPanZoom()"
ng-show="1"
title="Restore previous pan/zoom">
<span class="ui-symbol icon">&lt;</span>
</a>

<a class="s-btn"
<a class="s-btn icon-arrows-out"
ng-click="plot.unzoom()"
ng-show="1"
title="Reset pan/zoom">
<span class="ui-symbol icon">I</span>
</a>
</div>

Expand All @@ -27,24 +25,24 @@

<div class="l-image-main-controlbar flex-elem l-flex-row">
<div class="left flex-elem grows">
<a class="s-btn show-thumbs sm hidden"
ng-click="showThumbsBubble = (showThumbsBubble)? false:true"><span class="ui-symbol icon"></span></a>
<a class="s-btn show-thumbs sm hidden icon-thumbs-strip"
ng-click="showThumbsBubble = (showThumbsBubble)? false:true"></a>
<span class="l-timezone">{{imagery.getZone()}}</span>
<span class="l-time">{{imagery.getTime()}}</span>
<span class="l-date">{{imagery.getDate()}}</span>
</div>
<div class="right flex-elem">
<a class="s-btn pause-play"
ng-click="imagery.paused(!imagery.paused())"
ng-class="{ paused: imagery.paused() }"><span class="ui-symbol icon"></span></a>
ng-class="{ paused: imagery.paused() }"></a>
<a href="{{imagery.getImageUrl()}}"
ng-if="imagery.getImageUrl()"
target="_blank"
title="Open image in new tab."
class="s-btn">
<span class="ui-symbol icon">y</span></a>
class="s-btn icon-new-window">
</a>
<a href=""
class="s-btn l-mag s-mag ui-symbol vsm"
class="s-btn l-mag s-mag ui-symbol vsm icon-arrows-out"
ng-click="clipped = false"
ng-show="clipped === true"
title="Not all of image is visible; click to reset."></a>
Expand Down
18 changes: 6 additions & 12 deletions platform/features/plot/res/templates/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,27 @@
<!-- TODO: Move into correct position; make part of group; infer from set of actions -->
<div class="l-local-controls gl-plot-local-controls t-plot-display-controls"
ng-if="$first">
<a class="s-btn"
<a class="s-btn icon-arrow-left"
ng-click="plot.stepBackPanZoom()"
ng-show="plot.isZoomed()"
title="Restore previous pan/zoom">
<span class="ui-symbol icon">&lt;</span>
</a>
<a class="s-btn"
<a class="s-btn icon-arrows-out"
ng-click="plot.unzoom()"
ng-show="plot.isZoomed()"
title="Reset pan/zoom">
<span class="ui-symbol icon">I</span>
</a>
<div class="menu-element s-menu-btn menus-to-left"
<div class="menu-element s-menu-btn menus-to-left {{plot.getMode().cssclass}}"
ng-if="plot.getModeOptions().length > 1"
ng-controller="ClickAwayController as toggle">
<span class="l-click-area" ng-click="toggle.toggle()"></span>
<span class="ui-symbol icon type-icon">{{plot.getMode().glyph}}</span>
<span>{{plot.getMode().name}}</span>
<div class="menu" ng-show="toggle.isActive()">
<ul>
<li ng-repeat="option in plot.getModeOptions()">
<a href="" ng-click="plot.setMode(option); toggle.setState(false)">
<span class="ui-symbol type-icon icon">
{{option.glyph}}
</span>
<li ng-repeat="option in plot.getModeOptions()"
ng-click="plot.setMode(option); toggle.setState(false)"
class="{{option.cssclass}}">
{{option.name}}
</a>
</li>
</ul>
</div>
Expand Down
2 changes: 2 additions & 0 deletions platform/features/plot/src/modes/PlotModeOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ define(
key: "stacked",
name: "Stacked",
glyph: "m",
cssclass: "icon-menu-hamburger",
Constructor: PlotStackMode
},
OVERLAID = {
key: "overlaid",
name: "Overlaid",
glyph: "6",
cssclass: "icon-sine",
Constructor: PlotOverlayMode
};

Expand Down
2 changes: 1 addition & 1 deletion platform/features/table/res/templates/mct-table.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a class="t-btn l-btn s-btn t-export"
<a class="t-btn l-btn s-btn t-export icon-download"
ng-click="exportAsCSV()"
title="Export This View's Data">
Export
Expand Down

0 comments on commit 521db3c

Please sign in to comment.