|
From: <ma...@us...> - 2011-10-21 20:50:36
|
Revision: 462
http://openautomation.svn.sourceforge.net/openautomation/?rev=462&view=rev
Author: makki1
Date: 2011-10-21 20:50:30 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
CometVisu: jqclock - a clock widget with statusbar-support
Added Paths:
-----------
CometVisu/trunk/visu/plugins/jqclock/
CometVisu/trunk/visu/plugins/jqclock/jqclock.css
CometVisu/trunk/visu/plugins/jqclock/jqclock.min.js
CometVisu/trunk/visu/plugins/jqclock/structure_plugin.js
Added: CometVisu/trunk/visu/plugins/jqclock/jqclock.css
===================================================================
--- CometVisu/trunk/visu/plugins/jqclock/jqclock.css (rev 0)
+++ CometVisu/trunk/visu/plugins/jqclock/jqclock.css 2011-10-21 20:50:30 UTC (rev 462)
@@ -0,0 +1,36 @@
+.jqclock {
+ float:right;
+ white-space: nowrap;
+/*
+ text-align:center;
+ background: LightYellow;
+ border: 1px Black solid;
+ padding: 10px;
+ margin:20px;
+*/
+}
+.clockdate {
+ white-space: nowrap;
+/*
+ color: DarkRed;
+ margin-bottom: 10px;
+ font-size: 18px;
+ display: block;
+*/
+}
+.clocktime {
+ white-space: nowrap;
+/*
+ border: 2px
+ inset White;
+ background: Black;
+ padding: 5px;
+ font-size: 14px;
+ font-family: "Courier";
+ color: LightGreen;
+ display: block;
+*/
+ margin: 10px;
+}
+
+
Added: CometVisu/trunk/visu/plugins/jqclock/jqclock.min.js
===================================================================
--- CometVisu/trunk/visu/plugins/jqclock/jqclock.min.js (rev 0)
+++ CometVisu/trunk/visu/plugins/jqclock/jqclock.min.js 2011-10-21 20:50:30 UTC (rev 462)
@@ -0,0 +1 @@
+(function($){$.clock={version:"2.0.1",locale:{}};t=[];$.fn.clock=function(d){var c={it:{weekdays:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"]},en:{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},es:{weekdays:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],months:["Enero","Febrero","Marzo","Abril","May","junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"]},de:{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],months:["Januar","Februar","März","April","könnte","Juni","Juli","August","September","Oktober","November","Dezember"]},fr:{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],months:["Janvier","Février","Mars","Avril","May","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"]},ru:{weekdays:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"]}};return this.each(function(){$.extend(c,$.clock.locale);d=d||{};d.timestamp=d.timestamp||"z";y=new Date().getTime();d.sysdiff=0;if(d.timestamp!="z"){d.sysdiff=d.timestamp-y}d.langSet=d.langSet||"en";d.format=d.format||((d.langSet!="en")?"24":"12");d.calendar=d.calendar||"true";if(!$(this).hasClass("jqclock")){$(this).addClass("jqclock")}var e=function(g){if(g<10){g="0"+g}return g},f=function(j,n){var r=$(j).attr("id");if(n=="destroy"){clearTimeout(t[r])}else{m=new Date(new Date().getTime()+n.sysdiff);var p=m.getHours(),l=m.getMinutes(),v=m.getSeconds(),u=m.getDay(),i=m.getDate(),k=m.getMonth(),q=m.getFullYear(),o="",z="",w=n.langSet;if(n.format=="12"){o=" AM";if(p>11){o=" PM"}if(p>12){p=p-12}if(p==0){p=12}}p=e(p);l=e(l);v=e(v);if(n.calendar!="false"){z=((w=="en")?"<span class='clockdate'>"+c[w].weekdays[u]+", "+c[w].months[k]+" "+i+", "+q+"</span>":"<span class='clockdate'>"+c[w].weekdays[u]+", "+i+" "+c[w].months[k]+" "+q+"</span>")}$(j).html(z+"<span class='clocktime'>"+p+":"+l+":"+v+o+"</span>");t[r]=setTimeout(function(){f($(j),n)},1000)}};f($(this),d)})};return this})(jQuery);
Added: CometVisu/trunk/visu/plugins/jqclock/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/jqclock/structure_plugin.js (rev 0)
+++ CometVisu/trunk/visu/plugins/jqclock/structure_plugin.js 2011-10-21 20:50:30 UTC (rev 462)
@@ -0,0 +1,67 @@
+/* structure_plugin.js (c) 2011 by Michael Markstaller [de...@wi...]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+*/
+
+/**
+ * This plugins integrates date/clock into CometVisu.
+ */
+
+$('head').append('<script type=\"text/javascript\" src=\"plugins/jqclock/jqclock.min.js\" charset=\"UTF-8\"></script>');
+$('head').append('<link rel="stylesheet" href="plugins/jqclock/jqclock.css" type="text/css" />');
+
+VisuDesign_Custom.prototype.addCreator("jqclock", {
+ create: function( page, path ) {
+ var $p = $(page);
+ function uniqid() {
+ var newDate = new Date;
+ return newDate.getTime();
+ }
+ var id = "jqclock_" + uniqid();
+
+ var ret_val = $('<div class="widget" />');
+ ret_val.addClass( 'jqclock' );
+ var label = '<div class="label">' + page.textContent + '</div>';
+ var actor = $("<div class=\"actor\"><div class=\"jqclock_inline\" id=\"" + id + "\"></div></div>");
+ var jqclock = $("#"+id,actor);
+
+ if ($p.attr("width")) {
+ jqclock.css("width", $p.attr("width"));
+ }
+ if ($p.attr("height")) {
+ jqclock.css("height", $p.attr("height"));
+ }
+
+ //start the clock in statusbar - if any
+ $("div#jqclock_status").clock({"langSet":$("div#jqclock_status").attr('lang'),"calendar":$("div#jqclock_status").attr('date')});
+
+ window.setTimeout(function() {
+ //start myself after 1 sec? a quirk?
+ $("#"+id).clock({"langSet":$p.attr("lang"), "calendar":$p.attr("date")});
+ }, 1000);
+
+ ret_val.append(label).append(actor);
+ return ret_val;
+ },
+ attributes: {
+ width: {type: "string", required: false},
+ height: {type: "string", required: false},
+ //refresh: {type: "numeric", required: false},
+ lang: {type: "list", required: true, list: {'de':'Deutsch','en':'English','es':'Espanol','fr':'Francais','it':'Italiano','ru':'Ruski'}},
+ date: {type: "list", required: false, list: {'true': "yes", 'false': "no"}}
+ },
+ content: {type: "string", required: false}
+});
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|