Skip to content

Commit bb724b7

Browse files
author
Petya Sotirova
committed
Added initial assets and plugins
1 parent b529876 commit bb724b7

31 files changed

+2422
-1173
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.DS_Store
22
_site
3+
.bundle

Gemfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
source 'https://rubygems.org'
1+
source 'http://rubygems.org'
22

33
gem 'uglifier'
44
gem 'jekyll'
55
gem 'jekyll-sitemap'
66
gem 'jekyll-assets'
77
gem 'github-markdown'
8-
gem 'html-pipeline'
8+
gem 'html-pipeline'

Gemfile.lock

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GEM
2-
remote: https://rubygems.org/
2+
remote: http://rubygems.org/
33
specs:
44
activesupport (4.1.1)
55
i18n (~> 0.6, >= 0.6.9)
@@ -20,6 +20,7 @@ GEM
2020
execjs (2.2.0)
2121
fast-stemmer (1.0.2)
2222
ffi (1.9.3)
23+
ffi (1.9.3-x86-mingw32)
2324
github-markdown (0.6.5)
2425
hike (1.2.3)
2526
html-pipeline (1.8.0)
@@ -64,6 +65,8 @@ GEM
6465
multi_json (1.10.1)
6566
nokogiri (1.6.2.1)
6667
mini_portile (= 0.6.0)
68+
nokogiri (1.6.2.1-x86-mingw32)
69+
mini_portile (= 0.6.0)
6770
parslet (1.5.0)
6871
blankslate (~> 2.0)
6972
posix-spawn (0.3.8)
@@ -98,9 +101,11 @@ GEM
98101
execjs (>= 0.3.0)
99102
json (>= 1.8.0)
100103
yajl-ruby (1.1.0)
104+
yajl-ruby (1.1.0-x86-mingw32)
101105

102106
PLATFORMS
103107
ruby
108+
x86-mingw32
104109

105110
DEPENDENCIES
106111
github-markdown
@@ -109,3 +114,6 @@ DEPENDENCIES
109114
jekyll-assets
110115
jekyll-sitemap
111116
uglifier
117+
118+
BUNDLED WITH
119+
1.11.2

LICENSE

-21
This file was deleted.

_assets/javascripts/app.js

+62-44
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@ function expandNavigation(url) {
1414
}
1515

1616
node.set("selected", true);
17+
18+
var navigationElement = $("#page-nav");
19+
navigationElement.scrollTop(0);
20+
var selectedNodeTopOffset = this.findByUid(node.uid).offset().top;
21+
var scrollOffset = localStorage.getItem('ScrollOffset');
22+
if(scrollOffset != null){
23+
navigationElement.scrollTop(selectedNodeTopOffset- parseInt(scrollOffset));
24+
}
25+
else{
26+
navigationElement.scrollTop(selectedNodeTopOffset - navigationElement.height()/2);
27+
}
1728

1829
this.unbind("dataBound", arguments.callee);
1930
}
2031
}
2132

33+
2234
function navigationTemplate(root) {
2335
return function(data) {
2436
var item = data.item;
@@ -45,57 +57,43 @@ function navigationTemplate(root) {
4557
function preventParentSelection(e) {
4658
if (this.dataItem(e.node).hasChildren) {
4759
e.preventDefault();
48-
this.toggle(e.node);
60+
this.toggle(e.node);
4961
}
62+
63+
var offset = $(e.node).offset().top;
64+
localStorage.setItem('ScrollOffset',offset);
5065
}
5166

52-
$(function(){
53-
54-
$("pre[lang]").each(function() {
55-
if (this.parentNode.className.indexOf("k-content") >= 0) {
56-
return;
57-
}
58-
59-
var langs = $(this).nextUntil(":not(pre)", "pre").add(this);
60-
61-
var tabs = $.map(langs, function(item) {
62-
return $("<li>").text($(item).attr("lang"));
63-
});
64-
65-
tabs[0].addClass("k-state-active");
66-
67-
var tabstrip = $("<div>")
68-
.insertBefore(this)
69-
.append($("<ul>").append(tabs))
70-
.append(langs);
71-
72-
langs.wrap("<div>");
73-
74-
tabstrip.kendoTabStrip({
75-
animation: false
76-
});
77-
});
78-
79-
var codeSampleMapper = {
80-
'C#': 'cs',
81-
'VB.NET' : 'vb',
82-
'AppBuilder' : 'js',
83-
'JavaScript' : 'js',
84-
'C++' : 'cpp',
85-
'C' : 'c',
86-
'Objective-C' : 'm',
87-
'Java' : 'java',
88-
}
67+
function onExpand(e) {
68+
var item = this.dataItem(e.node);
69+
70+
if(!item.hasChildren)
71+
{
72+
var elementTop = $(e.node).offset().top;
73+
var treeScrollTop = $("#page-nav").scrollTop();
74+
75+
var treeTop = $("#page-nav").offset().top;
76+
77+
console.log("elementTop " + elementTop);
78+
console.log("treeScrollTop " + treeScrollTop);
79+
console.log("treeTop " + treeTop);
80+
81+
$("#page-nav").animate({
82+
scrollTop: ((treeScrollTop + elementTop) - treeTop) / 2
83+
});
84+
}
85+
}
8986

90-
// Enable prettyprint support. We need to map lang="JavaScript" to class="lang-js" in order to start proper pretty print lexer.
91-
$("pre").each(function(index){
92-
var langExtension = codeSampleMapper[$(this).attr('lang')];
93-
$(this).addClass('lang-' + langExtension).addClass("prettyprint");
94-
});
87+
$(function(){
88+
$("pre").addClass("prettyprint");
9589

9690
prettyPrint();
9791

98-
$("#markdown-toc").each(function() {
92+
$("#markdown-toc")
93+
.on("click", "a", function() {
94+
$(".section > ul").hide();
95+
})
96+
.each(function() {
9997
var ul = $("<ul>");
10098

10199
$("#page-article h2").each(function() {
@@ -134,3 +132,23 @@ $(function(){
134132
ul.appendTo(this);
135133
});
136134
});
135+
136+
$(function(){
137+
$(".toggle-nav").click(function() {
138+
$("#page-search").removeClass("search-visibility");
139+
$("#page-inner-content").removeClass("move-inner-content");
140+
$("#page-nav").toggleClass("nav-visibility");
141+
});
142+
});
143+
144+
$(function(){
145+
$(".show-search").click(function() {
146+
$("#page-nav").removeClass("nav-visibility");
147+
$("#page-search").toggleClass("search-visibility");
148+
$("#page-inner-content").toggleClass("move-inner-content");
149+
});
150+
});
151+
152+
$(function(){
153+
$('#toYear').text((new Date).getFullYear());
154+
});

0 commit comments

Comments
 (0)