Revision: 2091
http://mrbs.svn.sourceforge.net/mrbs/?rev=2091&view=rev
Author: cimorrison
Date: 2011-10-14 13:54:45 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
Implemented function to get parameters for the new booking
Modified Paths:
--------------
mrbs/branches/draggable_bookings/web/Themes/default/header.inc
Modified: mrbs/branches/draggable_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/Themes/default/header.inc
2011-10-14 13:04:39 UTC (rev 2090)
+++ mrbs/branches/draggable_bookings/web/Themes/default/header.inc
2011-10-14 13:54:45 UTC (rev 2091)
@@ -1454,12 +1454,42 @@
}
+ <?php
+ // Return the parameters for the booking represented by div
+ // The result is an object with property of the data name (eg
+ // 'seconds', 'time', 'room') and each property is an array of
+ // the values for that booking (for example an array of room ids)
+ ?>
function getBookingParams(div)
{
- var xStart = div.offset().left;
- var xEnd = xStart + div.outerWidth();
- var yStart = div.offset().top;
- var yEnd = yStart + div.outerHeight();
+ var params = {};
+ var data;
+ var tolerance = 2; <?php //px ?>
+ var cell = {x: {}, y: {}}
+ cell.x.start = div.offset().left;
+ cell.y.start = div.offset().top;
+ cell.x.end = cell.x.start + div.outerWidth();
+ cell.y.end = cell.y.start + div.outerHeight();
+ for (var axis in cell)
+ {
+ data = tableData[axis].data;
+ for (var i=0; i<data.length; i++)
+ {
+ if ((data[i].coord + tolerance) > cell[axis].end)
+ {
+ break;
+ }
+ if ((data[i].coord + tolerance) > cell[axis].start)
+ {
+ if (params[tableData[axis].key] === undefined)
+ {
+ params[tableData[axis].key] = [];
+ }
+ params[tableData[axis].key].push(data[i].value);
+ }
+ }
+ }
+ return params;
}
@@ -1588,7 +1618,7 @@
<?php // Remove the resizing wrapper so that highlighting comes
back on ?>
$('table.dwm_main').unwrap();
-
+ var newParams = getBookingParams(divClone);
} <?php // divResizeStop ?>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits