-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/unaio/una
- Loading branch information
Showing
17 changed files
with
314 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// https://github.com/ghiculescu/jekyll-table-of-contents | ||
(function($){ | ||
$.fn.toc = function(options) { | ||
var defaults = { | ||
noBackToTopLinks: false, | ||
title: '<i>Jump to...</i>', | ||
minimumHeaders: 3, | ||
headers: 'h1, h2, h3, h4, h5, h6', | ||
listType: 'ol', // values: [ol|ul] | ||
showEffect: 'show', // values: [show|slideDown|fadeIn|none] | ||
showSpeed: 'slow', // set to 0 to deactivate effect | ||
classes: { list: '', | ||
item: '', | ||
link: '' | ||
} | ||
}, | ||
settings = $.extend(defaults, options); | ||
|
||
function fixedEncodeURIComponent (str) { | ||
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) { | ||
return '%' + c.charCodeAt(0).toString(16); | ||
}); | ||
} | ||
|
||
function createLink (header) { | ||
var innerText = (header.textContent === undefined) ? header.innerText : header.textContent; | ||
var href = document.location.href.replace(document.location.hash, ''); | ||
return "<a class='"+settings.classes.link+"' href='" + href + "#" + fixedEncodeURIComponent(header.id) + "'>" + innerText + "</a>"; | ||
} | ||
|
||
var headers = $(settings.headers).filter(function() { | ||
// get all headers with an ID | ||
var previousSiblingName = $(this).prev().attr( "name" ); | ||
if (!this.id && previousSiblingName) { | ||
this.id = $(this).attr( "id", previousSiblingName.replace(/\./g, "-") ); | ||
} | ||
return this.id; | ||
}), output = $(this); | ||
if (!headers.length || headers.length < settings.minimumHeaders || !output.length) { | ||
$(this).hide(); | ||
return; | ||
} | ||
|
||
if (0 === settings.showSpeed) { | ||
settings.showEffect = 'none'; | ||
} | ||
|
||
var render = { | ||
show: function() { output.hide().html(html).show(settings.showSpeed); }, | ||
slideDown: function() { output.hide().html(html).slideDown(settings.showSpeed); }, | ||
fadeIn: function() { output.hide().html(html).fadeIn(settings.showSpeed); }, | ||
none: function() { output.html(html); } | ||
}; | ||
|
||
var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); }; | ||
var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0]; | ||
var return_to_top = '<i class="icon-arrow-up back-to-top"> </i>'; | ||
|
||
var level = get_level(headers[0]), | ||
this_level, | ||
html = settings.title + " <" +settings.listType + " class=\"" + settings.classes.list +"\">"; | ||
headers.on('click', function() { | ||
if (!settings.noBackToTopLinks) { | ||
window.location.hash = this.id; | ||
} | ||
}) | ||
.addClass('clickable-header') | ||
.each(function(_, header) { | ||
this_level = get_level(header); | ||
if (!settings.noBackToTopLinks && this_level === highest_level) { | ||
$(header).addClass('top-level-header').after(return_to_top); | ||
} | ||
if (this_level === level) // same level as before; same indenting | ||
html += "<li class=\"" + settings.classes.item + "\">" + createLink(header); | ||
else if (this_level <= level){ // higher level than before; end parent ol | ||
for(var i = this_level; i < level; i++) { | ||
html += "</li></"+settings.listType+">" | ||
} | ||
html += "<li class=\"" + settings.classes.item + "\">" + createLink(header); | ||
} | ||
else if (this_level > level) { // lower level than before; expand the previous to contain a ol | ||
for(i = this_level; i > level; i--) { | ||
html += "<" + settings.listType + " class=\"" + settings.classes.list +"\">" + | ||
"<li class=\"" + settings.classes.item + "\">" | ||
} | ||
html += createLink(header); | ||
} | ||
level = this_level; // update for the next one | ||
}); | ||
html += "</"+settings.listType+">"; | ||
if (!settings.noBackToTopLinks) { | ||
$(document).on('click', '.back-to-top', function() { | ||
$(window).scrollTop(0); | ||
window.location.hash = ''; | ||
}); | ||
} | ||
|
||
render[settings.showEffect](); | ||
}; | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- layout 1 column with menu on left and contents on right [ start ] --> | ||
<div id="__page_id__" class="bx-layout-wrapper bx-layout-bcb"> | ||
<div class="bx-layout-row flex"> | ||
<div class="bx-layout-col bx-layout-bcb-bar1 bx-layout-column-thin w-1/4"> | ||
<div class="bx-layout-cell pr-2 lg:pr-3" id="bx-layout-cell-1"> | ||
<div class="space-y-2 bx-def-margin-topbottom bx-def-padding-sec bx-def-border"> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-4 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="bx-layout-col bx-layout-bcb-content bx-layout-column-half w-1/2"> | ||
<div class="bx-layout-cell px-2 lg:px-3" id="bx-layout-cell-2"> | ||
__cell_1__ | ||
</div> | ||
</div> | ||
<div class="bx-layout-col bx-layout-bcb-bar2 bx-layout-column-thin w-1/4"> | ||
<div class="bx-layout-cell pl-2 lg:pl-3" id="bx-layout-cell-3"> | ||
<div class="space-y-1 bx-def-margin-topbottom bx-def-padding-sec bx-def-border"> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
<div class="h-3 bg-gray-200 dark:bg-gray-700 rounded-xl"> </div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<bx_include_auto:_row_1_column_dump.html /> | ||
</div> | ||
<!-- layout 1 column with menu on left and contents on right [ end ] --> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.