1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Update Daux and manual theme

This commit is contained in:
J. King 2019-08-13 07:01:17 -04:00
parent ca49785f6f
commit 06b9049515
7 changed files with 168 additions and 95 deletions

View file

@ -272,15 +272,15 @@ class RoboFile extends \Robo\Tasks {
* This requires Node and Yarn to be installed. * This requires Node and Yarn to be installed.
*/ */
public function manualCss(): Result { 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 // start a collection; this stops after the first failure
$t = $this->collectionBuilder(); $t = $this->collectionBuilder();
$tmp = $t->tmpDir().\DIRECTORY_SEPARATOR; $tmp = $t->tmpDir().\DIRECTORY_SEPARATOR;
// install dependencies via Yarn // install dependencies via Yarn
$t->taskExec("yarn install"); $t->taskExec("yarn install");
// compile the stylesheet // 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"); $t->taskExec($postcss)->arg($themesrc."arsse.scss")->option("-o", $themeout."arsse.css");
// execute the collection // execute the collection
return $t->run(); return $t->run();

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,6 @@
{ {
"favicon": "<theme_url>favicon.png", "favicon": "<theme_url>favicon.png",
"js": [ "js": [
"<theme_url>jquery.min.js",
"<theme_url>highlight.pack.js", "<theme_url>highlight.pack.js",
"<theme_url>daux.js" "<theme_url>daux.js"
], ],

View file

@ -4,103 +4,186 @@ if (hljs) {
hljs.initHighlightingOnLoad(); hljs.initHighlightingOnLoad();
} }
//Initialize CodeBlock Visibility Settings (function() {
$(function () { var codeBlocks = document.querySelectorAll(".s-content pre");
var codeBlockView = $('.Columns__right'), var toggleCodeSection = document.querySelector(".CodeToggler");
codeBlocks = $('.s-content pre'), if (!toggleCodeSection) {
toggleCodeSection = $('.CodeToggler'), return;
toggleCodeBlockBtns = toggleCodeSection.find('.CodeToggler__button'), } else if (!codeBlocks.length) {
toggleCodeBlockBtn = toggleCodeSection.find('.CodeToggler__button--main'), toggleCodeSection.classList.add("Hidden");
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');
return; 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) { function setCodeBlockStyle(codeBlockState) {
try { for (var a = 0; a < toggleCodeBlockBtnList.length; a++) {
localStorage.setItem("codeBlockState", codeBlockState); toggleCodeBlockBtnList[a].classList.remove("Button--active");
} catch (e) {
// local storage operations can fail with the file:// protocol
} }
toggleCodeBlockBtns.removeClass("Button--active");
switch (codeBlockState) { switch (codeBlockState) {
case 2: // Show code blocks inline case true: // Show code blocks below (flowed); checkbox
toggleCodeBlockBtnFloat.addClass("Button--active"); var hidden = false;
codeBlockView.addClass('Columns__right--float');
codeBlockView.removeClass('Columns__right--full');
codeBlocks.removeClass('Hidden');
break; break;
case 1: // Show code blocks below case false: // Hidden code blocks; checkbox
toggleCodeBlockBtnBelow.addClass("Button--active"); var hidden = true;
toggleCodeBlockBtn.prop('checked', true); break;
codeBlockView.removeClass('Columns__right--float'); case 2: // Show code blocks inline (floated)
codeBlockView.addClass('Columns__right--full'); toggleCodeBlockBtnFloat.classList.add("Button--active");
codeBlocks.removeClass('Hidden'); 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; break;
case 0: // Hidden code blocks case 0: // Hidden code blocks
default: default:
toggleCodeBlockBtnHide.addClass("Button--active"); toggleCodeBlockBtnHide.classList.add("Button--active");
toggleCodeBlockBtn.prop('checked', false); codeBlockView.classList.remove("Columns__right--float");
codeBlockView.removeClass('Columns__right--float'); codeBlockView.classList.add("Columns__right--full");
codeBlockView.addClass('Columns__right--full'); var hidden = true;
codeBlocks.addClass('Hidden');
break; 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 { try {
var codeBlockState = localStorage.getItem("codeBlockState"); var codeBlockState = localStorage.getItem("codeBlockState");
} catch (e) { } catch (e) {
// local storage operations can fail with the file:// protocol // local storage operations can fail with the file:// protocol
var codeBlockState = false; var codeBlockState = null;
} }
if (!codeBlockState) { if (!codeBlockState) {
codeBlockState = floating ? 2 : 1; codeBlockState = floating ? 2 : 1;
} else { } else {
codeBlockState = parseInt(codeBlockState); codeBlockState = parseInt(codeBlockState);
} }
if (!floating) {
if (!floating && codeBlockState == 2) { codeBlockState = !!codeBlockState;
codeBlockState = 1;
} }
setCodeBlockStyle(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();
});
// New Tree navigation (function() {
$('ul.Nav > li.has-children > a > .Nav__arrow').click(function() { var trigger = document.querySelector('.Collapsible__trigger');
$(this).parent().parent().toggleClass('Nav__item--open');
return false;
});
// Responsive navigation if (!trigger) {
$('.Collapsible__trigger').click(function () { return;
$('.Collapsible__content').slideToggle(); }
});
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');
}
}); });
})();

File diff suppressed because one or more lines are too long

View file

@ -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);

View file

@ -8,16 +8,16 @@
"packages": [ "packages": [
{ {
"name": "daux/daux.io", "name": "daux/daux.io",
"version": "0.9.4", "version": "0.10.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/dauxio/daux.io.git", "url": "https://github.com/dauxio/daux.io.git",
"reference": "a1875a2726b8efc8fc1359d9835374a2402498c8" "reference": "5a19258651d5ff7d4079eda09faa537626b28420"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/dauxio/daux.io/zipball/a1875a2726b8efc8fc1359d9835374a2402498c8", "url": "https://api.github.com/repos/dauxio/daux.io/zipball/5a19258651d5ff7d4079eda09faa537626b28420",
"reference": "a1875a2726b8efc8fc1359d9835374a2402498c8", "reference": "5a19258651d5ff7d4079eda09faa537626b28420",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -74,7 +74,7 @@
"markdown", "markdown",
"md" "md"
], ],
"time": "2019-08-08T12:21:31+00:00" "time": "2019-08-13T09:20:39+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -389,16 +389,16 @@
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
"version": "1.9.1", "version": "1.9.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/myclabs/DeepCopy.git", "url": "https://github.com/myclabs/DeepCopy.git",
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72" "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea",
"reference": "e6828efaba2c9b79f4499dae1d66ef8bfa7b2b72", "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -433,7 +433,7 @@
"object", "object",
"object graph" "object graph"
], ],
"time": "2019-04-07T13:18:21+00:00" "time": "2019-08-09T12:45:53+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",