Compare commits

..
7 Commits
Author SHA1 Message Date
lukas 66862856e4 Add Promise polyfill for IE 2018-10-28 15:40:20 +01:00
lukas 69b3f079ea Extract polyfills into a separate JS file 2018-10-28 15:08:27 +01:00
lukas a42ea124cc Dynamic copyright 2018-01-01 13:06:38 +01:00
lukas 32645c0414 Compatibility with element-closest v2.0.2 2017-06-04 22:36:43 +02:00
lukas 12acbfc16b Support for Uniform v3 2017-06-04 22:06:54 +02:00
lukas 35c60ca0d9 Add font-display: swap rule 2016-08-19 15:45:51 +02:00
lukas c8e5bd98cc Fix AJAX popstate event 2016-08-16 11:19:55 +02:00
5 changed files with 13 additions and 13 deletions
+1 -6
View File
@@ -1,6 +1,3 @@
//=require element-closest/closest.js
//=require whatwg-fetch/fetch.js
(function(app) { (function(app) {
'use strict'; 'use strict';
@@ -19,9 +16,7 @@
form.classList.add('form--sent'); form.classList.add('form--sent');
// Get form data // Get form data
// Explicitly add value of submit button (browser bug in Chrome/FF?)
var data = new FormData(form); var data = new FormData(form);
data.append('_submit', form._submit.value);
// Send the form data via AJAX // Send the form data via AJAX
var options = { var options = {
@@ -61,7 +56,7 @@
// Display the error to the user // Display the error to the user
form.classList.remove('form--sent'); form.classList.remove('form--sent');
form.querySelector('.form__message').innerText = err; form.querySelector('.form__message').innerHTML = err;
// Enable the submit button again // Enable the submit button again
form._submit.disabled = false; form._submit.disabled = false;
+1
View File
@@ -46,5 +46,6 @@
src: url(-cdd-cachebuster('/assets/fonts/' + $file + '.eot') + '?#') format('embedded-opentype'), // IE 9 src: url(-cdd-cachebuster('/assets/fonts/' + $file + '.eot') + '?#') format('embedded-opentype'), // IE 9
url(-cdd-cachebuster('/assets/fonts/' + $file + '.woff2')) format('woff2'), url(-cdd-cachebuster('/assets/fonts/' + $file + '.woff2')) format('woff2'),
url(-cdd-cachebuster('/assets/fonts/' + $file + '.woff')) format('woff'); url(-cdd-cachebuster('/assets/fonts/' + $file + '.woff')) format('woff');
font-display: swap;
} }
} }
+3 -3
View File
@@ -1,8 +1,8 @@
<footer class="footer"> <footer class="footer">
<a href="#top" class="footer__top">↑ <?= l::get('footer.top', 'Top') ?> ↑</a> <a href="#top" class="footer__top">↑ <?= l::get('footer.top', 'Top') ?> ↑</a>
<div>
<?= $site->copyright() ?> <?= $site->copyright()->kirbytext() ?>
</div>
<nav class="footer__nav"> <nav class="footer__nav">
<ul> <ul>
<li><?= l::get('footer.madewith', 'Made with') ?> <a href="https://getkirby.com">Kirby</a></li><!-- <li><?= l::get('footer.madewith', 'Made with') ?> <a href="https://getkirby.com">Kirby</a></li><!--
+5 -4
View File
@@ -1,5 +1,3 @@
//=require element-closest/closest.js
//=require whatwg-fetch/fetch.js
//=require flexismooth/flexismooth.js //=require flexismooth/flexismooth.js
(function(app) { (function(app) {
@@ -56,10 +54,10 @@
// Just scroll to the top/element if the link points to the current page // Just scroll to the top/element if the link points to the current page
// In this case, we also don't want to reload, so we return true // In this case, we also don't want to reload, so we return true
if(target.pathname === window.location.pathname) { if(mode === 'normal' && target.pathname === window.location.pathname) {
var element; var element;
if(target.hash) { if(target.hash) {
if(mode === 'normal' && target.hash !== '#top') { if(target.hash !== '#top') {
history.pushState({}, document.title, target.href); history.pushState({}, document.title, target.href);
} }
element = document.getElementById(target.hash.substr(1)); element = document.getElementById(target.hash.substr(1));
@@ -162,6 +160,9 @@
if(app.go(link)) e.preventDefault(); if(app.go(link)) e.preventDefault();
}); });
// Replace the state for the normal page load
history.replaceState({}, document.title, window.location.href);
// Listen on the popstate event on window // Listen on the popstate event on window
window.addEventListener('popstate', function(e) { window.addEventListener('popstate', function(e) {
if(e.state !== null) app.go(window.location.href, 'popstate'); if(e.state !== null) app.go(window.location.href, 'popstate');
+3
View File
@@ -0,0 +1,3 @@
//=require element-closest/element-closest.js
//=require promise-polyfill/dist/polyfill.js
//=require whatwg-fetch/dist/fetch.umd.js