-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
491 lines (485 loc) · 25.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--
<meta property="og:url" content="" />
<meta property="og:type" content="" />
<meta property="og:image" content="" />
-->
<meta property="og:title" content="NET Collection Interface Interactive Guide" />
<meta property="og:description" content="An interactive guide created for learning collection interfaces in .NET world." />
<title>.Net Collection Interfaces Interactive Guide</title>
<link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAZklEQVR42mNkoBAwDgoDWIC4AYhjgZiPSH2fgHgxSB/IgG4gLsGj+BUQpwPxfyQxOSCuB+L5IAM+ADE/ARt1gfgKmlgCEE9gRDMZF3AA4oNoYvZAfGCYGEBxIFIcjRQnJIrAwBsAAGOrIQvOAF2fAAAAAElFTkSuQmCC" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/[email protected]"></script>
<style>
.navbar-default {
background: transparent;
background-image: none;
border-color: transparent;
box-shadow: none;
}
.menu-button-block {
display: inline-block;
width: 4em;
height: 4em;
margin: 2px;
vertical-align: top;
}
.menu-label-block {
display: inline-block;
width: 14em;
height: 6em;
}
@media (max-width: 767px) { /* mobile only */
.mobile-col-height {
height: 100vh;
}
}
[v-cloak] {
display: none;
}
.fade-enter-active, .fade-leave-active {
transition: opacity .5s
}
.fade-enter, .fade-leave-to {
opacity: 0
}
.slide-fade-enter-active {
transition: all .3s ease;
}
.slide-fade-leave-active {
transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}
.slide-fade-enter, .slide-fade-leave-to {
transform: translateX(10px);
opacity: 0;
}
.flip-list-move {
transition: transform 0.5s;
}
</style>
</head>
<body>
<a href="https://github.com/rvhuang/dotnet-ciig"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<div class="container">
<!-- Modal -->
<div class="modal fade" id="dialogBoxPm" role="dialog" tabindex="-1" aria-labelledby="lablePm">
<div class="modal-dialog" role="document">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="lablePm"><span class="glyphicon glyphicon-exclamation-sign"></span> Why are you here?</h4>
</div>
<div class="modal-body">
<p>We don't think you need the guide.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="dialogBoxFaq" role="dialog" tabindex="-1" aria-labelledby="lableFaq">
<div class="modal-dialog modal-lg" role="document">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="lableFaq"><span class="glyphicon glyphicon-question-sign"></span> FAQ</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" id="dialogBoxFaqBody"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="dialogBoxAbout" role="dialog" tabindex="-1" aria-labelledby="lableAbout">
<div class="modal-dialog" role="document">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="lableAbout"><span class="glyphicon glyphicon-info-sign"></span> About</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" id="dialogBoxAboutBody"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!--Navbar-->
<nav>
<ul class="nav nav-pills navbar-right">
<li><a href="index.html" class="btn-default">Home</a></li>
<li><a href="#dialogBoxFaq" class="btn-default" data-toggle="modal" data-target="#dialogBoxFaq">FAQ</a></li>
<li><a href="#dialogBoxAbout" class="btn-default" data-toggle="modal" data-target="#dialogBoxAbout">About</a></li>
</ul>
</nav>
<div class="page-header">
<h1 class="hidden-xs">.NET Collection Interface Interactive Guide</h1>
<h3 class="visible-xs">.NET Collection Interface Interactive Guide</h3>
<p>An interactive guide created for learning collection interfaces in .NET world.</p>
</div>
<div id="main">
<transition name="fade" mode="out-in" v-on:after-enter="enablePopover">
<div class="row" v-if="currentStep == 0" key="step0">
<div class="col-md-12 text-center">
<p class="lead"> </p>
<p class="lead">There are many collection interfaces in .NET world.<br />Do you know their differences?</p>
<p class="lead">
<button type="button" class="btn btn-default btn-lg" v-on:click="currentStep = 1"><b>Get Started</b></button>
</p>
</div>
</div>
<div class="row" v-if="currentStep == 1" key="step1">
<div class="col-md-12" v-cloak>
<h3>What would you like to do?<br /><small>Please let us know a bit about you...</small></h3>
<br />
<div class="row">
<div class="col-md-3">
<div class="menu-button-block">
<button id="step2Button" type="button" class="btn btn-default btn-lg" v-on:click="restartFlows"><span class="glyphicon glyphicon-pencil"></span></button>
</div>
<div class="menu-label-block">
<label for="step2Button">Answer questions</label>
<p>and let us choose an interface for you</p>
</div>
</div>
<div class="col-md-3">
<div class="menu-button-block">
<button id="step4Button" type="button" class="btn btn-default btn-lg" v-on:click="startCheckList"><span class="glyphicon glyphicon-list"></span></button>
</div>
<div class="menu-label-block">
<label for="step4Button">View our checklist</label>
<p>to compare and browse interfaces</p>
</div>
</div>
<div class="col-md-3">
<div class="menu-button-block">
<button id="step5Button" type="button" class="btn btn-default btn-lg" v-on:click="startComparison"><span class="glyphicon glyphicon-equalizer"></span></button>
</div>
<div class="menu-label-block">
<label for="step5Button">Select and compare</label>
<p>interfaces to see the differences</p>
</div>
</div>
<div class="col-md-3">
<div class="menu-button-block">
<button id="stepXButton" type="button" class="btn btn-danger btn-lg" data-toggle="modal" data-target="#dialogBoxPm"><span class="glyphicon glyphicon-user"></span></button>
</div>
<div class="menu-label-block">
<label for="stepXButton">Learn</label>
<p>how to be a Project Manager</p>
</div>
</div>
</div>
</div>
</div>
<div class="row" v-if="currentStep == 2" key="step2">
<div class="col-md-6" v-cloak>
<h5 v-if="hasNext">Please answer a few of questions below:</h5>
<transition name="slide-fade" v-on:leave="getNextQuestion" v-on:after-enter="enablePopover">
<h3 v-if="show">{{ q.text }}</h3>
</transition>
<form role="form">
<div class="form-group" v-if="q.description != null && q.description.length > 0">
<button type="button" class="btn btn-default btn-xs" data-toggle="popover" data-html="true" v-bind:data-content="marked(q.description, { renderer: markdownRenderer })">...</button>
</div>
<div class="form-group" v-if="hasNext">
<div class="radio">
<label><input type="radio" v-model="answer" v-bind:value="true" />Yes</label>
</div>
<div class="radio">
<label><input type="radio" v-model="answer" v-bind:value="false" />No</label>
</div>
</div>
<div class="form-group"> </div>
<div class="form-group">
<button type="button" class="btn btn-default" v-on:click="currentStep = 1">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
<button type="button" class="btn btn-default" v-on:click="restartFlows" title="Restart">
<span class="glyphicon glyphicon-refresh"></span>
</button>
<button type="button" class="btn btn-default" v-if="hasNext" v-on:click="answerCurrentQuestion" v-bind:disabled="!(hasAnswered && hasNext)" title="Next">
<span class="glyphicon glyphicon-chevron-right"></span>
</button>
</div>
</form>
</div>
<div class="col-md-6" v-cloak>
<question-history :answered-questions="answeredQuestions"></question-history>
</div>
</div>
<div class="row" v-if="currentStep == 3" key="step3">
<div class="col-md-6" v-cloak>
<h5>Based on your answers, the best interface for you is...</h5>
<h3>
{{ interface.typeName }}<br />
<small>{{ interface.namespace }}</small>
</h3><br />
<a v-if="interface != null" v-bind:href="interface.referenceUrl" target="_blank" class="btn btn-default"><span class="glyphicon glyphicon-new-window"></span> Learn more about the interface</a>
<button type="button" class="btn btn-default" v-on:click="restartFlows" title="Restart">
<span class="glyphicon glyphicon-step-backward"></span>
</button>
</div>
<div class="col-md-6" v-cloak>
<question-history :answered-questions="answeredQuestions"></question-history>
<question-skipped :skipped-questions="skippedQuestions" :has-next="hasNext" :interface="interface"></question-skipped>
</div>
</div>
<div class="row" v-if="currentStep == 4" key="step4">
<div class="col-md-2" v-cloak>
<button type="button" class="btn btn-default hidden-xs" v-on:click="currentStep = 1">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
</div>
<div class="col-md-4 mobile-col-height" v-cloak>
<list-header-left caption="Features I want"></list-header-left>
<ul class="list-unstyled">
<li v-for="text in checkList.allQuestionTexts">
<div class="checkbox">
<label><input type="checkbox" v-on:change="checkList.tickQuestion(text)"/>{{ text }}</label>
</div>
</li>
</ul>
</div>
<div class="col-md-4 mobile-col-height" v-cloak>
<list-header-right caption="Interfaces I can use"></list-header-right>
<transition-group name="flip-list" tag="ul" class="list-unstyled">
<li v-for="item in checkList.interfaces" v-bind:key="item.typeName">
<div class="checkbox">
<label v-if="checkList.checkInterfaceAvailability(item.typeName)"><input type="checkbox" checked disabled/>{{ item.typeName }}</label>
<label v-else class="text-muted"><input type="checkbox" disabled/>{{ item.typeName }}</label>
<small><a v-bind:href="item.referenceUrl" target="_blank"><span class="glyphicon glyphicon-new-window"></span></a></small>
</div>
</li>
</transition-group>
</div>
</div>
<div class="row" v-if="currentStep == 5" key="step5">
<div class="col-md-2" v-cloak>
<button type="button" class="btn btn-default hidden-xs" v-on:click="currentStep = 1">
<span class="glyphicon glyphicon-chevron-left"></span>
</button>
</div>
<div class="col-md-4 mobile-col-height" v-cloak>
<list-header-left caption="Interfaces to compare"></list-header-left>
<ul class="list-unstyled">
<li v-for="item in checkList.interfaces">
<div class="checkbox">
<label class="text-muted"><input type="checkbox" v-on:change="checkList.tickInterface(item.typeName)"/>{{ item.typeName }}</label>
<a v-bind:title="item.typeName" v-bind:href="item.referenceUrl" class="btn btn-default btn-xs" target="_blank" style="margin-right: 1px">
<b>{{ item.shortName }}</b>
</a>
</div>
</li>
</ul>
</div>
<div class="col-md-4 mobile-col-height" v-cloak>
<list-header-right caption="Features of interfaces"></list-header-right>
<transition-group name="flip-list" tag="ul" class="list-unstyled">
<li v-for="text in checkList.allQuestionTexts" v-bind:key="text">
<p style="margin: 10px 0px 10px 0px">
<label style="font-weight: 400">{{ text }}</label>
<a v-for="item in checkList.checkQuestionAvailability(text)" v-bind:title="item.typeName" v-bind:href="item.referenceUrl" class="btn btn-default btn-xs" style="margin-right: 1px">
<b>{{ item.shortName }}</b>
</a>
</p>
</li>
</transition-group>
</div>
</div>
</transition>
</div>
</div>
<!-- Template -->
<template id="question-history">
<div>
<h5 v-if="answeredQuestions.length > 0">Your answers:</h5>
<ul>
<li v-for="q in answeredQuestions">
<span>{{ q.text }}</span>
<span v-if="q.yourAnswer == true" class="glyphicon glyphicon-ok" title="Yes"></span>
<span v-if="q.yourAnswer == false" class="glyphicon glyphicon-remove" title="No"></span>
</li>
</ul>
</div>
</template>
<template id="question-skipped">
<div>
<h5 v-if="!hasNext && skippedQuestions.length > 0">Based on your choices, you have implicitly answered following questions:</h5>
<ul>
<li v-for="q in skippedQuestions">
<span>{{ q.text }}</span>
<span v-if="q.answer == true" class="glyphicon glyphicon-ok" title="Yes"></span>
<span v-if="q.answer == false" class="glyphicon glyphicon-remove" title="No"></span>
</li>
</ul>
</div>
</template>
<template id="list-header-left">
<div class="row">
<div class="col-xs-10 col-md-8">
<h4 style="margin: 1.5vh 0vh 1.5vh 0vh;">{{ caption }}</h4>
</div>
<div class="col-xs-2 col-md-4">
<a id="r-select" href="#r-result" class="btn btn-default btn-sm visible-xs" v-on:click="smoothScroll"><span class="glyphicon glyphicon-menu-right"></span></a>
</div>
</div>
</template>
<template id="list-header-right">
<div class="row">
<div class="col-xs-10 col-md-8">
<h4 style="margin: 1.5vh 0vh 1.5vh 0vh;">{{ caption }}</h4>
</div>
<div class="col-xs-2 col-md-4">
<a id="r-result" href="#r-select" class="btn btn-default btn-sm visible-xs" v-on:click="smoothScroll"><span class="glyphicon glyphicon-menu-left"></span></a>
</div>
</div>
</template>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="main.js"></script>
<script>
var renderer = new marked.Renderer();
renderer.link = function (href, title, text) {
return '<a target="_blank" href="' + href + '" title="' + title + '">' + text + '</a>';
};
var smoothScroll = function (ev) {
ev.preventDefault();
var hash = ev.currentTarget.hash;
$('html, body').stop().animate({
scrollTop: $(hash).offset().top - 12
}, 800, function(){
// window.location.hash = hash;
});
};
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
$('#dialogBoxFaq').on('show.bs.modal', function (e) {
if ($('#dialogBoxFaqBody').is(':empty')) {
$.get('docs/faq.md', null, function (data) {
$('#dialogBoxFaqBody').html(marked(data, { renderer: renderer }));
});
}
});
$('#dialogBoxAbout').on('show.bs.modal', function (e) {
if ($('#dialogBoxAboutBody').is(':empty')) {
$.get('docs/about.md', null, function (data) {
$('#dialogBoxAboutBody').html(marked(data, { renderer: renderer }));
});
}
});
});
Vue.component("question-history", {
template: "#question-history",
props: ['answered-questions']
});
Vue.component("question-skipped", {
template: "#question-skipped",
props: ['skipped-questions', 'has-next', 'interface']
});
Vue.component("list-header-left", {
template: "#list-header-left",
props: ['caption'],
methods: {
smoothScroll: smoothScroll
}
});
Vue.component("list-header-right", {
template: "#list-header-right",
props: ['caption'],
methods: {
smoothScroll: smoothScroll
}
});
$.get('questions.json', null, function (questions) {
var flow = Flow.initialize(questions);
var app = new Vue({
el: "#main",
data: {
markdownRenderer: renderer,
currentStep: 0, // remember to change back to 0
questions: questions,
checkList: null, // remember to change back to null
//-------------//
show: true,
q: flow.moveToNextQuestion(),
answer: null,
answeredQuestions: flow.answeredQuestions,
skippedQuestions: flow.skippedQuestions,
interface: null,
hasNext: true
},
methods: {
answerCurrentQuestion: function (ev) {
this.show = false;
flow.answerCurrentQuestion(this.answer);
},
getNextQuestion: function (ev) {
var qNext = flow.moveToNextQuestion();
if (qNext != null) {
this.answer = null;
this.hasNext = true;
this.q = qNext;
} else {
this.hasNext = false;
this.q = null;
this.interface = flow.interfaces[0];
this.currentStep = 3; // here
}
this.show = true;
},
restartFlows: function (ev) {
this.currentStep = 2;
flow = Flow.initialize(this.questions);
//-------------//
this.show = true;
this.q = flow.moveToNextQuestion();
this.answer = null;
this.answeredQuestions = flow.answeredQuestions;
this.skippedQuestions = flow.skippedQuestions;
this.interface = null;
this.hasNext = true;
},
enablePopover: function (ev) {
if (this.currentStep == 2) {
$('[data-toggle="popover"]').popover();
}
},
startCheckList: function (ev) {
if (this.currentStep != 4) {
this.currentStep = 4;
this.checkList = CheckList.initialize(this.questions);
}
},
startComparison: function (ev) {
if (this.currentStep != 5) {
this.currentStep = 5;
this.checkList = CheckList.initialize(this.questions);
}
}
},
computed: {
hasAnswered: function () {
return this.answer != null;
}
}
});
});
</script>
</body>
</html>