summaryrefslogtreecommitdiff
path: root/slideshows/dark/template/events.js
diff options
context:
space:
mode:
authorBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-20 12:51:39 +0100
committerBenjamin Kiessling <mittagessen@l.unchti.me>2012-01-20 12:51:39 +0100
commitd74d4b7eb50eec11d4575928a04a3d0ba226808c (patch)
tree101a067430fd8f2328e3cb72ad85451d173446fe /slideshows/dark/template/events.js
parent882dd93ee52466c903c04372e5228a68a31402a5 (diff)
Add dark color scheme layout
Diffstat (limited to 'slideshows/dark/template/events.js')
-rw-r--r--slideshows/dark/template/events.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/slideshows/dark/template/events.js b/slideshows/dark/template/events.js
new file mode 100644
index 0000000..b0efe13
--- /dev/null
+++ b/slideshows/dark/template/events.js
@@ -0,0 +1,61 @@
+$(document).ready(function(){
+
+ var tot=$('.event').length;
+
+ var screenWidth = $('.events').width();
+
+ var bord = $('.event').outerWidth() - $('.event').innerWidth();
+ var padd = $('.event').innerWidth() - $('.event').width();
+ var marg = $('.event').outerWidth(true) - $('.event').outerWidth();
+ $('.event').width((screenWidth-(tot * (bord+padd+marg)+1))/tot);
+
+ $('.eventDate').each(function(index, value) {
+ var colours = ['a', 'b', 'c', 'd', 'e', 'f'];
+ $(this).addClass(colours[index % 6]);
+ });
+
+
+ $('.eventField').each(function(index, value) {
+ var classStr = $(this).attr('class').split(/\s+/);
+ if(classStr.indexOf('start') != -1) {
+ $(this).show();
+ } else if(classStr.indexOf('summary') != -1) {
+ $(this).show();
+ }
+ });
+
+ $('.eventEl').click(function() {
+ showWindow($(this));
+ });
+
+});
+
+function showWindow(data) {
+
+ var title = $('.summary',data).text();
+ var body = $('.description',data).html();
+
+ if(body == null) {
+ body = 'no description available';
+ }
+
+ $('<div id="overlay">').css({
+ width:$(document).width(),
+ height:$(document).height(),
+ opacity:0.6
+
+ }).appendTo('body').click(function(){
+ $(this).remove();
+ $('#windowBox').remove();
+ });
+
+ $('body').append('<div id="windowBox"><div id="titleDiv">'+title+'</div>'+body+'</div>');
+
+ $('#windowBox').css({
+ width:500,
+ height:350,
+ left: ($(window).width() - 500)/2,
+ top: ($(window).height() - 350)/2
+ });
+}
+