mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 13:12:41 +00:00
Update Daux and manual theme
This commit is contained in:
parent
ca49785f6f
commit
06b9049515
7 changed files with 168 additions and 95 deletions
|
@ -272,15 +272,15 @@ class RoboFile extends \Robo\Tasks {
|
|||
* This requires Node and Yarn to be installed.
|
||||
*/
|
||||
public function manualCss(): Result {
|
||||
$postcss = escapeshellarg(realpath(self::BASE."node_modules/.bin/postcss"));
|
||||
$themesrc = realpath(self::BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
|
||||
$themeout = realpath(self::BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
|
||||
// start a collection; this stops after the first failure
|
||||
$t = $this->collectionBuilder();
|
||||
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
|
||||
// install dependencies via Yarn
|
||||
$t->taskExec("yarn install");
|
||||
// compile the stylesheet
|
||||
$postcss = escapeshellarg(realpath(self::BASE."node_modules/.bin/postcss"));
|
||||
$themesrc = realpath(self::BASE."docs/theme/src/").\DIRECTORY_SEPARATOR;
|
||||
$themeout = realpath(self::BASE."docs/theme/arsse/").\DIRECTORY_SEPARATOR;
|
||||
$t->taskExec($postcss)->arg($themesrc."arsse.scss")->option("-o", $themeout."arsse.css");
|
||||
// execute the collection
|
||||
return $t->run();
|
||||
|
|
2
docs/theme/arsse/arsse.css
vendored
2
docs/theme/arsse/arsse.css
vendored
File diff suppressed because one or more lines are too long
1
docs/theme/arsse/config.json
vendored
1
docs/theme/arsse/config.json
vendored
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
"favicon": "<theme_url>favicon.png",
|
||||
"js": [
|
||||
"<theme_url>jquery.min.js",
|
||||
"<theme_url>highlight.pack.js",
|
||||
"<theme_url>daux.js"
|
||||
],
|
||||
|
|
225
docs/theme/arsse/daux.js
vendored
225
docs/theme/arsse/daux.js
vendored
|
@ -4,103 +4,186 @@ if (hljs) {
|
|||
hljs.initHighlightingOnLoad();
|
||||
}
|
||||
|
||||
//Initialize CodeBlock Visibility Settings
|
||||
$(function () {
|
||||
var codeBlockView = $('.Columns__right'),
|
||||
codeBlocks = $('.s-content pre'),
|
||||
toggleCodeSection = $('.CodeToggler'),
|
||||
toggleCodeBlockBtns = toggleCodeSection.find('.CodeToggler__button'),
|
||||
toggleCodeBlockBtn = toggleCodeSection.find('.CodeToggler__button--main'),
|
||||
toggleCodeBlockBtnHide = toggleCodeSection.find('.CodeToggler__button--hide'),
|
||||
toggleCodeBlockBtnBelow = toggleCodeSection.find('.CodeToggler__button--below'),
|
||||
toggleCodeBlockBtnFloat = toggleCodeSection.find('.CodeToggler__button--float');
|
||||
|
||||
// If there is no code block we hide the link
|
||||
if (!codeBlocks.size()) {
|
||||
toggleCodeSection.addClass('Hidden');
|
||||
(function() {
|
||||
var codeBlocks = document.querySelectorAll(".s-content pre");
|
||||
var toggleCodeSection = document.querySelector(".CodeToggler");
|
||||
if (!toggleCodeSection) {
|
||||
return;
|
||||
} else if (!codeBlocks.length) {
|
||||
toggleCodeSection.classList.add("Hidden");
|
||||
return;
|
||||
}
|
||||
|
||||
var toggleCodeBlockBtnList = toggleCodeSection.querySelectorAll(".CodeToggler__button");
|
||||
var toggleCodeBlockBtnSet = toggleCodeSection.querySelector(".CodeToggler__button--main"); // available when floating is disabled
|
||||
var toggleCodeBlockBtnHide = toggleCodeSection.querySelector(".CodeToggler__button--hide");
|
||||
var toggleCodeBlockBtnBelow = toggleCodeSection.querySelector(".CodeToggler__button--below");
|
||||
var toggleCodeBlockBtnFloat = toggleCodeSection.querySelector(".CodeToggler__button--float");
|
||||
var codeBlockView = document.querySelector(".Columns__right");
|
||||
var floating = document.body.classList.contains("with-float");
|
||||
|
||||
function setCodeBlockStyle(codeBlockState) {
|
||||
try {
|
||||
localStorage.setItem("codeBlockState", codeBlockState);
|
||||
} catch (e) {
|
||||
// local storage operations can fail with the file:// protocol
|
||||
for (var a = 0; a < toggleCodeBlockBtnList.length; a++) {
|
||||
toggleCodeBlockBtnList[a].classList.remove("Button--active");
|
||||
}
|
||||
|
||||
toggleCodeBlockBtns.removeClass("Button--active");
|
||||
|
||||
switch (codeBlockState) {
|
||||
case 2: // Show code blocks inline
|
||||
toggleCodeBlockBtnFloat.addClass("Button--active");
|
||||
codeBlockView.addClass('Columns__right--float');
|
||||
codeBlockView.removeClass('Columns__right--full');
|
||||
codeBlocks.removeClass('Hidden');
|
||||
case true: // Show code blocks below (flowed); checkbox
|
||||
var hidden = false;
|
||||
break;
|
||||
case 1: // Show code blocks below
|
||||
toggleCodeBlockBtnBelow.addClass("Button--active");
|
||||
toggleCodeBlockBtn.prop('checked', true);
|
||||
codeBlockView.removeClass('Columns__right--float');
|
||||
codeBlockView.addClass('Columns__right--full');
|
||||
codeBlocks.removeClass('Hidden');
|
||||
case false: // Hidden code blocks; checkbox
|
||||
var hidden = true;
|
||||
break;
|
||||
case 2: // Show code blocks inline (floated)
|
||||
toggleCodeBlockBtnFloat.classList.add("Button--active");
|
||||
codeBlockView.classList.add("Columns__right--float");
|
||||
codeBlockView.classList.remove("Columns__right--full");
|
||||
var hidden = false;
|
||||
break;
|
||||
case 1: // Show code blocks below (flowed)
|
||||
case "checked":
|
||||
toggleCodeBlockBtnBelow.classList.add("Button--active");
|
||||
codeBlockView.classList.remove("Columns__right--float");
|
||||
codeBlockView.classList.add("Columns__right--full");
|
||||
var hidden = false;
|
||||
break;
|
||||
case 0: // Hidden code blocks
|
||||
default:
|
||||
toggleCodeBlockBtnHide.addClass("Button--active");
|
||||
toggleCodeBlockBtn.prop('checked', false);
|
||||
codeBlockView.removeClass('Columns__right--float');
|
||||
codeBlockView.addClass('Columns__right--full');
|
||||
codeBlocks.addClass('Hidden');
|
||||
toggleCodeBlockBtnHide.classList.add("Button--active");
|
||||
codeBlockView.classList.remove("Columns__right--float");
|
||||
codeBlockView.classList.add("Columns__right--full");
|
||||
var hidden = true;
|
||||
break;
|
||||
}
|
||||
for (var a = 0; a < codeBlocks.length; a++) {
|
||||
if (hidden) {
|
||||
codeBlocks[a].classList.add("Hidden");
|
||||
} else {
|
||||
codeBlocks[a].classList.remove("Hidden");
|
||||
}
|
||||
}
|
||||
try {
|
||||
localStorage.setItem("codeBlockState", +codeBlockState);
|
||||
} catch (e) {
|
||||
// local storage operations can fail with the file:// protocol
|
||||
}
|
||||
}
|
||||
if (!floating) {
|
||||
toggleCodeBlockBtnSet.addEventListener("change", function(ev) {setCodeBlockStyle(ev.target.checked);}, false);
|
||||
} else {
|
||||
toggleCodeBlockBtnHide.addEventListener("click", function() {setCodeBlockStyle(0);}, false);
|
||||
toggleCodeBlockBtnBelow.addEventListener("click", function() {setCodeBlockStyle(1);}, false);
|
||||
toggleCodeBlockBtnFloat.addEventListener("click", function() {setCodeBlockStyle(2);}, false);
|
||||
}
|
||||
|
||||
toggleCodeBlockBtn.click(function() {
|
||||
setCodeBlockStyle(codeBlocks.hasClass('Hidden') ? 1 : 0);
|
||||
});
|
||||
|
||||
toggleCodeBlockBtnHide.click(function() { setCodeBlockStyle(0); });
|
||||
toggleCodeBlockBtnBelow.click(function() { setCodeBlockStyle(1); });
|
||||
toggleCodeBlockBtnFloat.click(function() { setCodeBlockStyle(2); });
|
||||
|
||||
var floating = $(document.body).hasClass("with-float");
|
||||
try {
|
||||
var codeBlockState = localStorage.getItem("codeBlockState");
|
||||
} catch (e) {
|
||||
// local storage operations can fail with the file:// protocol
|
||||
var codeBlockState = false;
|
||||
var codeBlockState = null;
|
||||
}
|
||||
|
||||
if (!codeBlockState) {
|
||||
codeBlockState = floating? 2 : 1;
|
||||
codeBlockState = floating ? 2 : 1;
|
||||
} else {
|
||||
codeBlockState = parseInt(codeBlockState);
|
||||
}
|
||||
|
||||
if (!floating && codeBlockState == 2) {
|
||||
codeBlockState = 1;
|
||||
if (!floating) {
|
||||
codeBlockState = !!codeBlockState;
|
||||
}
|
||||
|
||||
setCodeBlockStyle(codeBlockState);
|
||||
});
|
||||
})();
|
||||
|
||||
(function() {
|
||||
function debounce(func, wait) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this, args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
};
|
||||
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
var navItems = document.querySelectorAll('.Nav__item.has-children > a');
|
||||
|
||||
function _toggleSubMenu(ev) {
|
||||
if (ev.preventDefault !== undefined) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
var parent = ev.target.parentNode;
|
||||
var subNav = parent.querySelector('ul.Nav');
|
||||
|
||||
if (ev.preventDefault !== undefined && parent.classList.contains('Nav__item--open')) {
|
||||
subNav.style.height = 0;
|
||||
parent.classList.remove('Nav__item--open');
|
||||
} else {
|
||||
if (ev.preventDefault !== undefined) {
|
||||
subNav.style.transitionDuration = Math.max(subNav.scrollHeight, 150) + 'ms';
|
||||
subNav.style.height = subNav.scrollHeight + 'px';
|
||||
parent.classList.add('Nav__item--open');
|
||||
} else {
|
||||
// When running at page load the transitions don't need to fire and
|
||||
// the classList doesn't need to be altered.
|
||||
subNav.style.transitionDuration = '0ms';
|
||||
subNav.style.height = subNav.scrollHeight + 'px';
|
||||
subNav.style.transitionDuration = Math.max(subNav.scrollHeight, 150) + 'ms';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Because font sizes change the height of the menus can change so they must
|
||||
// be recalculated if necessary when the viewport size changes.
|
||||
function _resize() {
|
||||
var subNav = document.querySelector('.Nav .Nav'),
|
||||
height, cur;
|
||||
for (var i = 0; i < subNav.length; i++) {
|
||||
cur = subNav[i];
|
||||
height = parseFloat(cur.style.height, 10);
|
||||
if (height > 0 && cur.scrollHeight !== height) {
|
||||
// Transitions don't need to fire when resizing the window.
|
||||
cur.style.transitionDuration = '0ms';
|
||||
cur.style.height = cur.scrollHeight + 'px';
|
||||
cur.style.transitionDuration = Math.max(cur.scrollHeight, 150) + 'ms';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0, cur; i < navItems.length; i++) {
|
||||
cur = navItems[i];
|
||||
cur.addEventListener('click', _toggleSubMenu);
|
||||
|
||||
if (cur.parentNode.classList.contains('Nav__item--open')) {
|
||||
_toggleSubMenu({ target: cur });
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('resize', debounce(_resize, 150));
|
||||
window.addEventListener('orientationchange', _resize);
|
||||
|
||||
|
||||
$(function () {
|
||||
// Tree navigation
|
||||
$('.aj-nav').click(function (e) {
|
||||
e.preventDefault();
|
||||
$(this).parent().siblings().find('ul').slideUp();
|
||||
$(this).next().slideToggle();
|
||||
})();
|
||||
|
||||
(function() {
|
||||
var trigger = document.querySelector('.Collapsible__trigger');
|
||||
|
||||
if (!trigger) {
|
||||
return;
|
||||
}
|
||||
|
||||
content = document.querySelector('.Collapsible__content');
|
||||
|
||||
trigger.addEventListener('click', function(ev) {
|
||||
if (content.classList.contains('Collapsible__content--open')) {
|
||||
content.style.height = 0;
|
||||
content.classList.remove('Collapsible__content--open');
|
||||
} else {
|
||||
content.style.transitionDuration = Math.max(content.scrollHeight, 150) + 'ms';
|
||||
content.style.height = content.scrollHeight + 'px';
|
||||
content.classList.add('Collapsible__content--open');
|
||||
}
|
||||
});
|
||||
|
||||
// New Tree navigation
|
||||
$('ul.Nav > li.has-children > a > .Nav__arrow').click(function() {
|
||||
$(this).parent().parent().toggleClass('Nav__item--open');
|
||||
return false;
|
||||
});
|
||||
|
||||
// Responsive navigation
|
||||
$('.Collapsible__trigger').click(function () {
|
||||
$('.Collapsible__content').slideToggle();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
5
docs/theme/arsse/jquery.min.js
vendored
5
docs/theme/arsse/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
4
docs/theme/daux/js/html5shiv-3.7.3.min.js
vendored
4
docs/theme/daux/js/html5shiv-3.7.3.min.js
vendored
|
@ -1,4 +0,0 @@
|
|||
/**
|
||||
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
|
20
vendor-bin/daux/composer.lock
generated
20
vendor-bin/daux/composer.lock
generated
|
@ -8,16 +8,16 @@
|
|||
"packages": [
|
||||
{
|
||||
"name": "daux/daux.io",
|
||||
"version": "0.9.4",
|
||||
"version": "0.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/dauxio/daux.io.git",
|
||||
"reference": "a1875a2726b8efc8fc1359d9835374a2402498c8"
|
||||
"reference": "5a19258651d5ff7d4079eda09faa537626b28420"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/dauxio/daux.io/zipball/a1875a2726b8efc8fc1359d9835374a2402498c8",
|
||||
"reference": "a1875a2726b8efc8fc1359d9835374a2402498c8",
|
||||
"url": "https://api.github.com/repos/dauxio/daux.io/zipball/5a19258651d5ff7d4079eda09faa537626b28420",
|
||||
"reference": "5a19258651d5ff7d4079eda09faa537626b28420",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -74,7 +74,7 @@
|
|||
"markdown",
|
||||
"md"
|
||||
],
|
||||
"time": "2019-08-08T12:21:31+00:00"
|
||||
"time": "2019-08-13T09:20:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
|
@ -389,16 +389,16 @@
|
|||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
"version": "1.9.1",
|
||||
"version": "1.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/myclabs/DeepCopy.git",
|
||||
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72"
|
||||
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
|
||||
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72",
|
||||
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea",
|
||||
"reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -433,7 +433,7 @@
|
|||
"object",
|
||||
"object graph"
|
||||
],
|
||||
"time": "2019-04-07T13:18:21+00:00"
|
||||
"time": "2019-08-09T12:45:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
|
|
Loading…
Reference in a new issue