Revision: 2140
http://mrbs.svn.sourceforge.net/mrbs/?rev=2140&view=rev
Author: cimorrison
Date: 2011-10-23 15:41:19 +0000 (Sun, 23 Oct 2011)
Log Message:
-----------
* Allowed individual members of a series to be dragged along the time axis
* Added highlighting of row labels when dragging an existing booking
Modified Paths:
--------------
mrbs/branches/draggable_bookings/web/Themes/default/header.inc
mrbs/branches/draggable_bookings/web/functions_table.inc
mrbs/branches/draggable_bookings/web/mrbs.css.php
Modified: mrbs/branches/draggable_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/Themes/default/header.inc
2011-10-20 21:10:42 UTC (rev 2139)
+++ mrbs/branches/draggable_bookings/web/Themes/default/header.inc
2011-10-23 15:41:19 UTC (rev 2140)
@@ -1659,7 +1659,50 @@
return null;
}
-
+ <?php
+ // function to highlight the row labels in the table that are level
+ // with div
+ ?>
+ var highlightRowLabels = function (div)
+ {
+ if (highlightRowLabels.rows === undefined)
+ {
+ <?php // Cache the row label cells in an array ?>
+ highlightRowLabels.rows = [];
+ table.find('tbody tr').each(function() {
+ highlightRowLabels.rows.push($(this).find('td.row_labels'));
+ });
+ }
+ var divStartRow = getRowNumber(div.offset().top);
+ var divEndRow = getRowNumber(div.offset().top + div.outerHeight());
+ for (var i=0; i<highlightRowLabels.rows.length ; i++)
+ {
+ if (((divStartRow === null) || (divStartRow <= i)) &&
+ ((divEndRow === null) || (i < divEndRow)))
+ {
+ highlightRowLabels.rows[i].addClass('selected');
+ }
+ else
+ {
+ highlightRowLabels.rows[i].removeClass('selected');
+ }
+ }
+ }
+
+
+ <?php // Remove any highlighting that has been applied to the row
labels ?>
+ function clearRowLabels()
+ {
+ if (highlightRowLabels.rows !== undefined)
+ {
+ for (var i=0; i<highlightRowLabels.rows.length; i++)
+ {
+ highlightRowLabels.rows[i].removeClass('selected');
+ }
+ }
+ }
+
+
var tableData = {};
getTableData(table, tableData);
@@ -1678,13 +1721,6 @@
table.find('td').not('td.new, td.row_labels').each(function() {
bookedMap.push(getSides($(this)));
});
- <?php // Cache the row label cells in an array ?>
- downHandler.rowLabels = [];
- downHandler.nRows = 0;
- table.find('tbody tr').each(function() {
- downHandler.rowLabels.push($(this).find('td.row_labels'));
- downHandler.nRows++;
- });
<?php // Apply a wrapper to turn off highlighting ?>
table.wrap('<div class="resizing"><\/div>');
var jqTarget = $(e.target);
@@ -1792,11 +1828,7 @@
{
box.addClass('outside');
moveHandler.outside = true;
- <?php // and remove the row highlighting ?>
- for (var i=0; i<downHandler.nRows; i++)
- {
- downHandler.rowLabels[i].removeClass('selected');
- }
+ clearRowLabels();
}
}
else if (moveHandler.outside)
@@ -1806,24 +1838,11 @@
}
<?php
// Highlight the corresponding row label cells (provided we are
- // inside the table
+ // inside the table)
?>
if (!moveHandler.outside)
{
- var boxStartRow = getRowNumber(box.offset().top);
- var boxEndRow = getRowNumber(box.offset().top +
box.outerHeight());
- for (var i=0; i<downHandler.nRows ; i++)
- {
- if (((boxStartRow === null) || (boxStartRow <= i)) &&
- ((boxEndRow === null) || (i < boxEndRow)))
- {
- downHandler.rowLabels[i].addClass('selected');
- }
- else
- {
- downHandler.rowLabels[i].removeClass('selected');
- }
- }
+ highlightRowLabels(box);
}
};
@@ -1975,7 +1994,9 @@
{
snapToGrid(divClone, 'bottom');
}
-
+
+ highlightRowLabels(divClone);
+
divResize.lastPosition = $.extend({}, divClone.position());
divResize.lastSize = {width: divClone.outerWidth(),
height: divClone.outerHeight()};
@@ -2179,6 +2200,16 @@
var handles = 'all';
+ if ($(this).hasClass('series'))
+ {
+ <?php
+ // We only only members of a series to have their duration
changed.
+ // It would be a bit confusing to have an individual member of
a
+ // series dragged across days to make it a new daily series,
or rooms
+ // to create new bookings in other rooms.
+ ?>
+ handles = '<?php echo ($times_along_top) ? "e,w" : "n,s" ?>';
+ }
<?php
if (!$is_admin)
{
Modified: mrbs/branches/draggable_bookings/web/functions_table.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/functions_table.inc 2011-10-20
21:10:42 UTC (rev 2139)
+++ mrbs/branches/draggable_bookings/web/functions_table.inc 2011-10-23
15:41:19 UTC (rev 2140)
@@ -436,12 +436,15 @@
{
$c .= " tentative";
}
- // Add a class to single entry bookings (ie not series members) that this
- // user is allowed to edit so that the JavaScript can turn them into
resizable
- // bookings
- if (!$is_repeat && getWritable($cell[0]['create_by'], $user,
$cell[0]['room_id']))
+ // Add a class to bookings that this user is allowed to edit so that the
+ // JavaScript can turn them into resizable bookings
+ if (getWritable($cell[0]['create_by'], $user, $cell[0]['room_id']))
{
$c .= " writable";
+ if ($is_repeat)
+ {
+ $c .= " series";
+ }
}
}
else
Modified: mrbs/branches/draggable_bookings/web/mrbs.css.php
===================================================================
--- mrbs/branches/draggable_bookings/web/mrbs.css.php 2011-10-20 21:10:42 UTC
(rev 2139)
+++ mrbs/branches/draggable_bookings/web/mrbs.css.php 2011-10-23 15:41:19 UTC
(rev 2140)
@@ -305,7 +305,8 @@
.resizing .dwm_main tbody tr:hover td.row_labels a:link {color: <?php echo
$anchor_link_color_header ?>}
.resizing .dwm_main tbody tr:hover td.row_labels a:visited {color: <?php echo
$anchor_link_color_header ?>}
.resizing .dwm_main tr td.row_labels.selected {background-color: <?php echo
$row_highlight_color ?>}
-.resizing .dwm_main tr td.row_labels.selected a:link {color: <?php echo
$standard_font_color ?>}
+.resizing .dwm_main tr:hover td.row_labels.selected,
+.resizing .dwm_main tr td.row_labels.selected a:link,
.resizing .dwm_main tr td.row_labels.selected a:visited {color: <?php echo
$standard_font_color ?>}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits