Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 1452 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 1459 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 1521 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 1523 Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 1848 Warning: Cannot modify header information - headers already sent by (output started at /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc:1452) in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/js/resizable.js.php on line 7 Warning: Cannot modify header information - headers already sent by (output started at /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc:1452) in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 171 Warning: Cannot modify header information - headers already sent by (output started at /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc:1452) in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 172 Warning: Cannot modify header information - headers already sent by (output started at /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc:1452) in /mnt/web310/c3/01/59230901/htdocs/krsit/tool/berufsberatung/functions.inc on line 173 $.fn.reverse = [].reverse; function getSides(jqObject) { var sides = {}; sides.n = Math.ceil(jqObject.offset().top); sides.w = Math.ceil(jqObject.offset().left); sides.s = Math.floor(sides.n + jqObject.outerHeight()); sides.e = Math.floor(sides.w + jqObject.outerWidth()); return sides; } function rectanglesIdentical(r1, r2) { var tolerance = 2; return ((Math.abs(r1.n - r2.n) < tolerance) && (Math.abs(r1.s - r2.s) < tolerance) && (Math.abs(r1.e - r2.e) < tolerance) && (Math.abs(r1.w - r2.w) < tolerance)); } function rectanglesOverlap(r1, r2) { if (((((r1.w > r2.w) && (r1.w < r2.e)) || ((r1.e > r2.w) && (r1.e < r2.e))) && (r1.n < r2.s) && (r1.s > r2.n)) || ((((r1.n > r2.n) && (r1.n < r2.s)) || ((r1.s > r2.n) && (r1.s < r2.s))) && (r1.w < r2.e) && (r1.e > r2.w))) { return true; } if ((r1.w >= r2.w) && (r1.n >= r2.n) && (r1.e <= r2.e) && (r1.s <= r2.s)) { return true; } if ((r2.w >= r1.w) && (r2.n >= r1.n) && (r2.e <= r1.e) && (r2.s <= r1.s)) { return true; } return false; } function overlapsBooked(rectangle, bookedMap) { for (var i = 0; i < bookedMap.length; i++) { if (rectanglesOverlap(rectangle, bookedMap[i])) { return true; } } return false; } function getDataName(jqObject) { var possibleNames = ['room', 'date', 'seconds']; for (var i = 0; i < possibleNames.length; i++) { if (jqObject.data(possibleNames[i]) !== undefined) { return possibleNames[i]; } } return false; } function redrawClones(table) { table.find('div.clone').each(function () { var clone = $(this); var original = clone.prev(); clone.width(original.outerWidth()) .height(original.outerHeight()); }); } function getTableData(table, tableData) { var rtl = ((table.css('direction') !== undefined) && table.css('direction').toLowerCase() === 'rtl'); var resolution = table.data('resolution'); tableData.x = {}; tableData.x.data = []; var columns = table.find('thead tr:first-child th:visible').not('.first_last'); if (rtl) { columns.reverse(); } columns.each(function () { if (tableData.x.key === undefined) { tableData.x.key = getDataName($(this)); } tableData.x.data.push({ coord: $(this).offset().left, value: $(this).data(tableData.x.key) }); }); if (rtl) { columns.filter(':first').each(function () { var value = null; if (tableData.x.key === 'seconds') { value = tableData.x.data[0].value + resolution; } var edge = $(this).offset().left; tableData.x.data.unshift({coord: edge, value: value}); }); } columns.filter(':last').each(function () { var value = null; if (tableData.x.key === 'seconds') { value = tableData.x.data[tableData.x.data.length - 1].value + resolution; } var edge = $(this).offset().left + $(this).outerWidth(); tableData.x.data.push({coord: edge, value: value}); }); tableData.y = {}; tableData.y.data = []; var rows = table.find('tbody td:first-child').not('.multiple_booking td'); rows.each(function () { if (tableData.y.key === undefined) { tableData.y.key = getDataName($(this)); } tableData.y.data.push({ coord: $(this).offset().top, value: $(this).data(tableData.y.key) }); }); rows.filter(':last').each(function () { var value = null; if (tableData.y.key === 'seconds') { value = tableData.y.data[tableData.y.data.length - 1].value + resolution; } tableData.y.data.push({ coord: $(this).offset().top + $(this).outerHeight(), value: value }); }); } function outsideTable(tableData, p) { return ((p.x < tableData.x.data[0].coord) || (p.y < tableData.y.data[0].coord) || (p.x > tableData.x.data[tableData.x.data.length - 1].coord) || (p.y > tableData.y.data[tableData.y.data.length - 1].coord)); } function snapToGrid(tableData, div, side, force) { var snapGap = (force) ? 100000 : 30; var tolerance = 2; var isLR = (side === 'left') || (side === 'right'); var data = (isLR) ? tableData.x.data : tableData.y.data; var topLeft, bottomRight, divTop, divLeft, divWidth, divHeight, thisCoord, gap, gapTopLeft, gapBottomRight; divTop = div.offset().top; divLeft = div.offset().left; divWidth = div.outerWidth(); divHeight = div.outerHeight(); switch (side) { case 'top': thisCoord = divTop; break; case 'bottom': thisCoord = divTop + divHeight; break; case 'left': thisCoord = divLeft; break; case 'right': thisCoord = divLeft + divWidth; break; } for (var i = 0; i < (data.length - 1); i++) { topLeft = data[i].coord + 1; bottomRight = data[i + 1].coord; gapTopLeft = thisCoord - topLeft; gapBottomRight = bottomRight - thisCoord; if (((gapTopLeft > 0) && (gapBottomRight > 0)) || ((i === 0) && (gapTopLeft < 0)) || ((i === (data.length - 2)) && (gapBottomRight < 0))) { gap = bottomRight - topLeft; if ((gapTopLeft <= gap / 2) && (gapTopLeft < snapGap)) { switch (side) { case 'left': div.offset({top: divTop, left: topLeft}); div.width(divWidth + gapTopLeft); break; case 'right': if ((divWidth - gapTopLeft) < tolerance) { div.width(divWidth + gapBottomRight); } else { div.width(divWidth - gapTopLeft); } break; case 'top': div.offset({top: topLeft, left: divLeft}); div.height(divHeight + gapTopLeft); break; case 'bottom': div.height(divHeight - gapTopLeft); break; } return; } else if ((gapBottomRight <= gap / 2) && (gapBottomRight < snapGap)) { switch (side) { case 'left': if ((divWidth - gapBottomRight) < tolerance) { div.offset({top: div.Top, left: topLeft}); div.width(divWidth + gapTopLeft); } else { div.offset({top: divTop, left: bottomRight}); div.width(divWidth - gapBottomRight); } break; case 'right': div.width(divWidth + gapBottomRight); break; case 'top': div.offset({top: bottomRight, left: divLeft}); div.height(divHeight - gapBottomRight); break; case 'bottom': div.height(divHeight + gapBottomRight); break; } return; } } } } function getBookingParams(table, tableData, div) { var rtl = (table.css('direction').toLowerCase() === 'rtl'), params = {}, data, tolerance = 2, cell = {x: {}, y: {}}, i, axis; 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 (axis in cell) { if (cell.hasOwnProperty(axis)) { data = tableData[axis].data; if (params[tableData[axis].key] === undefined) { params[tableData[axis].key] = []; } if (rtl && (axis === 'x')) { for (i = data.length - 1; i >= 0; i--) { if ((data[i].coord + tolerance) < cell[axis].start) { if ((tableData[axis].key === 'seconds') || (params[tableData[axis].key].length === 0)) { params[tableData[axis].key].push(data[i].value); } break; } if ((data[i].coord + tolerance) < cell[axis].end) { params[tableData[axis].key].push(data[i].value); } } } else { for (i = 0; i < data.length; i++) { if ((data[i].coord + tolerance) > cell[axis].end) { if ((tableData[axis].key === 'seconds') || (params[tableData[axis].key].length === 0)) { params[tableData[axis].key].push(data[i].value); } break; } if ((data[i].coord + tolerance) > cell[axis].start) { params[tableData[axis].key].push(data[i].value); } } } } } return params; } function getRowNumber(tableData, y) { for (var i = 0; i < tableData.y.data.length - 1; i++) { if (y >= tableData.y.data[i].coord && y < tableData.y.data[i + 1].coord) { return i; } } return null; } var highlightRowLabels = function (table, tableData, div) { if (highlightRowLabels.rows === undefined) { highlightRowLabels.rows = []; table.find('tbody tr').each(function () { highlightRowLabels.rows.push($(this).find('td.row_labels')); }); } var divStartRow = getRowNumber(tableData, div.offset().top); var divEndRow = getRowNumber(tableData, 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'); } } }; function clearRowLabels() { if (highlightRowLabels.rows !== undefined) { for (var i = 0; i < highlightRowLabels.rows.length; i++) { highlightRowLabels.rows[i].removeClass('selected'); } } } var oldInitResizable = init; init = function (args) { oldInitResizable.apply(this, [args]); if (!lteIE8) { $('table.dwm_main').load(function () { var table = $(this); if (table.find('tbody').data('empty')) { return; } var tableData = {}; getTableData(table, tableData); var bookedMap = []; var mouseDown = false; var downHandler = function (e) { mouseDown = true; turnOffPageRefresh(); table.find('td').not('td.new, td.row_labels').each(function () { bookedMap.push(getSides($(this))); }); table.wrap('