Revision: 2569
Author: seba.wagner
Date: Mon Nov 2 02:08:52 2009
Log: Make Calendar static version functional ready
http://code.google.com/p/openmeetings/source/detail?r=2569
Added:
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/calendardata/vcal_2009-12-01.xml
Modified:
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/cal-data.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/day.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/event.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/eventselector.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/infopanel.lzx
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/lzCalendar.lzx
=======================================
--- /dev/null
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/calendardata/vcal_2009-12-01.xml
Mon Nov 2 02:08:52 2009
@@ -0,0 +1,112 @@
+<vcalendar>
+<!-- * X_LZ_COPYRIGHT_BEGIN
***************************************************
+* Copyright 2001-2009 Laszlo Systems, Inc. All Rights
Reserved. *
+* Use is subject to license
terms. *
+* X_LZ_COPYRIGHT_END
****************************************************** -->
+ <year2009>
+ <month12>
+ <day14>
+ <event>
+ <summary value="Gym workout"/>
+ <comment value="gym"/>
+ <start year="2009" month="11" day="14" hour="16"
minute="30"/>
+ <end year="2009" month="11" day="14" hour="17"
minute="30"/>
+ <category/>
+ <uid/>
+ </event>
+ <event>
+ <summary value="photo shoot"/>
+ <comment value="photo shoot"/>
+ <start year="2009" month="11" day="14" hour="9"
minute="12"/>
+ <end year="2009" month="11" day="14" hour="10"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day14>
+ <day2>
+ <event>
+ <summary value="Speech at the MOMA"/>
+ <comment value="A test event"/>
+ <start year="2009" month="11" day="2" hour="8"
minute="30"/>
+ <end year="2009" month="11" day="2" hour="10"
minute="30"/>
+ <category/>
+ <uid/>
+ </event>
+ </day2>
+ <day6>
+ <event>
+ <summary value="Ribbon Cutting Ceremony"/>
+ <comment value="Another meeting"/>
+ <start year="2009" month="11" day="6" hour="3"
minute="30"/>
+ <end year="2009" month="11" day="6" hour="5"
minute="30"/>
+ <category/>
+ <uid/>
+ </event>
+ <event>
+ <summary value="Governor's Luncheon"/>
+ <comment value="Lunch with Arnold"/>
+ <start year="2009" month="11" day="6" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="6" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day6>
+ <day30>
+ <event>
+ <summary value="Pick-up Movie DVDs"/>
+ <comment value="Pick-up movies"/>
+ <start year="2009" month="11" day="30" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="30" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ <event>
+ <summary value="Another example event"/>
+ <comment value="Another example event"/>
+ <start year="2009" month="11" day="30" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="30" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day30>
+ <day12>
+ <event>
+ <summary value="Run Heartache Hill"/>
+ <comment value="Good evening"/>
+ <start year="2009" month="11" day="12" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="12" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day12>
+ <day1>
+ <event>
+ <summary value="Swim English Channel"/>
+ <comment value="Another example event"/>
+ <start year="2009" month="11" day="1" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="1" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day1>
+ <day18>
+ <event>
+ <summary value="Climb Mount Everest"/>
+ <comment value="How we do it back home"/>
+ <start year="2009" month="11" day="18" hour="3"
minute="30"/>
+ <end year="2009" month="11" day="18" hour="5"
minute="30"/>
+ <category/>
+ <uid/>
+ </event>
+ <event>
+ <summary value="Sail across Pacific"/>
+ <comment value="Conference"/>
+ <start year="2009" month="11" day="18" hour="12"
minute="12"/>
+ <end year="2009" month="11" day="18" hour="13"
minute="12"/>
+ <category/>
+ <uid/>
+ </event>
+ </day18>
+ </month12>
+ </year2009>
+</vcalendar>
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/cal-data.lzx
Sat Oct 31 06:17:07 2009
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/cal-data.lzx
Mon Nov 2 02:08:52 2009
@@ -30,7 +30,7 @@
<method name="loadData" args="mo, yr">
if ($debug) Debug.write("loadData",mo, yr);
if( !datatester.hasNode( mo , yr ) ){
- var r = "calendardata/vcal_" + yr + "-" + mo + "-01.xml";
+ var r = "modules/lzcalendar/calendardata/vcal_" + yr + "-"
+ mo + "-01.xml";
this.enqueueRequest( r );
}
</method>
@@ -132,6 +132,8 @@
local data -->
<node >
+ <attribute name="lzCalendarContent" value="null" />
+
<handler name="oninit">
canvas.eventDataMgr = this;
</handler>
@@ -140,14 +142,22 @@
// Add event is called by the "Add Event" button to
//create a new event
+ if ($debug) Debug.write("addEvent :: alleventsDP
",alleventsDP);
+
alleventsDP.setXPath('eventdata:/vcalendar[1]');
// Set the blank event pointer to the top of the event
blankeventDP.setXPath('blankEvent:/event[1]');
// Set the right current cal day for new events
- var selDay = calgrid.daySelectionMgr.getSelection()[0];
+ var selDay =
this.lzCalendarContent.calgrid.daySelectionMgr.getSelection()[0];
+
+ if ($debug) Debug.write("Fill Blank Event ",selDay);
+
if ( selDay ){
+
+ if ($debug) Debug.write("DO Fill Blank Event ",selDay);
+
blankeventDP.setNodeAttribute('selected','true');
blankeventDP.setXPath('start[1]');
blankeventDP.setNodeAttribute('year',
@@ -177,23 +187,39 @@
blankeventDP.setNodeAttribute('value', "New Event" );
blankeventDP.selectParent();
- }
-
+
+ if ($debug) Debug.write("FILL Complete the event ");
+ }
+
// Move to OR create the node tree for this event
// Each event should be in the right part of the
// tree of data (yearXXXX/monthX/dayX/)
// The location in the tree is derived from the new
// events start data
+
+ if ($debug) Debug.write("FILL YEAR ");
var year = blankeventDP.xpathQuery('start/@year');
+ if ($debug) Debug.write("FILL MONTH ");
var month = blankeventDP.xpathQuery('start/@month');
+ if ($debug) Debug.write("FILL DAY ");
var day = blankeventDP.xpathQuery('start/@day');
- getNewNode(alleventsDP,'year'+year);
- getNewNode(alleventsDP,'month'+month);
- getNewNode(alleventsDP,'day'+day);
-
+ if ($debug) Debug.write("Done YEAR ");
+ this.getNewNode(alleventsDP,'year'+year);
+ if ($debug) Debug.write("Done MONTH ");
+ this.getNewNode(alleventsDP,'month'+month);
+ if ($debug) Debug.write("Done DAY ");
+ this.getNewNode(alleventsDP,'day'+day);
+
+ if ($debug) Debug.write("Add the event ");
+
// Add the event
- currenteventDP.setNodeAttribute( "selected" , 'false' );
+ //currenteventDP.setNodeAttribute( "selected" , 'false' );
+
+ //if ($debug) Debug.write("Add the event 2 ",currenteventDP);
+
var newPoint = alleventsDP.addNodeFromPointer(blankeventDP);
+
+ if ($debug) Debug.write("currenteventDP ",newPoint);
// Set the event data pointer to the top of the event data
alleventsDP.setXPath('eventdata:/vcalendar[1]');
@@ -235,7 +261,7 @@
//currenteventDP.setXPath('blankEvent:/event[1]');
currenteventDP.setPointer( noEvent.getFirstChild() );
- eventselector.hide();
+ this.lzCalendarContent.eventselector.hide();
</method>
<method name="changeEventTime" args="shour, smin"> <![CDATA[
=======================================
--- /trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/day.lzx
Sat Oct 31 06:17:07 2009
+++ /trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/day.lzx
Mon Nov 2 02:08:52 2009
@@ -133,10 +133,10 @@
if ( amselected) {
//Global tracking of the currently selected day
- dayselectorlook.select(this);
+ parent.parent.dayselectorlook.select(this);
} else {
// selection managers always call unselect first
- dayselectorlook.hide();
+ parent.parent.dayselectorlook.hide();
}
</method>
<attribute name="year" type="number" value="0"/>
@@ -176,7 +176,7 @@
var textColor = 0xDAE3E8;
// If this day is not in the month...
- if (this.month != calgrid.month ) {
+ if (this.month != parent.month ) {
this.unselectedColor = 0x768A97;
textColor = 0x7E929F;
}
@@ -212,7 +212,7 @@
</method>
<handler name="onclick" >
- calgrid.openday(this);
+ parent.openday(this);
</handler>
<method name="hilite" args="dohilite, dontupdate">
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/event.lzx
Sat Oct 31 02:43:46 2009
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/event.lzx
Mon Nov 2 02:08:52 2009
@@ -37,7 +37,8 @@
// which in turn selects the event selector bar
this.selected = sel;
if (this.selected){
- eventselector.setSelectedEvent( this ,this.mouseIsDown );
+ if ($debug) Debug.write("setSel
ITEM :: ",parent.parent.parent.parent.parent.parent.parent);
+
parent.parent.parent.parent.parent.parent.parent.eventselector.setSelectedEvent(
this ,this.mouseIsDown );
}
</method>
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/eventselector.lzx
Sat Oct 31 06:17:07 2009
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/eventselector.lzx
Mon Nov 2 02:08:52 2009
@@ -106,14 +106,14 @@
</handler>
<method name="hide">
- bar.setAttribute('visible', false);
- bar.followstate.remove();
+ this.bar.setAttribute('visible', false);
+ this.bar.followstate.remove();
this.followview = null;
this.clipdel.unregisterAll();
this.hidedel.unregisterAll();
this.setAttribute( "freedragging" , true );
- if(calgrid.keepinfoopen == false){
- infopanel.unselectEvent();
+ if(parent.calgrid.keepinfoopen == false){
+ parent.cal_interior.infopanel.unselectEvent();
}
</method>
@@ -146,7 +146,7 @@
// update eventselector view
- bar.setAttribute('visible', true );
+ this.bar.setAttribute('visible', true );
this.bringToFront();
@@ -160,13 +160,13 @@
this.hidedel.register(
this['followview'].classroot, "onvisible" );
// change selected day
- calgrid.daySelectionMgr.select(e.classroot);
- calgrid.open_day = e.classroot;
+ parent.calgrid.daySelectionMgr.select(e.classroot);
+ parent.calgrid.open_day = e.classroot;
//reinitialize the constraints to the new view
//(there are no meta-constraints in v1
- bar.followstate.remove();
- bar.followstate.apply();
+ this.bar.followstate.remove();
+ this.bar.followstate.apply();
var nfd = !this['followview'].classroot.opened;
@@ -181,7 +181,7 @@
}
}
- colorMe();
+ this.colorMe();
if ( sdrag && !this.dragging ){
this.domousedown();
@@ -203,9 +203,9 @@
var transColor = { ra: trans.ra, ga: trans.ga, ba:
trans.ba };
}
- bar.gripper.top.setColorTransform(transColor);
- bar.gripper.bottom.setColorTransform(transColor);
- bar.gripper.button.bkgnd.setColorTransform(transColor);
+ this.bar.gripper.top.setColorTransform(transColor);
+ this.bar.gripper.bottom.setColorTransform(transColor);
+ this.bar.gripper.button.bkgnd.setColorTransform(transColor);
</method>
<handler name="onfreedragging"><![CDATA[
@@ -237,7 +237,7 @@
<handler name="ondblclick">
//Debug.write("eventselector doubleclick");
- infopanel.open();
+ parent.cal_interior.infopanel.open();
// OLD cal_interior.showInfo(smallevent.event);
</handler>
@@ -261,10 +261,10 @@
<method name="startDrag" args="v"> <![CDATA[
this.mdel.register( lz.Idle, "onidle" );
- bar.followstate.remove();
+ this.bar.followstate.remove();
this.setAttribute('freedragging', !this['followview'].classroot.opened );
this.setAttribute('dragging',true);
- calgrid.gridlayout.startTrack(); ]]>
+ parent.calgrid.gridlayout.startTrack(); ]]>
</method>
<handler name="onmouseup" method="domouseup"/>
@@ -272,9 +272,9 @@
if ( this.dragging ){
this.mdel.unregisterAll( );
this.setAttribute('dragging',false);
- calgrid.gridlayout.stopTrack();
+ parent.calgrid.gridlayout.stopTrack();
//this may be already applied, but it can't hurt
- bar.followstate.apply();
+ this.bar.followstate.apply();
if ($debug) Debug.warn("ON MOUSE UP => Update Cal
Event ",this['followview']);
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/infopanel.lzx
Sat Oct 31 06:17:07 2009
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/infopanel.lzx
Mon Nov 2 02:08:52 2009
@@ -105,64 +105,64 @@
<basebutton x="149" width="14" resource="info_larrow">
<handler name="onclick">
<![CDATA[
- calgrid.keepinfoopen = true;
- var thiscell = calgrid.open_day.id;
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = true;
+ var thiscell =
parent.parent.parent.parent.parent.parent.calgrid.open_day.id;
thiscell = Number(thiscell.substr(4));
var prevcell = 'cell' + Number(thiscell - 1);
if(thiscell > 1){
if(typeof global[prevcell] != 'undefined'){
-
calgrid.daySelectionMgr.select(global[prevcell]);
- calgrid.open_day = global[prevcell];
+
parent.parent.parent.parent.parent.parent.calgrid.daySelectionMgr.select(global[prevcell]);
+
parent.parent.parent.parent.parent.parent.calgrid.open_day =
global[prevcell];
}
}
canvas.eventDataMgr.changeDay(-1);
if(thiscell == 1){
- calgrid.prevMonth();
- calgrid.keepinfoopen = false;
- }
- if(cal_interior.viewstyle == "day"){
- calgrid.showdayview();
- }
- if(cal_interior.viewstyle == "week"){
- calgrid.showweekview();
- }
- calgrid.keepinfoopen = false;
+
parent.parent.parent.parent.parent.parent.calgrid.prevMonth();
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = false;
+ }
+
if(parent.parent.parent.parent.parent.parent.cal_interior.viewstyle
== "day"){
+
parent.parent.parent.parent.parent.parent.calgrid.showdayview();
+ }
+
if(parent.parent.parent.parent.parent.parent.cal_interior.viewstyle
== "week"){
+
parent.parent.parent.parent.parent.parent.calgrid.showweekview();
+ }
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = false;
]]>
</handler>
</basebutton>
<basebutton x="163" width="14" resource="info_rarrow">
<handler name="onclick">
<![CDATA[
- calgrid.keepinfoopen = true;
- var thiscell = calgrid.open_day.id;
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = true;
+ var thiscell =
parent.parent.parent.parent.parent.parent.calgrid.open_day.id;
thiscell = Number(thiscell.substr(4));
var nextcell = 'cell' + Number(thiscell + 1);
if(thiscell < 42){
if(typeof global[nextcell] != 'undefined'){
-
calgrid.daySelectionMgr.select(global[nextcell]);
- calgrid.open_day = global[nextcell];
+
parent.parent.parent.parent.parent.parent.calgrid.daySelectionMgr.select(global[nextcell]);
+
parent.parent.parent.parent.parent.parent.calgrid.open_day =
global[nextcell];
}
}
canvas.eventDataMgr.changeDay(+1);
if(thiscell == 42){
- calgrid.nextMonth();
- calgrid.keepinfoopen = false;
+
parent.parent.parent.parent.parent.parent.calgrid.nextMonth();
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = false;
}
if(thiscell == 35){
if(cell42.visible == false){
- calgrid.nextMonth();
- calgrid.keepinfoopen = false;
+
parent.parent.parent.parent.parent.parent.calgrid.nextMonth();
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = false;
}
}
- if(cal_interior.viewstyle == "day"){
- calgrid.showdayview();
- }
- if(cal_interior.viewstyle == "week"){
- calgrid.showweekview();
- }
- calgrid.keepinfoopen = false;
+
if(parent.parent.parent.parent.parent.parent.cal_interior.viewstyle
== "day"){
+
parent.parent.parent.parent.parent.parent.calgrid.showdayview();
+ }
+
if(parent.parent.parent.parent.parent.parent.cal_interior.viewstyle
== "week"){
+
parent.parent.parent.parent.parent.parent.calgrid.showweekview();
+ }
+
parent.parent.parent.parent.parent.parent.calgrid.keepinfoopen = false;
]]>
</handler>
</basebutton>
@@ -331,7 +331,7 @@
return;
}
- calgrid.contract();
+ parent.parent.calgrid.contract();
this.setAttribute('visible', true);
this.setAttribute('opacity', 1);
@@ -357,7 +357,7 @@
<method name="close_done" >
//Debug.write("close_done");
- calgrid.expand();
+ parent.parent.calgrid.expand();
this.setAttribute('visible', false);
</method>
=======================================
---
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/lzCalendar.lzx
Sat Oct 31 06:17:07 2009
+++
/trunk/singlewebapp/WebContent/openmeetings/modules/lzcalendar/lzCalendar.lzx
Mon Nov 2 02:08:52 2009
@@ -39,7 +39,11 @@
</handler>
</dateSelector>
- <lzCalendarContent name="lzCalendarContent" x="206" />
+ <lzCalendarContent name="lzCalendarContent" x="206">
+ <handler name="oninit">
+ canvas.eventDataMgr.lzCalendarContent = this;
+ </handler>
+ </lzCalendarContent>
</class>
@@ -56,7 +60,7 @@
<handler name="onupdatestop" method="showalldaytitles"
reference="parent.parent.parent.calgrid.gridlayout" />
<method name="showalldaytitles" args="v">
<![CDATA[
- if ( calgrid.gridlayout.displaymode != 'cell' ){
+ if (
parent.parent.parent.calgrid.gridlayout.displaymode != 'cell' ){
var svs = this.subviews;
for (var i = 0; i < 7; i++) {
svs[i].setAttribute('visible', true);
@@ -114,22 +118,22 @@
<view name="viewbuttons" x="2" y="6">
<calButton rightcap="shear" icon="iconDay"
- onclick="calgrid.showdayview()" label="day" />
+
onclick="parent.parent.parent.parent.calgrid.showdayview()" label="day" />
<calButton leftcap="shear" rightcap="shear"
icon="iconWeek"
- onclick="calgrid.showweekview()" label="week" />
+
onclick="parent.parent.parent.parent.calgrid.showweekview()" label="week" />
<calButton leftcap="shear" icon="iconMonth"
- onclick="calgrid.showmonthview(true)"
label="month"/>
+
onclick="parent.parent.parent.parent.calgrid.showmonthview(true)"
label="month"/>
<simplelayout axis="x"/>
</view>
<view name="monthController" x="300" y="6" width="161" >
<calButton rightcap="shear" icon="iconLeftArrow"
- onclick="calgrid.prevMonth()" />
+
onclick="parent.parent.parent.parent.calgrid.prevMonth()" />
<calButton label=" " leftcap="shear" rightcap="shear"
clickable="false" options="releasetolayout" />
<calButton leftcap="shear" leftinset="5" rightinset="9"
icon="iconRightArrow"
- onclick="calgrid.nextMonth()" />
+
onclick="parent.parent.parent.parent.calgrid.nextMonth()" />
<resizelayout axis="x" />
</view>
@@ -167,7 +171,7 @@
<attribute name="viewstyle" type="string" value="month"/>
<animator name="fadeUp" attribute="opacity"
- onstop="dayselectorlook.setAttribute('opacity', 1 )"
+
onstop="parent.parent.dayselectorlook.setAttribute('opacity', 1 )"
duration="1000" from="0" to="1"
start="false"/>
@@ -281,24 +285,26 @@
<!-- Makes the passed day the open day (with the grid in the
background -->
- <method name="openday" args="d" > <![CDATA[
- // d is a reference to a dayview
-
- //make sure it's selected
- this.daySelectionMgr.select( d );
-
- // don't do anything else if already opened
- // if (this['open_day'] == d) { return; }
-
- // Open one day, close the last
-
- // update gridslider
- if(this.gridlayout.displaymode == 'grid')
this.gridlayout.doanimation = false;
-
- this.gridlayout.setopenview(d,true);
-
- this.open_day = d; // Make the requested day the open day
- ]]></method>
+ <method name="openday" args="d" >
+ <![CDATA[
+ // d is a reference to a dayview
+
+ //make sure it's selected
+ this.daySelectionMgr.select( d );
+
+ // don't do anything else if already opened
+ // if (this['open_day'] == d) { return; }
+
+ // Open one day, close the last
+
+ // update gridslider
+ if(this.gridlayout.displaymode == 'grid')
this.gridlayout.doanimation = false;
+
+ this.gridlayout.setopenview(d,true);
+
+ this.open_day = d; // Make the requested day the open day
+ ]]>
+ </method>
<method name="closeday" >
@@ -409,12 +415,12 @@
<!-- These are used by the info panel when it slides in and out
-->
<method name="contract" >
this.gridlayout.doanimation = false;
- this.setAttribute('width', cal_interior.width - 208);
+ this.setAttribute('width', parent.cal_interior.width - 208);
</method>
<method name="expand" >
this.gridlayout.doanimation = false;
- this.setAttribute('width', cal_interior.width);
+ this.setAttribute('width', parent.cal_interior.width);
</method>
<!-- This method sets the dates for all the days in the grid,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en
-~----------~----~----~----~------~----~------~--~---