From 915dcc55ebfcdb441f4b0efee90b12334718b9bd Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 20 Jan 2011 19:35:41 +1100 Subject: [PATCH] Added styles and yotsuba.css --- main.js | 41 +++++++++++++++++++++++++++++++++++++++++ style.css | 10 ++++++++++ yotsuba.css | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 yotsuba.css diff --git a/main.js b/main.js index d0b0e0d6..dd46cd18 100644 --- a/main.js +++ b/main.js @@ -24,8 +24,49 @@ function citeReply(id) { document.getElementById('body').value += '>>' + id + '\n'; } +var selectedstyle = 'Yotsuba B'; +var styles = [ + ['Yotsuba B', '/default.css'], + ['Yotsuba', '/yotsuba.css'] +]; + +function changeStyle(x) { + localStorage.stylesheet = styles[x][1]; + document.getElementById('stylesheet').href = styles[x][1]; + selectedstyle = styles[x][0]; +} + +newLink = document.createElement('link'); +newLink.rel = 'stylesheet'; +newLink.type = 'text/css'; +newLink.id = 'stylesheet'; +document.getElementsByTagName('head')[0].insertBefore(newLink, document.getElementsByTagName('link')[0].lastChild) + +if(localStorage.stylesheet) { + for(x=0;x