Skip to content

Commit 6c597da

Browse files
committed
WMDA Standard displaying in a modal window
1 parent 3233841 commit 6c597da

File tree

4 files changed

+31
-4
lines changed

4 files changed

+31
-4
lines changed

HOntoUML/client/Main.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ gotoSituation s2 msRef = do
110110
highlightAssoc :: OUIdentified ie => ie -> IO JQuery
111111
highlightAssoc ie = getALine ie >>= setAttr "stroke" "red" >>= setAttr "stroke-width" "3"
112112
setStory :: IO JQuery
113-
setStory = selectById "story-ufob" >>= setHtml (ousStory s2)
113+
setStory = selectById "story-ufob" >>= setHtml story
114+
where
115+
story = "<h2>" <> ousName s2 <> "</h2>" <> ousStory s2
114116

115117
-- Resizing --------------------------------------------------------------
116118

web/css/main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ footer {
236236

237237
.diag-ufob {
238238
overflow: scroll;
239-
height: 80%;
239+
height: 100%;
240240
text-align: right;
241241
}
242242

web/index.html

+24-2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@
6969
</button>
7070
</span>
7171
<!-- Controls -->
72+
<span id="standards-btn" class="btn-group btn-group-sm" role="group" style="margin-top: 7px;">
73+
<button type="button" class="btn btn-default" title="Help" data-toggle="modal" data-target="#story-ufob-modal">
74+
<span class="glyphicon glyphicon-book" aria-hidden="false"></span>
75+
</button>
76+
</span>
7277
<span id="controls" class="btn-group btn-group-sm" role="group" style="margin-top: 7px;">
7378
<button type="button" class="btn btn-default" data-toggle="tooltip" title="Resizer left" onclick="Haste['resizeLeft']()">
7479
<span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span>
@@ -93,8 +98,6 @@
9398
<div class="diag-ufob">
9499
<object type='image/svg+xml' id='ufob-svg' data='img/ufob.svg' href='http://caniuse.com/#feat=svg'>Your browser does not support SVG</object>
95100
</div>
96-
<div id="story-ufob" class="story-ufob">
97-
</div>
98101
</div>
99102
<div id="ufoa-inst-box" class="ufoa-inst-box">
100103
<object type='image/svg+xml' id='ufoa-inst-svg' data='img/ufoa&#45;inst.svg' href='http://caniuse.com/#feat=svg'>Your browser does not support SVG</object> -->
@@ -196,6 +199,25 @@ <h2>Contacts</h2>
196199
</table>
197200
</div>
198201

202+
<!-- Story modal -->
203+
<div id="story-ufob-modal" class="modal fade" role="dialog">
204+
<div class="modal-dialog modal-lg">
205+
<!-- Modal content-->
206+
<div class="modal-content">
207+
<div class="modal-header">
208+
<button type="button" class="close" data-dismiss="modal">&times;</button>
209+
<h1 class="modal-title">WMDA Standards</h1>
210+
</div>
211+
<div id="story-ufob" class="modal-body">
212+
Select a situation to display the applicable standards.
213+
</div>
214+
<div class="modal-footer">
215+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
216+
</div>
217+
</div>
218+
</div>
219+
</div>
220+
199221
<!-- Help modal -->
200222
<div id="help-modal" class="modal fade" role="dialog">
201223
<div class="modal-dialog modal-lg">

web/js/controls.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
77
if (target == '#simulation-tab') {
88
$('#controls').css('display', 'inline-block');
99
$('#help-btn').css('display', 'inline-block');
10+
$('#standards-btn').css('display', 'inline-block');
11+
$('#story-ufob').html('Select a situation to display the applicable standards.');
1012
} else {
1113
$('#controls').css('display', 'none');
1214
$('#help-btn').css('display', 'none');
15+
$('#standards-btn').css('display', 'none');
1316
}
1417
currentTab = target;
1518
});

0 commit comments

Comments
 (0)