Skip to content

Commit

Permalink
re-knitted
Browse files Browse the repository at this point in the history
  • Loading branch information
yaojenkuo committed Jan 16, 2017
1 parent 649ea8d commit 48cbf30
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 20 deletions.
27 changes: 14 additions & 13 deletions ch4_exercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@

<meta name="author" content="Yao-Jen Kuo" />

<meta name="date" content="2016-11-29" />
<meta name="date" content="2017-01-16" />

<title>基本資料結構 - 隨堂練習</title>

<script src="ch3_exercise_files/jquery-1.11.3/jquery.min.js"></script>
<script src="ch4_exercise_files/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="ch3_exercise_files/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="ch3_exercise_files/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="ch3_exercise_files/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="ch3_exercise_files/bootstrap-3.3.5/shim/respond.min.js"></script>
<link href="ch4_exercise_files/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<script src="ch4_exercise_files/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="ch4_exercise_files/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="ch4_exercise_files/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="ch4_exercise_files/navigation-1.1/tabsets.js"></script>
<link href="ch4_exercise_files/highlightjs-1.1/default.css" rel="stylesheet" />
<script src="ch4_exercise_files/highlightjs-1.1/highlight.js"></script>

<style type="text/css">code{white-space: pre;}</style>
<link rel="stylesheet"
href="ch3_exercise_files/highlight/default.css"
type="text/css" />
<script src="ch3_exercise_files/highlight/highlight.js"></script>
<style type="text/css">
pre:not([class]) {
background-color: white;
Expand Down Expand Up @@ -101,7 +100,6 @@
<div class="container-fluid main-container">

<!-- tabsets -->
<script src="ch3_exercise_files/navigation-1.1/tabsets.js"></script>
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
Expand All @@ -121,7 +119,7 @@

<h1 class="title toc-ignore">基本資料結構 - 隨堂練習</h1>
<h4 class="author"><em>Yao-Jen Kuo</em></h4>
<h4 class="date"><em>2016-11-29</em></h4>
<h4 class="date"><em>2017-01-16</em></h4>

</div>

Expand Down Expand Up @@ -150,8 +148,11 @@ <h2>草帽海賊團的資料框</h2>
<script>

// add bootstrap table styles to pandoc tables
$(document).ready(function () {
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});


Expand Down
30 changes: 30 additions & 0 deletions ch4_exercise_files/highlightjs-1.1/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
pre .operator,
pre .paren {
color: rgb(104, 118, 135)
}

pre .literal {
color: #990073
}

pre .number {
color: #099;
}

pre .comment {
color: #998;
font-style: italic
}

pre .keyword {
color: #900;
font-weight: bold
}

pre .identifier {
color: rgb(0, 0, 0);
}

pre .string {
color: #d14;
}
3 changes: 3 additions & 0 deletions ch4_exercise_files/highlightjs-1.1/highlight.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions ch4_exercise_files/highlightjs-1.1/textmate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pre .operator,
pre .paren {
color: rgb(104, 118, 135)
}

pre .literal {
color: rgb(88, 72, 246)
}

pre .number {
color: rgb(0, 0, 205);
}

pre .comment {
color: rgb(76, 136, 107);
}

pre .keyword {
color: rgb(0, 0, 255);
}

pre .identifier {
color: rgb(0, 0, 0);
}

pre .string {
color: rgb(3, 106, 7);
}

19 changes: 12 additions & 7 deletions ch4_exercise_files/navigation-1.1/tabsets.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ window.buildTabsets = function(tocID) {
$(tabs[0]).before(tabContent);

// build the tabset
var activeTab = 0;
tabs.each(function(i) {

// get the tab div
Expand All @@ -37,6 +38,10 @@ window.buildTabsets = function(tocID) {
// get the id then sanitize it for use with bootstrap tabs
var id = tab.attr('id');

// see if this is marked as the active tab
if (tab.hasClass('active'))
activeTab = i;

// remove any table of contents entries associated with
// this ID (since we'll be removing the heading element)
$("div#" + tocID + " li a[href='#" + id + "']").parent().remove();
Expand All @@ -56,8 +61,6 @@ window.buildTabsets = function(tocID) {
a.attr('aria-controls', id);
var li = $('<li role="presentation"></li>');
li.append(a);
if (i === 0)
li.attr('class', 'active');
tabList.append(li);

// set it's attributes
Expand All @@ -66,15 +69,17 @@ window.buildTabsets = function(tocID) {
tab.addClass('tabbed-pane');
if (fade)
tab.addClass('fade');
if (i === 0) {
tab.addClass('active');
if (fade)
tab.addClass('in');
}

// move it into the tab content div
tab.detach().appendTo(tabContent);
});

// set active tab
$(tabList.children('li')[activeTab]).addClass('active');
var active = $(tabContent.children('div.section')[activeTab]);
active.addClass('active');
if (fade)
active.addClass('in');
}

// convert section divs with the .tabset class to tabsets
Expand Down

0 comments on commit 48cbf30

Please sign in to comment.