Commit 0eb75d87 authored by svilayphiou's avatar svilayphiou

Added a link to a pad to style together at the same time

parent 9c5d21f9
function loadEtherStyle(url, interval) {
function load(url) {
fetch(url)
.then(function(r) { return r.text()})
.then(function (styles) {
var el = document.createElement('style');
el.appendChild(document.createTextNode(styles));
el.setAttribute('data-type', 'etherstyle');
document.head.appendChild(el);
window.requestAnimationFrame(function () {
var styles = document.querySelectorAll('[data-type="etherstyle"]');
for (var i=0;i<(styles.length-1);i++) {
styles[i].remove();
}
});
});
}
load(url);
var urlParameters = new URLSearchParams(window.location.search),
reload = urlParameters.get('reload');
if (reload == 'reload') {
window.setInterval(function () { load(url); }, interval);
}
}
(function () {
loadEtherStyle('http://pads.osp.kitchen/p/aesthetic-programming.css/export/txt/', 7500);
})();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{ SITENAME }}</title>
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/styles.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/interface-0.1.css" type="text/css" media="all" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/paged.polyfill.js"></script>
</head>
<body>
{% for page in pages %}
{{ page.content }}
{% endfor %}
</body>
</html>
\ No newline at end of file
......@@ -7,10 +7,29 @@
<title>{{ SITENAME }}</title>
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/styles.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/interface-0.1.css" type="text/css" media="all" charset="utf-8">
<script type="text/javascript" charset="utf-8" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/paged.polyfill.js">
</script>
<script type="text/javascript" charset="utf-8" src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/js/paged.polyfill.js"> </script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
crossorigin="anonymous"></script>
<script type="text/javascript" charset="utf-8">
// URL DE VOTRE PAD ICI
//pad = "https://semestriel.framapad.org/p/aesthetic-programmingcss";
pad = "http://pads.osp.kitchen/p/aesthetic-programming.css";
$(document).ready(function(){
setTimeout(function(){
$("#styles").load(pad + "/export/txt");
}, 50);
});
</script>
</head>
<body>
<style type="text/css" media="screen" id="styles" >
</style>
{{ page.content }}
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment