File: 0.00.1a/plugins/patriot/patriot.js (View as HTML)

  1: /* -------------------------------------------------------------
  2: This file is part of FreeDESK
  3: 
  4: FreeDESK is (C) Copyright 2012 David Cutting
  5: 
  6: FreeDESK is free software: you can redistribute it and/or modify
  7: it under the terms of the GNU General Public License as published by
  8: the Free Software Foundation, either version 3 of the License, or
  9: (at your option) any later version.
 10: 
 11: FreeDESK is distributed in the hope that it will be useful,
 12: but WITHOUT ANY WARRANTY; without even the implied warranty of
 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14: GNU General Public License for more details.
 15: 
 16: You should have received a copy of the GNU General Public License
 17: along with FreeDESK.  If not, see www.gnu.org/licenses
 18: 
 19: For more information see www.purplepixie.org/freedesk/
 20: -------------------------------------------------------------- */
 21: 
 22: function patriotPlugin()
 23: {
 24: 	this.mode = 0;
 25: 	
 26: 	this.timer = false;
 27: 	
 28: 	this.interval = 500;
 29: 	
 30: 	this.Set = function(newmode)
 31: 	{
 32: 		//alert(newmode);
 33: 		var addon = "";
 34: 		if (newmode != 0)
 35: 			addon = newmode;
 36: 		this.mode = newmode;
 37: 		
 38: 		document.getElementById('header').className = "header"+addon;
 39: 		document.getElementById('footer').className = "footer"+addon;
 40: 	}
 41: 	
 42: 	this.Start = function()
 43: 	{
 44: 		this.timer = setInterval(function(){ Patriot.Rand(); }, this.interval);
 45: 	}
 46: 	
 47: 	this.Stop = function()
 48: 	{
 49: 		clearInterval(this.timer);
 50: 		this.Set(0);
 51: 	}
 52: 	
 53: 	this.Rand = function()
 54: 	{
 55: 		this.Set(Math.floor(Math.random()*3)+1);
 56: 	}
 57: 	
 58: }
 59: 
 60: var Patriot = new patriotPlugin();
 61: 
 62: