fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [14029] fixing schedule


From: Saul
Subject: [Fmsystem-commits] [14029] fixing schedule
Date: Sat, 26 Sep 2015 00:41:32 +0000

Revision: 14029
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14029
Author:   psaul
Date:     2015-09-26 00:41:31 +0000 (Sat, 26 Sep 2015)
Log Message:
-----------
fixing schedule

Modified Paths:
--------------
    branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
    branches/dev-syncromind/booking/inc/class.uibuilding.inc.php
    branches/dev-syncromind/booking/inc/class.uiresource.inc.php
    branches/dev-syncromind/booking/js/booking/schedule.js
    branches/dev-syncromind/booking/templates/base/booking_edit.xsl
    branches/dev-syncromind/booking/templates/base/building_schedule.xsl
    branches/dev-syncromind/booking/templates/base/resource_schedule.xsl

Modified: branches/dev-syncromind/booking/inc/class.uiapplication.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/inc/class.uiapplication.inc.php     
2015-09-26 00:41:31 UTC (rev 14029)
@@ -787,7 +787,7 @@
 
                         $application['tabs'] = 
phpgwapi_jquery::tabview_generate($tabs, $active_tab);
                         self::add_javascript('booking', 'booking', 
'application.js');
-                                               self::adddatetimepicker();
+//                                             self::adddatetimepicker();
                        
                        self::render_template_xsl('application_new', 
array('application' => $application, 'activities' => $activities, 'agegroups' 
=> $agegroups, 'audience' => $audience,'config' => $application_text));
                }
@@ -846,9 +846,9 @@
                                }
                        }
                        $this->flash_form_errors($errors);
+                        $this->set_case_officer($application);
                        self::add_javascript('booking', 'booking', 
'application.js');
-                       self::adddatetimepicker();
-                       $this->set_case_officer($application);
+//                     self::adddatetimepicker();
                        
                        $application['resources_json'] = 
json_encode(array_map('intval', $application['resources']));
                        $application['accepted_documents_json'] = 
json_encode($application['accepted_documents']);

Modified: branches/dev-syncromind/booking/inc/class.uibuilding.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uibuilding.inc.php        
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/inc/class.uibuilding.inc.php        
2015-09-26 00:41:31 UTC (rev 14029)
@@ -251,7 +251,8 @@
                                'building_id' => $building['id'], 
                                'phpgw_return_as' => 'json',
                        ));
-                       self::add_javascript('booking', 'booking', 
'schedule_new.js');
+                       self::add_javascript('booking', 'booking', 
'schedule.js');
+                        phpgwapi_jquery::load_widget("datepicker");
             
                         $tabs = array();
                        $tabs['generic']        = array('label' => 
lang('Building Schedule'), 'link' => '#building_schedule');
@@ -259,6 +260,6 @@
             
                         $building['tabs'] = 
phpgwapi_jquery::tabview_generate($tabs, $active_tab);
             
-                       self::render_template_xsl('schedule', array('building' 
=> $building));
+                       self::render_template_xsl('building_schedule', 
array('building' => $building));
                }
        }

Modified: branches/dev-syncromind/booking/inc/class.uiresource.inc.php
===================================================================
--- branches/dev-syncromind/booking/inc/class.uiresource.inc.php        
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/inc/class.uiresource.inc.php        
2015-09-26 00:41:31 UTC (rev 14029)
@@ -247,7 +247,17 @@
                                'resource_id' => $resource['id'], 
                                'phpgw_return_as' => 'json',
                        ));
+                        
+                        $tabs = array();
+                       $tabs['generic'] = array('label' => lang('Resource 
Schedule'), 'link' => '#resource_schedule');
+                       $active_tab = 'generic';
+            
+                        $resource['tabs'] = 
phpgwapi_jquery::tabview_generate($tabs, $active_tab);
+                        
                        self::add_javascript('booking', 'booking', 
'schedule.js');
+                        
+                        phpgwapi_jquery::load_widget("datepicker");
+                        
                        self::render_template('resource_schedule', 
array('resource' => $resource));
                }
        }

Modified: branches/dev-syncromind/booking/js/booking/schedule.js
===================================================================
--- branches/dev-syncromind/booking/js/booking/schedule.js      2015-09-26 
00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/js/booking/schedule.js      2015-09-26 
00:41:31 UTC (rev 14029)
@@ -1,3 +1,105 @@
+var schedule = new Array();
+
+schedule.renderSchedule = function(container, url, date, colFormatter, 
includeResource) {
+    while(date.getDay() != 1) {
+        date.setDate(date.getDate()-1);
+    }
+//    var container = document.getElementById(container);
+//    container.innerHTML = '';
+    url += '&date=' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 
date.getDate();
+
+    var lang = {
+            WEEKDAYS_FULL: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 
'Thursday', 'Friday', 'Saturday'],
+            MONTHS_LONG: ['January', 'February', 'March', 'April', 'May', 
'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+            LBL_TIME: 'Time',
+            LBL_RESOURCE: 'Resource',
+            LBL_WEEK: 'Week'
+    };
+    
+    var colDefs = [{key: 'time', label: date.getFullYear() +'<br/>' + 
lang['LBL_TIME']}];
+    if(includeResource) {
+        colDefs.push({key: 'resource', label: lang['LBL_RESOURCE'], formatter: 
'scheduleResourceColumn'});
+    }
+    schedule.dates = {};
+    var keys = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+    for (var i=0;i<7;i++) {
+        var d = new Date(date.getFullYear(), date.getMonth(), date.getDate());
+        d.setDate(d.getDate() + i);
+        var x = (i<6) ? i+1 : 0;
+        schedule.dates[keys[x]] = d;
+        colDefs.push({key: keys[x], label: lang['WEEKDAYS_FULL'][x] + '<br>' + 
lang['MONTHS_LONG'][d.getMonth()] + ' ' + d.getDate(), formatter: 
'scheduleDateColumn', date: d});
+    }
+    var r = [{n: 'ResultSet'},{n: 'Result'}];
+//    createta d u c r cl
+    createTableSchedule(container, url, colDefs, r, "pure-table");
+
+};
+
+schedule.setupWeekPicker = function(){}
+
+$(function() {
+    $( "#cal_container #datepicker" ).datepicker({
+        showWeek: true,
+        changeMonth: true,
+        changeYear: true,
+        firstDay: 1,
+        onSelect: function(a,e){
+            console.log(a);
+            var date = new Date(a);
+            schedule.updateSchedule(date);
+        }
+    });
+    $("#cal_container #pickerImg").on('click', function(){
+        $( "#cal_container #datepicker" ).datepicker( "show" );
+    });
+});
+
+schedule.updateSchedule = function (date) {
+    schedule.week = $.datepicker.iso8601Week(date);
+    $('#cal_container #numberWeek').text(schedule.week);
+    $("#cal_container #datepicker").datepicker("setDate", date);
+    
+    var url = self.location.href;
+    url = url.substr(0, (url.indexOf("#date")));
+    url += '#date=' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 
date.getDate();
+    location.replace(url);
+    schedule.renderSchedule('schedule_container', schedule.datasourceUrl, 
date, schedule.backendScheduleColorFormatter, schedule.includeResource);
+    schedule.date = date;
+}
+
+schedule.moveWeek = function (n) {
+    var date = schedule.date;
+    while(date.getDay() != 1) {
+        date.setDate(date.getDate()-1);
+    }
+    date.setDate(date.getDate() + n);
+    schedule.updateSchedule(date);
+}
+schedule.prevWeek = function () {
+    schedule.moveWeek(-7)
+};
+schedule.nextWeek = function () {
+    schedule.moveWeek(7)
+}
+
+
+schedule.nextWeek2 = function () {
+    var date = schedule.date;
+    while(date.getDay() != 1) {
+        date.setDate(date.getDate()-1);
+    }
+    date.setDate(date.getDate()+7);
+    var url = self.location.href;
+    url = url.substr(0, (url.indexOf("#date")));
+    console.log(url);
+    url += '#date=' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + 
date.getDate();
+    console.log(url);
+    location.replace(url);
+    location.reload();
+};
+
+
+/*
 colors = ['color1', 'color2', 'color3', 'color4', 'color5', 'color6', 
'color7', 'color8', 'color9', 'color10',
                  'color11', 'color12', 'color13', 'color14', 'color15', 
'color16', 'color17', 'color18', 'color19', 'color20',
           'color21', 'color22', 'color23', 'color24', 'color25', 'color26', 
'color27', 'color28', 'color29', 'color30',
@@ -248,4 +350,4 @@
        var o = YAHOO.util.Dom.get('overlay-info');
        o.parentNode.removeChild(o);
 }
-
+*/

Modified: branches/dev-syncromind/booking/templates/base/booking_edit.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/booking_edit.xsl     
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/templates/base/booking_edit.xsl     
2015-09-26 00:41:31 UTC (rev 14029)
@@ -321,7 +321,7 @@
         var season_id = '<xsl:value-of select="booking/season_id"/>';
         var group_id = '<xsl:value-of select="booking/group_id"/>';
         var initialSelection = <xsl:value-of select="booking/resources_json"/>;
-       var lang = <xsl:value-of select="php:function('js_lang', 'Resource 
Type')"/>;
+       var lang = <xsl:value-of select="php:function('js_lang','Name', 
'Resource Type')"/>;
     </script>
     <!--script type="text/javascript">
         YAHOO.booking.season_id = '<xsl:value-of select="booking/season_id"/>';

Modified: branches/dev-syncromind/booking/templates/base/building_schedule.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/building_schedule.xsl        
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/templates/base/building_schedule.xsl        
2015-09-26 00:41:31 UTC (rev 14029)
@@ -1,7 +1,14 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-       <!--xsl:call-template name="yui_booking_i18n"/-->
-       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
-       <input id="yui-history-field" type="hidden"/>
+    <style typ="text/css" rel="stylesheet">
+        #week-selector {list-style: outside none none;}
+        #week-selector li {display: inline-block;}
+        #cal_container {margin: 0 20px;}
+        #cal_container #datepicker {width: 2px;opacity: 0;position: 
absolute;display:none;}
+        #cal_container #numberWeek {width: 20px;display: inline-block;}
+    </style>
+    <!--xsl:call-template name="yui_booking_i18n"/-->
+    <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
+    <input id="yui-history-field" type="hidden"/>
        
     <!--div id="content">
         <ul class="pathway">
@@ -20,43 +27,69 @@
             <li><xsl:value-of select="php:function('lang', 'Schedule')"/></li>
         </ul-->
 
-        <xsl:call-template name="msgbox"/>
-    <form action="" method="POST" id='form'  class="pure-form 
pure-form-aligned" name="form">  
-    <input type="hidden" name="tab" value=""/>
-    <div id="tab-content">
-        <xsl:value-of disable-output-escaping="yes" select="building/tabs"/>
-        <div id="building_schedule"> 
-    
-               <ul id="week-selector">
-                       <li><a href="#" onclick="YAHOO.booking.prevWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Previous 
week')"/></a></li>
-                       <li id="cal_container"/>
-                       <li><a href="#" onclick="YAHOO.booking.nextWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Next 
week')"/></a></li>
-               </ul>
-
-        <div id="schedule_container"></div>
-        
+    <xsl:call-template name="msgbox"/>
+    <form action="" method="POST" id='form'  class="pure-form 
pure-form-aligned" name="form">
+        <input type="hidden" name="tab" value=""/>
+        <div id="tab-content">
+            <xsl:value-of disable-output-escaping="yes" 
select="building/tabs"/>
+            <div id="building_schedule">
+                <ul id="week-selector">
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.prevWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Previous week')"/></span></li>
+                    <li id="cal_container">
+                        <div>
+                            <span><xsl:value-of select="php:function('lang', 
'Week')" />: </span>
+                            <label id="numberWeek"></label>
+                            <input type="text" id="datepicker" />
+                            <img id="pickerImg" 
src="/portico/phpgwapi/templates/base/images/cal.png" />
+                        </div>
+                    </li>
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.nextWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Next week')"/></span></li>
+                </ul>
+                <div id="schedule_container"></div>
+            </div>
         </div>
-    </div>
     </form>
     <!--/div-->
 
-<script type="text/javascript">
-YAHOO.util.Event.addListener(window, "load", function() {
-       YAHOO.booking.setupWeekPicker('cal_container');
-       YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
-    var handleHistoryNavigation = function (state) {
-               YAHOO.booking.date = parseISO8601(state);
-               YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.backendScheduleColorFormatter, true);
-    };
-    var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="building/date"/>';
-    YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
-    YAHOO.util.History.onReady(function() {
-               var state = YAHOO.util.History.getBookmarkedState("date") || 
initialRequest;
-               if(state)
-                       handleHistoryNavigation(state);
+    <script type="text/javascript">
+        $(window).load(function() {
+            schedule.setupWeekPicker('cal_container');
+            schedule.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
+            schedule.includeResource = true;
+            var handleHistoryNavigation = function (state) {
+                schedule.date = parseISO8601(state);
+                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, schedule.backendScheduleColorFormatter, 
true);
+            };
+
+            var initialRequest = getUrlData("date") || '<xsl:value-of 
select="building/date"/>';
+
+            var state = getUrlData("date") || initialRequest;
+            if (state){
+                handleHistoryNavigation(state);
+                schedule.week = $.datepicker.iso8601Week(schedule.date);
+                $('#cal_container #numberWeek').text(schedule.week);
+                $("#cal_container #datepicker").datepicker("setDate", 
parseISO8601(state));
+            }
+        });
+
+    /*
+    YAHOO.util.Event.addListener(window, "load", function() {
+            YAHOO.booking.setupWeekPicker('cal_container');
+            YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="building/datasource_url"/>';
+        var handleHistoryNavigation = function (state) {
+                    YAHOO.booking.date = parseISO8601(state);
+                    YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.backendScheduleColorFormatter, true);
+        };
+        var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="building/date"/>';
+        YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
+        YAHOO.util.History.onReady(function() {
+                    var state = YAHOO.util.History.getBookmarkedState("date") 
|| initialRequest;
+                    if(state)
+                            handleHistoryNavigation(state);
+        });
+        YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");
     });
-       YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");       
-});
-</script>
-
+    */
+    
+    </script>
 </xsl:template>

Modified: branches/dev-syncromind/booking/templates/base/resource_schedule.xsl
===================================================================
--- branches/dev-syncromind/booking/templates/base/resource_schedule.xsl        
2015-09-26 00:36:36 UTC (rev 14028)
+++ branches/dev-syncromind/booking/templates/base/resource_schedule.xsl        
2015-09-26 00:41:31 UTC (rev 14029)
@@ -1,58 +1,102 @@
 <xsl:template match="data" xmlns:php="http://php.net/xsl";>
-       <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
-       <input id="yui-history-field" type="hidden"/>
-       <div id="content">
-               <ul class="pathway">
-                       <li>
-                               <a>
-                                       <xsl:attribute 
name="href"><xsl:value-of select="resource/buildings_link"/></xsl:attribute>
-                                       <xsl:value-of 
select="php:function('lang', 'Buildings')"/>
-                               </a>
-                       </li>
-                       <li>
-                               <a>
-                                       <xsl:attribute 
name="href"><xsl:value-of select="resource/building_link"/></xsl:attribute>
-                                       <xsl:value-of 
select="resource/building_name"/>
-                               </a>
-                       </li>
-                       <li>
-                               <a>
-                                       <xsl:attribute 
name="href"><xsl:value-of select="resource/resource_link"/></xsl:attribute>
-                                       <xsl:value-of select="resource/name"/>
-                               </a>
-                       </li>
-                       <li><xsl:value-of select="php:function('lang', 
'Schedule')"/></li>
-               </ul>
+    <style typ="text/css" rel="stylesheet">
+        #week-selector {list-style: outside none none;}
+        #week-selector li {display: inline-block;}
+        #cal_container {margin: 0 20px;}
+        #cal_container #datepicker {width: 2px;opacity: 0;position: 
absolute;display:none;}
+        #cal_container #numberWeek {width: 20px;display: inline-block;}
+    </style>
+    <!--xsl:call-template name="yui_booking_i18n"/-->
+    <iframe id="yui-history-iframe" 
src="phpgwapi/js/yahoo/history/assets/blank.html" 
style="position:absolute;top:0; left:0;width:1px; 
height:1px;visibility:hidden;"></iframe>
+    <input id="yui-history-field" type="hidden"/>
+    <!--div id="content">
+        <ul class="pathway">
+            <li>
+                <a>
+                    <xsl:attribute name="href"><xsl:value-of 
select="resource/buildings_link"/></xsl:attribute>
+                    <xsl:value-of select="php:function('lang', 'Buildings')"/>
+                </a>
+            </li>
+            <li>
+                <a>
+                    <xsl:attribute name="href"><xsl:value-of 
select="resource/building_link"/></xsl:attribute>
+                    <xsl:value-of select="resource/building_name"/>
+                </a>
+            </li>
+            <li>
+                <a>
+                    <xsl:attribute name="href"><xsl:value-of 
select="resource/resource_link"/></xsl:attribute>
+                    <xsl:value-of select="resource/name"/>
+                </a>
+            </li>
+            <li><xsl:value-of select="php:function('lang', 'Schedule')"/></li>
+        </ul-->
 
-               <xsl:call-template name="msgbox"/>
-               <xsl:call-template name="yui_booking_i18n"/>
-               
-               <ul id="week-selector">
-                       <li><a href="#" onclick="YAHOO.booking.prevWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Previous 
week')"/></a></li>
-                       <li id="cal_container"/>
-                       <li><a href="#" onclick="YAHOO.booking.nextWeek(); 
return false"><xsl:value-of select="php:function('lang', 'Next 
week')"/></a></li>
-               </ul>
-               <div id="schedule_container"/>
-       </div>
+    <xsl:call-template name="msgbox"/>
+    <form action="" method="POST" id='form'  class="pure-form 
pure-form-aligned" name="form">
+        <input type="hidden" name="tab" value=""/>
+        <div id="tab-content">
+            <xsl:value-of disable-output-escaping="yes" 
select="resource/tabs"/>
+            <div id="resource_schedule">
+                <ul id="week-selector">
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.prevWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Previous week')"/></span></li>
+                    <li id="cal_container">
+                        <div>
+                            <span><xsl:value-of select="php:function('lang', 
'Week')" />: </span>
+                            <label id="numberWeek"></label>
+                            <input type="text" id="datepicker" />
+                            <img id="pickerImg" 
src="/portico/phpgwapi/templates/base/images/cal.png" />
+                        </div>
+                    </li>
+                    <li><span class="pure-button pure-button-primary" 
onclick="schedule.nextWeek(); return false"><xsl:value-of 
select="php:function('lang', 'Next week')"/></span></li>
+                </ul>
+                <div id="schedule_container"></div>
+            </div>
+        </div>
+    </form>
+                
+    <!--/div-->
 
-<script type="text/javascript">
-YAHOO.util.Event.addListener(window, "load", function() {
-       YAHOO.booking.setupWeekPicker('cal_container');
-       YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="resource/datasource_url"/>';
-       
-    var handleHistoryNavigation = function (state) {
-               YAHOO.booking.date = parseISO8601(state);
-               YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.backendScheduleColorFormatter, false);
-    };
-    var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="resource/date"/>';
-    YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
-    YAHOO.util.History.onReady(function() {
-               var state = YAHOO.util.History.getBookmarkedState("date") || 
initialRequest;
-               if(state)
-                       handleHistoryNavigation(state);
+    <script type="text/javascript">
+        $(window).load(function() {
+            schedule.setupWeekPicker('cal_container');
+            schedule.datasourceUrl = '<xsl:value-of 
select="resource/datasource_url"/>';
+            schedule.includeResource = false;
+            var handleHistoryNavigation = function (state) {
+                schedule.date = parseISO8601(state);
+                schedule.renderSchedule('schedule_container', 
schedule.datasourceUrl, schedule.date, schedule.backendScheduleColorFormatter, 
false);
+            };
+
+            var initialRequest = getUrlData("date") || '<xsl:value-of 
select="resource/date"/>';
+
+            var state = getUrlData("date") || initialRequest;
+            if (state){
+                handleHistoryNavigation(state);
+                schedule.week = $.datepicker.iso8601Week(schedule.date);
+                $('#cal_container #numberWeek').text(schedule.week);
+                $("#cal_container #datepicker").datepicker("setDate", 
parseISO8601(state));
+            }
+        });
+
+    /*
+    YAHOO.util.Event.addListener(window, "load", function() {
+            YAHOO.booking.setupWeekPicker('cal_container');
+            YAHOO.booking.datasourceUrl = '<xsl:value-of 
select="resource/datasource_url"/>';
+
+        var handleHistoryNavigation = function (state) {
+                    YAHOO.booking.date = parseISO8601(state);
+                    YAHOO.booking.renderSchedule('schedule_container', 
YAHOO.booking.datasourceUrl, YAHOO.booking.date, 
YAHOO.booking.backendScheduleColorFormatter, false);
+        };
+        var initialRequest = YAHOO.util.History.getBookmarkedState("date") || 
'<xsl:value-of select="resource/date"/>';
+        YAHOO.util.History.register("date", initialRequest, 
handleHistoryNavigation);
+        YAHOO.util.History.onReady(function() {
+                    var state = YAHOO.util.History.getBookmarkedState("date") 
|| initialRequest;
+                    if(state)
+                            handleHistoryNavigation(state);
+        });
+        YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");      
     });
-       YAHOO.util.History.initialize("yui-history-field", 
"yui-history-iframe");       
-});
-</script>
+    */
+    </script>
 
 </xsl:template>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]