From 5773e599f142ea1b1106dbdbda219dfb14986878 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Fri, 5 Aug 2016 12:06:50 +0200 Subject: grobe Integration vom Raumplaner. --- modules-available/roomplanner/clientscript.js | 125 ++++ modules-available/roomplanner/config.json | 4 + .../images/electricalDevices_wIP/copier.png | Bin 0 -> 35255 bytes .../images/electricalDevices_wIP/pc.png | Bin 0 -> 45209 bytes .../images/electricalDevices_wIP/pc_east.png | Bin 0 -> 29729 bytes .../images/electricalDevices_wIP/pc_north.png | Bin 0 -> 24902 bytes .../images/electricalDevices_wIP/pc_south.png | Bin 0 -> 24789 bytes .../images/electricalDevices_wIP/pc_west.png | Bin 0 -> 29724 bytes .../images/electricalDevices_wIP/printer.png | Bin 0 -> 9472 bytes .../images/electricalDevices_wIP/telephone.png | Bin 0 -> 31658 bytes .../images/electricalDevices_woIP/flatscreen.png | Bin 0 -> 23508 bytes .../images/electricalDevices_woIP/lamp.png | Bin 0 -> 59715 bytes .../images/electricalDevices_woIP/plasmapanel.png | Bin 0 -> 108588 bytes .../images/electricalDevices_woIP/tvcamera.png | Bin 0 -> 6066 bytes .../images/furniture/4chairs1squaretable.png | Bin 0 -> 38455 bytes .../roomplanner/images/furniture/6chairs1table.png | Bin 0 -> 69935 bytes .../images/furniture/6chairs1table_horizontal.png | Bin 0 -> 68181 bytes .../images/furniture/6chairs1table_vertical.png | Bin 0 -> 69935 bytes .../images/furniture/8chairs1conferencetable.png | Bin 0 -> 96558 bytes .../8chairs1conferencetable_horizontal.png | Bin 0 -> 96558 bytes .../furniture/8chairs1conferencetable_vertical.png | Bin 0 -> 100157 bytes .../roomplanner/images/furniture/armchair.png | Bin 0 -> 71397 bytes .../roomplanner/images/furniture/armchair_east.png | Bin 0 -> 72212 bytes .../images/furniture/armchair_north.png | Bin 0 -> 70843 bytes .../images/furniture/armchair_south.png | Bin 0 -> 71397 bytes .../roomplanner/images/furniture/armchair_west.png | Bin 0 -> 71509 bytes .../roomplanner/images/furniture/chair.png | Bin 0 -> 50354 bytes .../roomplanner/images/furniture/chair2.png | Bin 0 -> 57539 bytes .../roomplanner/images/furniture/chair2_east.png | Bin 0 -> 60159 bytes .../roomplanner/images/furniture/chair2_north.png | Bin 0 -> 57047 bytes .../roomplanner/images/furniture/chair2_south.png | Bin 0 -> 57539 bytes .../roomplanner/images/furniture/chair2_west.png | Bin 0 -> 59577 bytes .../roomplanner/images/furniture/chair_east.png | Bin 0 -> 50780 bytes .../roomplanner/images/furniture/chair_north.png | Bin 0 -> 50873 bytes .../roomplanner/images/furniture/chair_south.png | Bin 0 -> 50354 bytes .../roomplanner/images/furniture/chair_west.png | Bin 0 -> 51038 bytes .../roomplanner/images/furniture/classroomdesk.png | Bin 0 -> 203830 bytes .../images/furniture/classroomdesk_east.png | Bin 0 -> 195670 bytes .../images/furniture/classroomdesk_north.png | Bin 0 -> 203830 bytes .../images/furniture/classroomdesk_south.png | Bin 0 -> 203863 bytes .../images/furniture/classroomdesk_west.png | Bin 0 -> 195570 bytes .../images/furniture/classroomdeskchair.png | Bin 0 -> 104752 bytes .../images/furniture/classroomdeskchair_east.png | Bin 0 -> 107825 bytes .../images/furniture/classroomdeskchair_north.png | Bin 0 -> 104752 bytes .../images/furniture/classroomdeskchair_south.png | Bin 0 -> 105023 bytes .../images/furniture/classroomdeskchair_west.png | Bin 0 -> 108205 bytes .../images/furniture/classroomtable.png | Bin 0 -> 86667 bytes .../images/furniture/classroomtable_east.png | Bin 0 -> 86667 bytes .../images/furniture/classroomtable_north.png | Bin 0 -> 87138 bytes .../images/furniture/classroomtable_south.png | Bin 0 -> 86876 bytes .../images/furniture/classroomtable_west.png | Bin 0 -> 86527 bytes .../images/furniture/classroomtablechair.png | Bin 0 -> 62367 bytes .../images/furniture/classroomtablechair_east.png | Bin 0 -> 62418 bytes .../images/furniture/classroomtablechair_north.png | Bin 0 -> 62367 bytes .../images/furniture/classroomtablechair_south.png | Bin 0 -> 61541 bytes .../images/furniture/classroomtablechair_west.png | Bin 0 -> 62454 bytes .../roomplanner/images/furniture/coatrack.png | Bin 0 -> 50598 bytes .../roomplanner/images/furniture/coatrack_east.png | Bin 0 -> 58243 bytes .../images/furniture/coatrack_north.png | Bin 0 -> 50383 bytes .../images/furniture/coatrack_south.png | Bin 0 -> 50598 bytes .../roomplanner/images/furniture/coatrack_west.png | Bin 0 -> 57728 bytes .../images/furniture/conferencetable.png | Bin 0 -> 101802 bytes .../furniture/conferencetable_horizontal.png | Bin 0 -> 100512 bytes .../images/furniture/conferencetable_vertical.png | Bin 0 -> 107335 bytes .../roomplanner/images/furniture/couch.png | Bin 0 -> 75142 bytes .../roomplanner/images/furniture/couch_east.png | Bin 0 -> 77496 bytes .../roomplanner/images/furniture/couch_north.png | Bin 0 -> 74771 bytes .../roomplanner/images/furniture/couch_south.png | Bin 0 -> 75142 bytes .../roomplanner/images/furniture/couch_west.png | Bin 0 -> 77220 bytes .../roomplanner/images/furniture/greenchair.png | Bin 0 -> 270980 bytes .../images/furniture/greenchair_east.png | Bin 0 -> 281772 bytes .../images/furniture/greenchair_north.png | Bin 0 -> 265248 bytes .../images/furniture/greenchair_south.png | Bin 0 -> 270980 bytes .../images/furniture/greenchair_west.png | Bin 0 -> 280625 bytes .../images/furniture/lecturetheaterrow.png | Bin 0 -> 203617 bytes .../images/furniture/lecturetheaterrowseats.png | Bin 0 -> 574843 bytes .../roomplanner/images/furniture/locker.png | Bin 0 -> 69483 bytes .../roomplanner/images/furniture/locker_east.png | Bin 0 -> 68728 bytes .../roomplanner/images/furniture/locker_north.png | Bin 0 -> 69483 bytes .../roomplanner/images/furniture/locker_south.png | Bin 0 -> 69369 bytes .../roomplanner/images/furniture/locker_west.png | Bin 0 -> 68896 bytes .../roomplanner/images/furniture/podium.png | Bin 0 -> 97614 bytes .../roomplanner/images/furniture/podium_east.png | Bin 0 -> 100568 bytes .../roomplanner/images/furniture/podium_north.png | Bin 0 -> 97887 bytes .../roomplanner/images/furniture/podium_south.png | Bin 0 -> 97614 bytes .../roomplanner/images/furniture/podium_west.png | Bin 0 -> 101167 bytes .../roomplanner/images/furniture/roundeddesk.png | Bin 0 -> 6669 bytes .../images/furniture/roundeddesk_east.png | Bin 0 -> 6669 bytes .../images/furniture/roundeddesk_north.png | Bin 0 -> 6528 bytes .../images/furniture/roundeddesk_south.png | Bin 0 -> 6491 bytes .../images/furniture/roundeddesk_west.png | Bin 0 -> 6789 bytes .../roomplanner/images/furniture/roundtable.png | Bin 0 -> 56701 bytes .../images/furniture/semicirculartable.png | Bin 0 -> 55548 bytes .../images/furniture/semicirculartable_east.png | Bin 0 -> 54251 bytes .../images/furniture/semicirculartable_north.png | Bin 0 -> 55548 bytes .../images/furniture/semicirculartable_south.png | Bin 0 -> 53122 bytes .../images/furniture/semicirculartable_west.png | Bin 0 -> 54235 bytes .../roomplanner/images/furniture/squaretable.png | Bin 0 -> 49063 bytes .../roomplanner/images/furniture/studentdesk.png | Bin 0 -> 112509 bytes .../images/furniture/studentdesk_east.png | Bin 0 -> 113232 bytes .../images/furniture/studentdesk_north.png | Bin 0 -> 111532 bytes .../images/furniture/studentdesk_south.png | Bin 0 -> 112509 bytes .../images/furniture/studentdesk_west.png | Bin 0 -> 112252 bytes .../images/furniture/studentdeskchair.png | Bin 0 -> 43647 bytes .../images/furniture/studentdeskchair_east.png | Bin 0 -> 47300 bytes .../images/furniture/studentdeskchair_north.png | Bin 0 -> 43647 bytes .../images/furniture/studentdeskchair_south.png | Bin 0 -> 42966 bytes .../images/furniture/studentdeskchair_west.png | Bin 0 -> 47779 bytes modules-available/roomplanner/images/grid.png | Bin 0 -> 748 bytes modules-available/roomplanner/images/grid2.png | Bin 0 -> 1112 bytes modules-available/roomplanner/images/grid3.png | Bin 0 -> 1113 bytes .../roomplanner/images/grid_100_sep.png | Bin 0 -> 1211 bytes .../roomplanner/images/misc/projectionscreen.png | Bin 0 -> 49367 bytes .../roomplanner/images/officeSupply/papertray.png | Bin 0 -> 4763 bytes .../roomplanner/images/officeSupply/wastecan.png | Bin 0 -> 24087 bytes .../roomplanner/images/plants/plant.png | Bin 0 -> 107165 bytes .../roomplanner/images/plants/plant2.png | Bin 0 -> 95427 bytes .../roomplanner/images/plants/plant3.png | Bin 0 -> 82054 bytes .../roomplanner/images/wall/door-en.png | Bin 0 -> 6064 bytes .../roomplanner/images/wall/door-es.png | Bin 0 -> 6507 bytes .../roomplanner/images/wall/door-ne.png | Bin 0 -> 6448 bytes .../roomplanner/images/wall/door-nw.png | Bin 0 -> 6529 bytes .../roomplanner/images/wall/door-se.png | Bin 0 -> 6078 bytes .../roomplanner/images/wall/door-sw.png | Bin 0 -> 6558 bytes .../roomplanner/images/wall/door-wn.png | Bin 0 -> 6379 bytes .../roomplanner/images/wall/door-ws.png | Bin 0 -> 5930 bytes .../roomplanner/images/wall/wall-horizontal.gif | 73 ++ .../roomplanner/images/wall/wall-horizontal.png | Bin 0 -> 344 bytes .../roomplanner/images/wall/wall-vertical.png | Bin 0 -> 375 bytes modules-available/roomplanner/js/grid.js | 518 +++++++++++++ modules-available/roomplanner/js/init.js | 163 ++++ .../roomplanner/js/lib/jquery-collision.js | 394 ++++++++++ .../js/lib/jquery-ui-draggable-collision.js | 826 +++++++++++++++++++++ modules-available/roomplanner/page.inc.php | 53 ++ modules-available/roomplanner/style.css | 763 +++++++++++++++++++ modules-available/roomplanner/templates/page.html | 350 +++++++++ 136 files changed, 3269 insertions(+) create mode 100644 modules-available/roomplanner/clientscript.js create mode 100644 modules-available/roomplanner/config.json create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/copier.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/pc.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/pc_east.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/pc_north.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/pc_south.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/pc_west.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/printer.png create mode 100644 modules-available/roomplanner/images/electricalDevices_wIP/telephone.png create mode 100644 modules-available/roomplanner/images/electricalDevices_woIP/flatscreen.png create mode 100644 modules-available/roomplanner/images/electricalDevices_woIP/lamp.png create mode 100644 modules-available/roomplanner/images/electricalDevices_woIP/plasmapanel.png create mode 100644 modules-available/roomplanner/images/electricalDevices_woIP/tvcamera.png create mode 100644 modules-available/roomplanner/images/furniture/4chairs1squaretable.png create mode 100644 modules-available/roomplanner/images/furniture/6chairs1table.png create mode 100644 modules-available/roomplanner/images/furniture/6chairs1table_horizontal.png create mode 100644 modules-available/roomplanner/images/furniture/6chairs1table_vertical.png create mode 100644 modules-available/roomplanner/images/furniture/8chairs1conferencetable.png create mode 100644 modules-available/roomplanner/images/furniture/8chairs1conferencetable_horizontal.png create mode 100644 modules-available/roomplanner/images/furniture/8chairs1conferencetable_vertical.png create mode 100644 modules-available/roomplanner/images/furniture/armchair.png create mode 100644 modules-available/roomplanner/images/furniture/armchair_east.png create mode 100644 modules-available/roomplanner/images/furniture/armchair_north.png create mode 100644 modules-available/roomplanner/images/furniture/armchair_south.png create mode 100644 modules-available/roomplanner/images/furniture/armchair_west.png create mode 100644 modules-available/roomplanner/images/furniture/chair.png create mode 100644 modules-available/roomplanner/images/furniture/chair2.png create mode 100644 modules-available/roomplanner/images/furniture/chair2_east.png create mode 100644 modules-available/roomplanner/images/furniture/chair2_north.png create mode 100644 modules-available/roomplanner/images/furniture/chair2_south.png create mode 100644 modules-available/roomplanner/images/furniture/chair2_west.png create mode 100644 modules-available/roomplanner/images/furniture/chair_east.png create mode 100644 modules-available/roomplanner/images/furniture/chair_north.png create mode 100644 modules-available/roomplanner/images/furniture/chair_south.png create mode 100644 modules-available/roomplanner/images/furniture/chair_west.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdesk.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdesk_east.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdesk_north.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdesk_south.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdesk_west.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdeskchair.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdeskchair_east.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdeskchair_north.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdeskchair_south.png create mode 100644 modules-available/roomplanner/images/furniture/classroomdeskchair_west.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtable.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtable_east.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtable_north.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtable_south.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtable_west.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtablechair.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtablechair_east.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtablechair_north.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtablechair_south.png create mode 100644 modules-available/roomplanner/images/furniture/classroomtablechair_west.png create mode 100644 modules-available/roomplanner/images/furniture/coatrack.png create mode 100644 modules-available/roomplanner/images/furniture/coatrack_east.png create mode 100644 modules-available/roomplanner/images/furniture/coatrack_north.png create mode 100644 modules-available/roomplanner/images/furniture/coatrack_south.png create mode 100644 modules-available/roomplanner/images/furniture/coatrack_west.png create mode 100644 modules-available/roomplanner/images/furniture/conferencetable.png create mode 100644 modules-available/roomplanner/images/furniture/conferencetable_horizontal.png create mode 100644 modules-available/roomplanner/images/furniture/conferencetable_vertical.png create mode 100644 modules-available/roomplanner/images/furniture/couch.png create mode 100644 modules-available/roomplanner/images/furniture/couch_east.png create mode 100644 modules-available/roomplanner/images/furniture/couch_north.png create mode 100644 modules-available/roomplanner/images/furniture/couch_south.png create mode 100644 modules-available/roomplanner/images/furniture/couch_west.png create mode 100644 modules-available/roomplanner/images/furniture/greenchair.png create mode 100644 modules-available/roomplanner/images/furniture/greenchair_east.png create mode 100644 modules-available/roomplanner/images/furniture/greenchair_north.png create mode 100644 modules-available/roomplanner/images/furniture/greenchair_south.png create mode 100644 modules-available/roomplanner/images/furniture/greenchair_west.png create mode 100644 modules-available/roomplanner/images/furniture/lecturetheaterrow.png create mode 100644 modules-available/roomplanner/images/furniture/lecturetheaterrowseats.png create mode 100644 modules-available/roomplanner/images/furniture/locker.png create mode 100644 modules-available/roomplanner/images/furniture/locker_east.png create mode 100644 modules-available/roomplanner/images/furniture/locker_north.png create mode 100644 modules-available/roomplanner/images/furniture/locker_south.png create mode 100644 modules-available/roomplanner/images/furniture/locker_west.png create mode 100644 modules-available/roomplanner/images/furniture/podium.png create mode 100644 modules-available/roomplanner/images/furniture/podium_east.png create mode 100644 modules-available/roomplanner/images/furniture/podium_north.png create mode 100644 modules-available/roomplanner/images/furniture/podium_south.png create mode 100644 modules-available/roomplanner/images/furniture/podium_west.png create mode 100644 modules-available/roomplanner/images/furniture/roundeddesk.png create mode 100644 modules-available/roomplanner/images/furniture/roundeddesk_east.png create mode 100644 modules-available/roomplanner/images/furniture/roundeddesk_north.png create mode 100644 modules-available/roomplanner/images/furniture/roundeddesk_south.png create mode 100644 modules-available/roomplanner/images/furniture/roundeddesk_west.png create mode 100644 modules-available/roomplanner/images/furniture/roundtable.png create mode 100644 modules-available/roomplanner/images/furniture/semicirculartable.png create mode 100644 modules-available/roomplanner/images/furniture/semicirculartable_east.png create mode 100644 modules-available/roomplanner/images/furniture/semicirculartable_north.png create mode 100644 modules-available/roomplanner/images/furniture/semicirculartable_south.png create mode 100644 modules-available/roomplanner/images/furniture/semicirculartable_west.png create mode 100644 modules-available/roomplanner/images/furniture/squaretable.png create mode 100644 modules-available/roomplanner/images/furniture/studentdesk.png create mode 100644 modules-available/roomplanner/images/furniture/studentdesk_east.png create mode 100644 modules-available/roomplanner/images/furniture/studentdesk_north.png create mode 100644 modules-available/roomplanner/images/furniture/studentdesk_south.png create mode 100644 modules-available/roomplanner/images/furniture/studentdesk_west.png create mode 100644 modules-available/roomplanner/images/furniture/studentdeskchair.png create mode 100644 modules-available/roomplanner/images/furniture/studentdeskchair_east.png create mode 100644 modules-available/roomplanner/images/furniture/studentdeskchair_north.png create mode 100644 modules-available/roomplanner/images/furniture/studentdeskchair_south.png create mode 100644 modules-available/roomplanner/images/furniture/studentdeskchair_west.png create mode 100644 modules-available/roomplanner/images/grid.png create mode 100644 modules-available/roomplanner/images/grid2.png create mode 100644 modules-available/roomplanner/images/grid3.png create mode 100644 modules-available/roomplanner/images/grid_100_sep.png create mode 100644 modules-available/roomplanner/images/misc/projectionscreen.png create mode 100644 modules-available/roomplanner/images/officeSupply/papertray.png create mode 100644 modules-available/roomplanner/images/officeSupply/wastecan.png create mode 100644 modules-available/roomplanner/images/plants/plant.png create mode 100644 modules-available/roomplanner/images/plants/plant2.png create mode 100644 modules-available/roomplanner/images/plants/plant3.png create mode 100644 modules-available/roomplanner/images/wall/door-en.png create mode 100644 modules-available/roomplanner/images/wall/door-es.png create mode 100644 modules-available/roomplanner/images/wall/door-ne.png create mode 100644 modules-available/roomplanner/images/wall/door-nw.png create mode 100644 modules-available/roomplanner/images/wall/door-se.png create mode 100644 modules-available/roomplanner/images/wall/door-sw.png create mode 100644 modules-available/roomplanner/images/wall/door-wn.png create mode 100644 modules-available/roomplanner/images/wall/door-ws.png create mode 100644 modules-available/roomplanner/images/wall/wall-horizontal.gif create mode 100644 modules-available/roomplanner/images/wall/wall-horizontal.png create mode 100644 modules-available/roomplanner/images/wall/wall-vertical.png create mode 100644 modules-available/roomplanner/js/grid.js create mode 100644 modules-available/roomplanner/js/init.js create mode 100644 modules-available/roomplanner/js/lib/jquery-collision.js create mode 100644 modules-available/roomplanner/js/lib/jquery-ui-draggable-collision.js create mode 100644 modules-available/roomplanner/page.inc.php create mode 100644 modules-available/roomplanner/style.css create mode 100644 modules-available/roomplanner/templates/page.html (limited to 'modules-available') diff --git a/modules-available/roomplanner/clientscript.js b/modules-available/roomplanner/clientscript.js new file mode 100644 index 00000000..ed91c9fd --- /dev/null +++ b/modules-available/roomplanner/clientscript.js @@ -0,0 +1,125 @@ +/** + * Pop-Up to select a machine + * + * Copyright 2016 Christian Klinger + * */ + +/* uuid -> obj */ +machineCache = {}; + + + +function renderMachineEntry(item, escape) { + machineCache[item.machineuuid] = item; + return '
' + //+ ' ' + + '
' + + '
' + escape(item.hostname) + '
' + + ' ' + + '' + + '' + + '' + + '
UUID: ' + escape(item.machineuuid) + '
MAC: ' + escape(item.macaddr) + '
IP: ' + escape(item.clientip) + '
' + + '
' + + '
'; +} + +function loadMachines(query, callback) { + console.log('queryMachines(' + query + ')'); + if (query.length < 2) return callback(); + $.ajax({ + url: '?do=roomplanner&action=getmachines&query=' + encodeURIComponent(query), + type: 'GET', + error: function() { + console.log('error while doing ajax call'); + callback(); + }, + success: function(res) { + console.log('success ajax call'); + var json = JSON.parse(res); + json.machines.forEach(function (v,i,a){ + a[i].combined = v.machineuuid + " " + v.hostname + " " + v.clientip + " " + v.macaddr; + }); + return callback(json.machines); + } + }); +} + + +var searchSettings = { + plugins : ["remove_button"], + valueField: 'machineuuid', + searchField: "combined", + //labelField: "combined", + openOnFocus: false, + create: false, + render : { option : renderMachineEntry, item: renderMachineEntry}, + load: loadMachines, + maxItems: 1, + sortField: 'clientip', + sortDirection: 'asc', + onChange: clearSubnetBox + +} + +var subnetSettings = { + plugins : ["remove_button"], + valueField: 'machineuuid', + searchField: "combined", + //labelField: "combined", + openOnFocus: false, + create: false, + render : { option : renderMachineEntry, item: renderMachineEntry}, + load: loadMachines, + maxItems: 1, + sortField: 'clientip', + sortDirection: 'asc', + onChange: clearSearchBox + +} + +function clearSearchBox() { + console.log("clearSearchBox()"); + $selectizeSearch[0].selectize.clear(false); +} +function clearSubnetBox() { + console.log("clearSubnetBox()"); + $selectizeSubnet[0].selectize.clear(false); +} + +function selectMachine(usedUuids, callback) { + /* show a popup */ + $modal = $('#selectMachineModal'); + $selectizeSearch = $('#machineSearchBox').selectize(searchSettings); + $selectizeSubnet = $('#subnetBox').selectize(subnetSettings); + + /* connect subnet tab and search tab such that on change of one the other gets emptied */ + + + $modal.modal('show'); + + $('#selectMachineButton').on('click', function() { + + /* check which one has a value */ + var bySubnet = machineCache[$selectizeSubnet[0].selectize.getValue()]; + var bySearch = machineCache[$selectizeSearch[0].selectize.getValue()]; + + var selected = bySubnet; // (bySubnet === undefined || bySubnet == "")? bySearch : bySubnet; + + console.log('value is '); + console.log($selectizeSubnet[0].selectize.getValue()); + console.log(machineCache); + console.log('selected is '); + console.log(selected); + + var result = {muuid: selected.machineuuid, ip: selected.clientip, mac_address : selected.macaddr, hostname: selected.hostname}; + $modal.modal('hide'); + clearSubnetBox(); + clearSearchBox(); + callback(result); + }); + + var result = {muuid: "blabla", ip: "blabla", mac_address: "blub", hostname: "lalala"}; + + callback(result); +} diff --git a/modules-available/roomplanner/config.json b/modules-available/roomplanner/config.json new file mode 100644 index 00000000..83e4ca30 --- /dev/null +++ b/modules-available/roomplanner/config.json @@ -0,0 +1,4 @@ +{ + "category":"main.content", + "dependencies": ["js_jqueryui", "js_selectize"] +} diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/copier.png b/modules-available/roomplanner/images/electricalDevices_wIP/copier.png new file mode 100644 index 00000000..24cdc2ae Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/copier.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/pc.png b/modules-available/roomplanner/images/electricalDevices_wIP/pc.png new file mode 100644 index 00000000..d1c9417d Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/pc.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/pc_east.png b/modules-available/roomplanner/images/electricalDevices_wIP/pc_east.png new file mode 100644 index 00000000..6ac2fb0e Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/pc_east.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/pc_north.png b/modules-available/roomplanner/images/electricalDevices_wIP/pc_north.png new file mode 100644 index 00000000..c564a2d3 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/pc_north.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/pc_south.png b/modules-available/roomplanner/images/electricalDevices_wIP/pc_south.png new file mode 100644 index 00000000..6359234b Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/pc_south.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/pc_west.png b/modules-available/roomplanner/images/electricalDevices_wIP/pc_west.png new file mode 100644 index 00000000..539a1bf1 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/pc_west.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/printer.png b/modules-available/roomplanner/images/electricalDevices_wIP/printer.png new file mode 100644 index 00000000..ec851e04 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/printer.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_wIP/telephone.png b/modules-available/roomplanner/images/electricalDevices_wIP/telephone.png new file mode 100644 index 00000000..207bfe56 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_wIP/telephone.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_woIP/flatscreen.png b/modules-available/roomplanner/images/electricalDevices_woIP/flatscreen.png new file mode 100644 index 00000000..de05797c Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_woIP/flatscreen.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_woIP/lamp.png b/modules-available/roomplanner/images/electricalDevices_woIP/lamp.png new file mode 100644 index 00000000..584ea1d9 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_woIP/lamp.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_woIP/plasmapanel.png b/modules-available/roomplanner/images/electricalDevices_woIP/plasmapanel.png new file mode 100644 index 00000000..5f6bd40e Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_woIP/plasmapanel.png differ diff --git a/modules-available/roomplanner/images/electricalDevices_woIP/tvcamera.png b/modules-available/roomplanner/images/electricalDevices_woIP/tvcamera.png new file mode 100644 index 00000000..c57833b2 Binary files /dev/null and b/modules-available/roomplanner/images/electricalDevices_woIP/tvcamera.png differ diff --git a/modules-available/roomplanner/images/furniture/4chairs1squaretable.png b/modules-available/roomplanner/images/furniture/4chairs1squaretable.png new file mode 100644 index 00000000..4e48225e Binary files /dev/null and b/modules-available/roomplanner/images/furniture/4chairs1squaretable.png differ diff --git a/modules-available/roomplanner/images/furniture/6chairs1table.png b/modules-available/roomplanner/images/furniture/6chairs1table.png new file mode 100644 index 00000000..fa9cd791 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/6chairs1table.png differ diff --git a/modules-available/roomplanner/images/furniture/6chairs1table_horizontal.png b/modules-available/roomplanner/images/furniture/6chairs1table_horizontal.png new file mode 100644 index 00000000..e6c9a7cb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/6chairs1table_horizontal.png differ diff --git a/modules-available/roomplanner/images/furniture/6chairs1table_vertical.png b/modules-available/roomplanner/images/furniture/6chairs1table_vertical.png new file mode 100644 index 00000000..1daaf67b Binary files /dev/null and b/modules-available/roomplanner/images/furniture/6chairs1table_vertical.png differ diff --git a/modules-available/roomplanner/images/furniture/8chairs1conferencetable.png b/modules-available/roomplanner/images/furniture/8chairs1conferencetable.png new file mode 100644 index 00000000..1e9b2d84 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/8chairs1conferencetable.png differ diff --git a/modules-available/roomplanner/images/furniture/8chairs1conferencetable_horizontal.png b/modules-available/roomplanner/images/furniture/8chairs1conferencetable_horizontal.png new file mode 100644 index 00000000..12a5a36c Binary files /dev/null and b/modules-available/roomplanner/images/furniture/8chairs1conferencetable_horizontal.png differ diff --git a/modules-available/roomplanner/images/furniture/8chairs1conferencetable_vertical.png b/modules-available/roomplanner/images/furniture/8chairs1conferencetable_vertical.png new file mode 100644 index 00000000..8615777e Binary files /dev/null and b/modules-available/roomplanner/images/furniture/8chairs1conferencetable_vertical.png differ diff --git a/modules-available/roomplanner/images/furniture/armchair.png b/modules-available/roomplanner/images/furniture/armchair.png new file mode 100644 index 00000000..7185ac87 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/armchair.png differ diff --git a/modules-available/roomplanner/images/furniture/armchair_east.png b/modules-available/roomplanner/images/furniture/armchair_east.png new file mode 100644 index 00000000..aea3a7b3 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/armchair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/armchair_north.png b/modules-available/roomplanner/images/furniture/armchair_north.png new file mode 100644 index 00000000..cb2ba1ca Binary files /dev/null and b/modules-available/roomplanner/images/furniture/armchair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/armchair_south.png b/modules-available/roomplanner/images/furniture/armchair_south.png new file mode 100644 index 00000000..61da516a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/armchair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/armchair_west.png b/modules-available/roomplanner/images/furniture/armchair_west.png new file mode 100644 index 00000000..98ef47cc Binary files /dev/null and b/modules-available/roomplanner/images/furniture/armchair_west.png differ diff --git a/modules-available/roomplanner/images/furniture/chair.png b/modules-available/roomplanner/images/furniture/chair.png new file mode 100644 index 00000000..f7a023d4 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair.png differ diff --git a/modules-available/roomplanner/images/furniture/chair2.png b/modules-available/roomplanner/images/furniture/chair2.png new file mode 100644 index 00000000..b4afa66f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair2.png differ diff --git a/modules-available/roomplanner/images/furniture/chair2_east.png b/modules-available/roomplanner/images/furniture/chair2_east.png new file mode 100644 index 00000000..68ad3cfe Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair2_east.png differ diff --git a/modules-available/roomplanner/images/furniture/chair2_north.png b/modules-available/roomplanner/images/furniture/chair2_north.png new file mode 100644 index 00000000..fc9790f4 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair2_north.png differ diff --git a/modules-available/roomplanner/images/furniture/chair2_south.png b/modules-available/roomplanner/images/furniture/chair2_south.png new file mode 100644 index 00000000..cc8a31fe Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair2_south.png differ diff --git a/modules-available/roomplanner/images/furniture/chair2_west.png b/modules-available/roomplanner/images/furniture/chair2_west.png new file mode 100644 index 00000000..8167372f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair2_west.png differ diff --git a/modules-available/roomplanner/images/furniture/chair_east.png b/modules-available/roomplanner/images/furniture/chair_east.png new file mode 100644 index 00000000..729a0d2c Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/chair_north.png b/modules-available/roomplanner/images/furniture/chair_north.png new file mode 100644 index 00000000..3a1a6ea9 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/chair_south.png b/modules-available/roomplanner/images/furniture/chair_south.png new file mode 100644 index 00000000..2b01a4f5 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/chair_west.png b/modules-available/roomplanner/images/furniture/chair_west.png new file mode 100644 index 00000000..25fbbb2d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/chair_west.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdesk.png b/modules-available/roomplanner/images/furniture/classroomdesk.png new file mode 100644 index 00000000..e303f00d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdesk.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdesk_east.png b/modules-available/roomplanner/images/furniture/classroomdesk_east.png new file mode 100644 index 00000000..3fead9d7 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdesk_east.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdesk_north.png b/modules-available/roomplanner/images/furniture/classroomdesk_north.png new file mode 100644 index 00000000..9e7c5d33 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdesk_north.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdesk_south.png b/modules-available/roomplanner/images/furniture/classroomdesk_south.png new file mode 100644 index 00000000..43e5a80e Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdesk_south.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdesk_west.png b/modules-available/roomplanner/images/furniture/classroomdesk_west.png new file mode 100644 index 00000000..b694fff6 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdesk_west.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdeskchair.png b/modules-available/roomplanner/images/furniture/classroomdeskchair.png new file mode 100644 index 00000000..2f6e4c30 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdeskchair.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdeskchair_east.png b/modules-available/roomplanner/images/furniture/classroomdeskchair_east.png new file mode 100644 index 00000000..525cce5a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdeskchair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdeskchair_north.png b/modules-available/roomplanner/images/furniture/classroomdeskchair_north.png new file mode 100644 index 00000000..86587808 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdeskchair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdeskchair_south.png b/modules-available/roomplanner/images/furniture/classroomdeskchair_south.png new file mode 100644 index 00000000..fddb9f3b Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdeskchair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomdeskchair_west.png b/modules-available/roomplanner/images/furniture/classroomdeskchair_west.png new file mode 100644 index 00000000..399ff3eb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomdeskchair_west.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtable.png b/modules-available/roomplanner/images/furniture/classroomtable.png new file mode 100644 index 00000000..0e7884eb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtable.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtable_east.png b/modules-available/roomplanner/images/furniture/classroomtable_east.png new file mode 100644 index 00000000..2c34b321 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtable_east.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtable_north.png b/modules-available/roomplanner/images/furniture/classroomtable_north.png new file mode 100644 index 00000000..f355f5f2 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtable_north.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtable_south.png b/modules-available/roomplanner/images/furniture/classroomtable_south.png new file mode 100644 index 00000000..fce91e44 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtable_south.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtable_west.png b/modules-available/roomplanner/images/furniture/classroomtable_west.png new file mode 100644 index 00000000..7ca2a926 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtable_west.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtablechair.png b/modules-available/roomplanner/images/furniture/classroomtablechair.png new file mode 100644 index 00000000..2d5055ba Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtablechair.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtablechair_east.png b/modules-available/roomplanner/images/furniture/classroomtablechair_east.png new file mode 100644 index 00000000..6bebcccc Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtablechair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtablechair_north.png b/modules-available/roomplanner/images/furniture/classroomtablechair_north.png new file mode 100644 index 00000000..5c4ab84c Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtablechair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtablechair_south.png b/modules-available/roomplanner/images/furniture/classroomtablechair_south.png new file mode 100644 index 00000000..374712b0 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtablechair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/classroomtablechair_west.png b/modules-available/roomplanner/images/furniture/classroomtablechair_west.png new file mode 100644 index 00000000..c78b646b Binary files /dev/null and b/modules-available/roomplanner/images/furniture/classroomtablechair_west.png differ diff --git a/modules-available/roomplanner/images/furniture/coatrack.png b/modules-available/roomplanner/images/furniture/coatrack.png new file mode 100644 index 00000000..c46e83c4 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/coatrack.png differ diff --git a/modules-available/roomplanner/images/furniture/coatrack_east.png b/modules-available/roomplanner/images/furniture/coatrack_east.png new file mode 100644 index 00000000..f20ac7e7 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/coatrack_east.png differ diff --git a/modules-available/roomplanner/images/furniture/coatrack_north.png b/modules-available/roomplanner/images/furniture/coatrack_north.png new file mode 100644 index 00000000..c4171978 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/coatrack_north.png differ diff --git a/modules-available/roomplanner/images/furniture/coatrack_south.png b/modules-available/roomplanner/images/furniture/coatrack_south.png new file mode 100644 index 00000000..f8eb05ec Binary files /dev/null and b/modules-available/roomplanner/images/furniture/coatrack_south.png differ diff --git a/modules-available/roomplanner/images/furniture/coatrack_west.png b/modules-available/roomplanner/images/furniture/coatrack_west.png new file mode 100644 index 00000000..1c2ef6b6 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/coatrack_west.png differ diff --git a/modules-available/roomplanner/images/furniture/conferencetable.png b/modules-available/roomplanner/images/furniture/conferencetable.png new file mode 100644 index 00000000..0a802d02 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/conferencetable.png differ diff --git a/modules-available/roomplanner/images/furniture/conferencetable_horizontal.png b/modules-available/roomplanner/images/furniture/conferencetable_horizontal.png new file mode 100644 index 00000000..9755f281 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/conferencetable_horizontal.png differ diff --git a/modules-available/roomplanner/images/furniture/conferencetable_vertical.png b/modules-available/roomplanner/images/furniture/conferencetable_vertical.png new file mode 100644 index 00000000..40d814f1 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/conferencetable_vertical.png differ diff --git a/modules-available/roomplanner/images/furniture/couch.png b/modules-available/roomplanner/images/furniture/couch.png new file mode 100644 index 00000000..5722dec1 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/couch.png differ diff --git a/modules-available/roomplanner/images/furniture/couch_east.png b/modules-available/roomplanner/images/furniture/couch_east.png new file mode 100644 index 00000000..723a3373 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/couch_east.png differ diff --git a/modules-available/roomplanner/images/furniture/couch_north.png b/modules-available/roomplanner/images/furniture/couch_north.png new file mode 100644 index 00000000..87b9905a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/couch_north.png differ diff --git a/modules-available/roomplanner/images/furniture/couch_south.png b/modules-available/roomplanner/images/furniture/couch_south.png new file mode 100644 index 00000000..3c8292cb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/couch_south.png differ diff --git a/modules-available/roomplanner/images/furniture/couch_west.png b/modules-available/roomplanner/images/furniture/couch_west.png new file mode 100644 index 00000000..9e89e288 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/couch_west.png differ diff --git a/modules-available/roomplanner/images/furniture/greenchair.png b/modules-available/roomplanner/images/furniture/greenchair.png new file mode 100644 index 00000000..c79db1e8 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/greenchair.png differ diff --git a/modules-available/roomplanner/images/furniture/greenchair_east.png b/modules-available/roomplanner/images/furniture/greenchair_east.png new file mode 100644 index 00000000..71fb0335 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/greenchair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/greenchair_north.png b/modules-available/roomplanner/images/furniture/greenchair_north.png new file mode 100644 index 00000000..07581f8d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/greenchair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/greenchair_south.png b/modules-available/roomplanner/images/furniture/greenchair_south.png new file mode 100644 index 00000000..10d7452c Binary files /dev/null and b/modules-available/roomplanner/images/furniture/greenchair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/greenchair_west.png b/modules-available/roomplanner/images/furniture/greenchair_west.png new file mode 100644 index 00000000..3ebf702f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/greenchair_west.png differ diff --git a/modules-available/roomplanner/images/furniture/lecturetheaterrow.png b/modules-available/roomplanner/images/furniture/lecturetheaterrow.png new file mode 100644 index 00000000..007f4428 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/lecturetheaterrow.png differ diff --git a/modules-available/roomplanner/images/furniture/lecturetheaterrowseats.png b/modules-available/roomplanner/images/furniture/lecturetheaterrowseats.png new file mode 100644 index 00000000..eb20f8df Binary files /dev/null and b/modules-available/roomplanner/images/furniture/lecturetheaterrowseats.png differ diff --git a/modules-available/roomplanner/images/furniture/locker.png b/modules-available/roomplanner/images/furniture/locker.png new file mode 100644 index 00000000..2b958a48 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/locker.png differ diff --git a/modules-available/roomplanner/images/furniture/locker_east.png b/modules-available/roomplanner/images/furniture/locker_east.png new file mode 100644 index 00000000..b63abd5c Binary files /dev/null and b/modules-available/roomplanner/images/furniture/locker_east.png differ diff --git a/modules-available/roomplanner/images/furniture/locker_north.png b/modules-available/roomplanner/images/furniture/locker_north.png new file mode 100644 index 00000000..b360b47f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/locker_north.png differ diff --git a/modules-available/roomplanner/images/furniture/locker_south.png b/modules-available/roomplanner/images/furniture/locker_south.png new file mode 100644 index 00000000..e2c7ab7f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/locker_south.png differ diff --git a/modules-available/roomplanner/images/furniture/locker_west.png b/modules-available/roomplanner/images/furniture/locker_west.png new file mode 100644 index 00000000..04d69e4f Binary files /dev/null and b/modules-available/roomplanner/images/furniture/locker_west.png differ diff --git a/modules-available/roomplanner/images/furniture/podium.png b/modules-available/roomplanner/images/furniture/podium.png new file mode 100644 index 00000000..661c7c3a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/podium.png differ diff --git a/modules-available/roomplanner/images/furniture/podium_east.png b/modules-available/roomplanner/images/furniture/podium_east.png new file mode 100644 index 00000000..9fddfedb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/podium_east.png differ diff --git a/modules-available/roomplanner/images/furniture/podium_north.png b/modules-available/roomplanner/images/furniture/podium_north.png new file mode 100644 index 00000000..cef475ed Binary files /dev/null and b/modules-available/roomplanner/images/furniture/podium_north.png differ diff --git a/modules-available/roomplanner/images/furniture/podium_south.png b/modules-available/roomplanner/images/furniture/podium_south.png new file mode 100644 index 00000000..015c4c7a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/podium_south.png differ diff --git a/modules-available/roomplanner/images/furniture/podium_west.png b/modules-available/roomplanner/images/furniture/podium_west.png new file mode 100644 index 00000000..b076ad6d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/podium_west.png differ diff --git a/modules-available/roomplanner/images/furniture/roundeddesk.png b/modules-available/roomplanner/images/furniture/roundeddesk.png new file mode 100644 index 00000000..c2e17884 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundeddesk.png differ diff --git a/modules-available/roomplanner/images/furniture/roundeddesk_east.png b/modules-available/roomplanner/images/furniture/roundeddesk_east.png new file mode 100644 index 00000000..5c87d408 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundeddesk_east.png differ diff --git a/modules-available/roomplanner/images/furniture/roundeddesk_north.png b/modules-available/roomplanner/images/furniture/roundeddesk_north.png new file mode 100644 index 00000000..3952d2cb Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundeddesk_north.png differ diff --git a/modules-available/roomplanner/images/furniture/roundeddesk_south.png b/modules-available/roomplanner/images/furniture/roundeddesk_south.png new file mode 100644 index 00000000..2d608431 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundeddesk_south.png differ diff --git a/modules-available/roomplanner/images/furniture/roundeddesk_west.png b/modules-available/roomplanner/images/furniture/roundeddesk_west.png new file mode 100644 index 00000000..78afee3d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundeddesk_west.png differ diff --git a/modules-available/roomplanner/images/furniture/roundtable.png b/modules-available/roomplanner/images/furniture/roundtable.png new file mode 100644 index 00000000..aecebe9d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/roundtable.png differ diff --git a/modules-available/roomplanner/images/furniture/semicirculartable.png b/modules-available/roomplanner/images/furniture/semicirculartable.png new file mode 100644 index 00000000..4c160d5a Binary files /dev/null and b/modules-available/roomplanner/images/furniture/semicirculartable.png differ diff --git a/modules-available/roomplanner/images/furniture/semicirculartable_east.png b/modules-available/roomplanner/images/furniture/semicirculartable_east.png new file mode 100644 index 00000000..c286e88e Binary files /dev/null and b/modules-available/roomplanner/images/furniture/semicirculartable_east.png differ diff --git a/modules-available/roomplanner/images/furniture/semicirculartable_north.png b/modules-available/roomplanner/images/furniture/semicirculartable_north.png new file mode 100644 index 00000000..befce8a4 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/semicirculartable_north.png differ diff --git a/modules-available/roomplanner/images/furniture/semicirculartable_south.png b/modules-available/roomplanner/images/furniture/semicirculartable_south.png new file mode 100644 index 00000000..e02f0283 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/semicirculartable_south.png differ diff --git a/modules-available/roomplanner/images/furniture/semicirculartable_west.png b/modules-available/roomplanner/images/furniture/semicirculartable_west.png new file mode 100644 index 00000000..9bae2915 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/semicirculartable_west.png differ diff --git a/modules-available/roomplanner/images/furniture/squaretable.png b/modules-available/roomplanner/images/furniture/squaretable.png new file mode 100644 index 00000000..a71246ca Binary files /dev/null and b/modules-available/roomplanner/images/furniture/squaretable.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdesk.png b/modules-available/roomplanner/images/furniture/studentdesk.png new file mode 100644 index 00000000..29e155c7 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdesk.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdesk_east.png b/modules-available/roomplanner/images/furniture/studentdesk_east.png new file mode 100644 index 00000000..979ae7b5 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdesk_east.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdesk_north.png b/modules-available/roomplanner/images/furniture/studentdesk_north.png new file mode 100644 index 00000000..998ad6ef Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdesk_north.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdesk_south.png b/modules-available/roomplanner/images/furniture/studentdesk_south.png new file mode 100644 index 00000000..2c0ae3ca Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdesk_south.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdesk_west.png b/modules-available/roomplanner/images/furniture/studentdesk_west.png new file mode 100644 index 00000000..e09101ce Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdesk_west.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdeskchair.png b/modules-available/roomplanner/images/furniture/studentdeskchair.png new file mode 100644 index 00000000..26f6410e Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdeskchair.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdeskchair_east.png b/modules-available/roomplanner/images/furniture/studentdeskchair_east.png new file mode 100644 index 00000000..70260dfc Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdeskchair_east.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdeskchair_north.png b/modules-available/roomplanner/images/furniture/studentdeskchair_north.png new file mode 100644 index 00000000..26955e2d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdeskchair_north.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdeskchair_south.png b/modules-available/roomplanner/images/furniture/studentdeskchair_south.png new file mode 100644 index 00000000..cc1c576d Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdeskchair_south.png differ diff --git a/modules-available/roomplanner/images/furniture/studentdeskchair_west.png b/modules-available/roomplanner/images/furniture/studentdeskchair_west.png new file mode 100644 index 00000000..7704a5e6 Binary files /dev/null and b/modules-available/roomplanner/images/furniture/studentdeskchair_west.png differ diff --git a/modules-available/roomplanner/images/grid.png b/modules-available/roomplanner/images/grid.png new file mode 100644 index 00000000..18c3d98d Binary files /dev/null and b/modules-available/roomplanner/images/grid.png differ diff --git a/modules-available/roomplanner/images/grid2.png b/modules-available/roomplanner/images/grid2.png new file mode 100644 index 00000000..7f2b4ce4 Binary files /dev/null and b/modules-available/roomplanner/images/grid2.png differ diff --git a/modules-available/roomplanner/images/grid3.png b/modules-available/roomplanner/images/grid3.png new file mode 100644 index 00000000..ea8dc98e Binary files /dev/null and b/modules-available/roomplanner/images/grid3.png differ diff --git a/modules-available/roomplanner/images/grid_100_sep.png b/modules-available/roomplanner/images/grid_100_sep.png new file mode 100644 index 00000000..128d5ca6 Binary files /dev/null and b/modules-available/roomplanner/images/grid_100_sep.png differ diff --git a/modules-available/roomplanner/images/misc/projectionscreen.png b/modules-available/roomplanner/images/misc/projectionscreen.png new file mode 100644 index 00000000..4d7ba7b1 Binary files /dev/null and b/modules-available/roomplanner/images/misc/projectionscreen.png differ diff --git a/modules-available/roomplanner/images/officeSupply/papertray.png b/modules-available/roomplanner/images/officeSupply/papertray.png new file mode 100644 index 00000000..2ee473ee Binary files /dev/null and b/modules-available/roomplanner/images/officeSupply/papertray.png differ diff --git a/modules-available/roomplanner/images/officeSupply/wastecan.png b/modules-available/roomplanner/images/officeSupply/wastecan.png new file mode 100644 index 00000000..48b7338d Binary files /dev/null and b/modules-available/roomplanner/images/officeSupply/wastecan.png differ diff --git a/modules-available/roomplanner/images/plants/plant.png b/modules-available/roomplanner/images/plants/plant.png new file mode 100644 index 00000000..d83bcfe5 Binary files /dev/null and b/modules-available/roomplanner/images/plants/plant.png differ diff --git a/modules-available/roomplanner/images/plants/plant2.png b/modules-available/roomplanner/images/plants/plant2.png new file mode 100644 index 00000000..680b6ad8 Binary files /dev/null and b/modules-available/roomplanner/images/plants/plant2.png differ diff --git a/modules-available/roomplanner/images/plants/plant3.png b/modules-available/roomplanner/images/plants/plant3.png new file mode 100644 index 00000000..2cc5fa06 Binary files /dev/null and b/modules-available/roomplanner/images/plants/plant3.png differ diff --git a/modules-available/roomplanner/images/wall/door-en.png b/modules-available/roomplanner/images/wall/door-en.png new file mode 100644 index 00000000..3dfcc525 Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-en.png differ diff --git a/modules-available/roomplanner/images/wall/door-es.png b/modules-available/roomplanner/images/wall/door-es.png new file mode 100644 index 00000000..6d1d37a4 Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-es.png differ diff --git a/modules-available/roomplanner/images/wall/door-ne.png b/modules-available/roomplanner/images/wall/door-ne.png new file mode 100644 index 00000000..1acc4083 Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-ne.png differ diff --git a/modules-available/roomplanner/images/wall/door-nw.png b/modules-available/roomplanner/images/wall/door-nw.png new file mode 100644 index 00000000..de9626bc Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-nw.png differ diff --git a/modules-available/roomplanner/images/wall/door-se.png b/modules-available/roomplanner/images/wall/door-se.png new file mode 100644 index 00000000..ad27fa4f Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-se.png differ diff --git a/modules-available/roomplanner/images/wall/door-sw.png b/modules-available/roomplanner/images/wall/door-sw.png new file mode 100644 index 00000000..36d7e004 Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-sw.png differ diff --git a/modules-available/roomplanner/images/wall/door-wn.png b/modules-available/roomplanner/images/wall/door-wn.png new file mode 100644 index 00000000..43e4e8fd Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-wn.png differ diff --git a/modules-available/roomplanner/images/wall/door-ws.png b/modules-available/roomplanner/images/wall/door-ws.png new file mode 100644 index 00000000..f6da550d Binary files /dev/null and b/modules-available/roomplanner/images/wall/door-ws.png differ diff --git a/modules-available/roomplanner/images/wall/wall-horizontal.gif b/modules-available/roomplanner/images/wall/wall-horizontal.gif new file mode 100644 index 00000000..12b3f6b6 --- /dev/null +++ b/modules-available/roomplanner/images/wall/wall-horizontal.gif @@ -0,0 +1,73 @@ + + + + + + 404 Not Found + + + + +
+ + + + +

404 Not Found

+

The server can not find the requested page:

+
+ www.stripemania.com/transparent/25-25-45-1-53AC18-1-C2C2C2-DDEE1E-DDEE1E-DDEE1E-DDEE1E-C2C2C2-78D316-78D316-78D316-78D316-yes-yes-yes-yes-yes-.gif (port 80) +
+

+ Please forward this error screen to www.stripemania.com's + + WebMaster. +

+
+ + + +
+ + diff --git a/modules-available/roomplanner/images/wall/wall-horizontal.png b/modules-available/roomplanner/images/wall/wall-horizontal.png new file mode 100644 index 00000000..02d7aa91 Binary files /dev/null and b/modules-available/roomplanner/images/wall/wall-horizontal.png differ diff --git a/modules-available/roomplanner/images/wall/wall-vertical.png b/modules-available/roomplanner/images/wall/wall-vertical.png new file mode 100644 index 00000000..ac374b3f Binary files /dev/null and b/modules-available/roomplanner/images/wall/wall-vertical.png differ diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js new file mode 100644 index 00000000..1b82f772 --- /dev/null +++ b/modules-available/roomplanner/js/grid.js @@ -0,0 +1,518 @@ +if (!roomplanner) var roomplanner = { + + getScaleFactor: function() { + return this.settings.scale/100; + }, + getCellPositionFromPixels: function(left,top) { + var n = this.settings.scale / this.settings.cellsep; + return [ parseInt(left) - ((parseInt(left)%n)+n)%n , parseInt(top) - ((parseInt(top)%n)+n)%n]; + }, + getCellPositionFromGrid: function(row,col) { + var n = this.settings.scale / this.settings.cellsep; + return [ parseInt(col*n), parseInt(row*n) ] + }, + getGridFromPixels: function(left,top) { + var n = this.settings.scale / this.settings.cellsep; + return [Math.round(top/n), Math.round(left/n)]; + }, + settings: { + cellsep: 4, + scale: 100, + room: { + width: 1000, + height: 1000 + } + }, + selectFromServer: selectMachine, + isElementResizable: function(el) { + return (!$(el).attr('noresize') && $(el).attr('itemtype') != 'pc'); + }, + initRotation: function(el) { + if (!(new RegExp(".*(east|south|west|north)$").test($(el).attr('itemlook')))) { + return; + } + + $(el).append('
'); + $(el).find('.rotationHandle').click(function () { + var str = $(el).attr('itemlook'); + if (str.indexOf('-') > -1){ + var values =str.split('-'); + var name = values[0]; + var direction = values[1]; + + var re = new RegExp("east|south|west|north"); + if (re.test(direction)) { + var newdirection; + switch(direction) { + case "east": + newdirection = "south"; + break; + case "south": + newdirection = "west"; + break; + case "west": + newdirection = "north"; + break; + case "north": + newdirection = "east"; + break; + } + var result = name + "-" + newdirection; + $(el).attr('itemlook', result); + } + } + }); + }, + initDelete: function(el) { + $(el).append('
'); + $(el).find('.deleteHandle').click(function() { + if ($(this).parent().attr('itemtype') == "pc") { + var self = this; + BootstrapDialog.confirm(__('are you sure'),function(result) { + if (result) { + $(self).parent().remove(); + } + }); + } else { + $(this).parent().remove(); + } + }); + }, + initTooltip: function(el) { + if ($(el).attr('itemtype') == 'pc') { + var tip = "Rechnerdaten
"; + $(roomplanner.computerAttributes).each(function(i,key){ + tip += __(key)+": "+$(el).attr(key)+"
"; + }); + + $(el).attr('data-togle','tooltip'); + $(el).attr('title',tip); + $(el).tooltip({html: true}); + } + }, + + initDraggable: function(el) { + $(el).draggable(); + var options = { + "containment" : "#draw-element-area", + "helper" : false, + "grid" : [(roomplanner.settings.scale / 4), (roomplanner.settings.scale / 4)], + "stop": function(ev,ui) { + if ($(this).attr("obstacle") == "true") { + $(this).addClass("obstacle"); + } + + if ($(this).attr('itemtype') == "pc_drag") { + $(this).attr('itemtype','pc'); + } + + }, + "preventCollision" : true, + "restraint": "#draw-element-area", + "obstacle" : ".obstacle", + "start": function(ev,ui) { + if (roomplanner.isElementResizable(this)) { + $(this).resizable("option","maxHeight",null); + $(this).resizable("option","maxWidth",null); + } + + if ($(this).attr('itemtype') == "pc") { + $(this).attr('itemtype','pc_drag'); + } + + $(this).removeClass("obstacle"); + } + }; + + // pcs can be placed everywhere + if ($(el).attr('itemtype') == "pc") { + options.obstacle = '[itemtype="pc"]'; + } + + for (var o in options) { + $(el).draggable("option",o,options[o]); + } + }, + initResizable: function(el) { + if (!roomplanner.isElementResizable(el)) { return; } + + $(el).resizable({ + containment : "#draw-element-area", + obstacle: ".obstacle", + handles: "se", + autoHide: true, + grid: [(roomplanner.settings.scale / 4), (roomplanner.settings.scale / 4)], + resize: function(ev,ui) { + var gridSteps = $(this).resizable("option","grid"); + + + var collides = $(this).collision(".obstacle"); + var pos = $(this).offset(); + var self = this; + + var mw = $(this).resizable("option","maxWidth"); + var mh = $(this).resizable("option","maxHeight"); + + var hLimit = ($(this).attr('scalable') == 'v'); + var vLimit = ($(this).attr('scalable') == 'h'); + + if(collides.length) { + $(collides).each(function(idx,item) { + var itempos = $(item).offset(); + + if (!hLimit) { + if (pos.left < itempos.left && (pos.left + $(self).width()) > itempos.left) { + $(self).resizable("option","maxWidth",parseInt(itempos.left - pos.left)); + + } else { + $(self).resizable("option","maxWidth",null); + } + } + + if (!vLimit) { + if (pos.top < itempos.top && pos.top + $(self).height() > itempos.top) { + $(self).resizable("option","maxHeight",parseInt(itempos.top - pos.top)); + } else { + $(self).resizable("option","maxHeight",null); + } + } + }); + } else { + if (!hLimit && (mw == null || mw > $(this).width())) { + $(this).resizable("option","maxWidth",null); + } + if (!vLimit && (mh == null || mh > $(this).height())) { + $(this).resizable("option","maxHeight",null); + } + } + }, + start: function(ev,ui) { + $(this).removeClass("obstacle"); + $(this).css('opacity',0.8); + + var gridSteps = $(this).resizable("option","grid"); + + $(this).resizable("option",{ + minHeight: gridSteps[1]*roomplanner.getScaleFactor(), + minWidth: gridSteps[0]*roomplanner.getScaleFactor() + }); + + if ($(this).attr('scalable')) { + switch ($(this).attr('scalable')) { + case 'h': + $(this).resizable("option",{ + minHeight: $(this).height(), + maxHeight: $(this).height() + }); + break; + case 'v': + $(this).resizable("option",{ + minWidth: $(this).width(), + maxWidth: $(this).width() + }); + break; + } + } + + }, + stop: function(ev,ui) { + if ($(this).attr("obstacle") == "true") { + $(this).addClass("obstacle"); + } + + var gridSteps = $(this).resizable("option","grid"); + var mw = $(this).resizable("option","maxWidth"); + if (mw) { + $(this).width(mw); + } else { + $(this).width($(this).outerWidth() - $(this).outerWidth()%(gridSteps[0])); + } + + var mh = $(this).resizable("option","maxHeight"); + if (mh) { + $(this).height(mh); + } else { + $(this).height($(this).outerHeight() - $(this).outerHeight()%(gridSteps[1])); + } + + + $(this).attr('data-width', $(this).outerWidth()/roomplanner.getScaleFactor() - (($(this).outerWidth()%gridSteps[0])/roomplanner.getScaleFactor())); + $(this).attr('data-height', $(this).outerHeight()/roomplanner.getScaleFactor() - (($(this).outerHeight()%gridSteps[1])/roomplanner.getScaleFactor())); + + + $(this).css('opacity',1); + } + }); + }, + serialize: function() { + + var objects = { + "furniture": [], + "computers": [] + }; + + var furniture = $('#draw-element-area div[itemtype="furniture"]'); + furniture.each(function(idx,el) { + objects.furniture.push({ + "gridRow" : $(el).attr('gridRow'), + "gridCol" : $(el).attr('gridCol'), + "data-width": $(el).attr('data-width'), + "data-height": $(el).attr('data-height'), + "itemlook": $(el).attr('itemlook'), + }); + }); + + var computers = $('#draw-element-area div[itemtype="pc"]'); + computers.each(function(idx,el) { + + var object = { + "gridRow" : $(el).attr('gridRow'), + "gridCol" : $(el).attr('gridCol'), + "data-width": $(el).attr('data-width'), + "data-height": $(el).attr('data-height'), + "itemlook": $(el).attr('itemlook'), + "muuid": $(el).attr('muuid') + }; + + objects.computers.push(object) + }); + + + return JSON.stringify(objects); + }, + load: function(object) { + try { + var objects = JSON.parse(object); + } catch(e) { + alert('invalid JSON format'); + return false; + } + + $('#draw-element-area').html(''); + + function itemToHtml(item, itemtype, obstacle) { + var html = '
0) { + $(this).css('left',0); + } + if (parseInt($(this).css('top')) > 0) { + $(this).css('top',0); + } + + if (($(this).width() + parseInt($(this).css('left'))) < $(this).parent().width()) { + $(this).css('left', ($(this).parent().width() - $(this).width())); + } + + if (($(this).height() + parseInt($(this).css('top'))) < $(this).parent().height()) { + $(this).css('top', ($(this).parent().height() - $(this).height())); + } + }); + + $('#drawarea').draggable({ + stop: function() { + $(this).trigger('checkposition'); + } + }); + + $('#draw-element-area').droppable({ + accept: ".draggable", + drop: function(event, ui) { + + // the element is already in drawing area + var el = (ui.helper == ui.draggable) ? ui.draggable : $(ui.helper.clone()); + var collidingSelector = ($(el).attr('itemtype') =="pc_drag") ? '[itemtype="pc"]' : '.obstacle'; + + if ($(el).collision(collidingSelector).length) { + return; + } + + var itemtype = $(el).attr('itemtype'); + $(el).attr('itemtype',itemtype.replace('_drag','')); + + $(el).removeClass('collides'); + $(el).css('opacity',1); + + if (ui.helper != ui.draggable) { + var l = parseInt($(el).css('left'))-parseInt($('#drawarea').css('left'))-$('#drawpanel').offset().left; + var t = parseInt($(el).css('top'))-parseInt($('#drawarea').css('top'))-($('#drawpanel').offset().top + $('#drawpanel .panel-heading').height()); + var cp = roomplanner.getCellPositionFromPixels(l,t); + $(el).css('left',cp[0]); + $(el).css('top',cp[1]); + } + + var gridPositions = roomplanner.getGridFromPixels(parseInt($(el).css('left')),parseInt($(el).css('top'))); + $(el).attr('gridRow',gridPositions[0]); + $(el).attr('gridCol',gridPositions[1]); + + if ($(el).attr("obstacle") == "true") { + $(el).addClass("obstacle"); + } + + roomplanner.initResizable(el); + roomplanner.initDraggable(el); + + if (ui.helper != ui.draggable) { + $(this).append(el); + + if ($(el).attr('itemtype') == "pc") { + + var uuids = []; + var computers = $('#draw-element-area div[itemtype="pc"]'); + computers.each(function(idx,el) { + if ($(el).attr('muuid')) { + uuids.push($(el).attr('muuid')); + } + }); + + roomplanner.selectFromServer(uuids, function (result) { + if (!result) { + $(el).remove(); + } else { + for (var key in result) { + $(el).attr(key,result[key]); + } + roomplanner.initTooltip(el); + } + }); + } + roomplanner.initDelete(el); + roomplanner.initRotation(el); + + } + + } + }); + + $('.draggable').draggable({ + helper: "clone", + //grid : [(roomplanner.settings.scale / 4), (roomplanner.settings.scale / 4)], + preventCollision: true, + restraint: "#draw-element-area", + obstacle: ".obstacle", + cursorAt: {left:5,top:5}, + start: function(ev,ui) { + $(ui.helper).css('opacity',0.8); + $(ui.helper).height($(this).attr('data-height')*roomplanner.getScaleFactor()); + $(ui.helper).width($(this).attr('data-width')*roomplanner.getScaleFactor()); + var type = $(ui.helper).attr('itemtype'); + $(ui.helper).attr('itemtype',type+"_drag"); + }, + drag: function(ev,ui) { + var collidingSelector = ($(ui.helper).attr('itemtype') =="pc_drag") ? '[itemtype="pc"]' : '.obstacle'; + if ($(ui.helper).collision(collidingSelector).length) { + $(ui.helper).addClass('collides'); + } else { + $(ui.helper).removeClass('collides'); + } + } + }) + +}); diff --git a/modules-available/roomplanner/js/init.js b/modules-available/roomplanner/js/init.js new file mode 100644 index 00000000..e1a619aa --- /dev/null +++ b/modules-available/roomplanner/js/init.js @@ -0,0 +1,163 @@ +/* */ + +function initRoomplanner() { + + console.log('initRoomplanner'); + $('#drawarea').css('top',(-roomplanner.settings.scale*10)+'px'); + $('#drawarea').css('left',(-roomplanner.settings.scale*10)+'px'); + + roomplanner.computerAttributes = [ + "muuid", + "mac_address", + "ip", + "hostname" + ]; + + $("#loadButton").click(function() { + roomplanner.load($('#serializedRoom').val()); + }); + + $("#serializeButton").click(function() { + $('#serializedRoom').val(roomplanner.serialize()); + }); +} + +var translation = { + "muuid" : "Machine UUID", + "mac_address" : "MAC Adresse", + "ip" : "IP Adresse", + "hostname": "Rechnername", + + "wall-horizontal" : "Wand (horizontal)", + "wall-vertical" : "Mauer (vertikal)", + "window-horizontal" : "Fenster", + "window-vertical" : "Fenster", + "door-nw" : "Tür", + "door-ne" : "Tür", + "door-sw" : "Tür", + "door-se" : "Tür", + "door-wn" : "Tür", + "door-ws" : "Tür", + "door-en" : "Tür", + "door-es" : "Tür", + //"pc" : "PC", + "pc-east" : "PC", + "pc-south" : "PC", + "pc-west" : "PC", + "pc-north" : "PC", + "copier" : "Kopierer", + "printer" : "Drucker", + "telephone" : "Telefon", + "flatscreen" : "Flatscreen", + "lamp" : "Schreibtischlampe", + "tvcamera" : "Projektor", + "4chairs1squaretable" : "4 Stühle und ein quadratischer Tisch", + //"6chairs1table" : "6 Stühle und ein Tisch", + "6chairs1table-horizontal" : "6 Stühle und ein Tisch", + "6chairs1table-vertical" : "6 Stühle und ein Tisch", + //"8chairs1conferencetable" : "8 Stühle und 1 Konferenztisch", + "8chairs1conferencetable-horizontal" : "8 Stühle und 1 Konferenztisch", + "8chairs1conferencetable-vertical" : "8 Stühle und 1 Konferenztisch", + //"armchair" : "Sessel", + "armchair-east" : "Sessel", + "armchair-south" : "Sessel", + "armchair-west" : "Sessel", + "armchair-north" : "Sessel", + //"chair" : "Stuhl", + "chair-east" : "Stuhl", + "chair-south" : "Stuhl", + "chair-west" : "Stuhl", + "chair-north" : "Stuhl", + //"chair2" : "Stuhl", + "chair2-east" : "Stuhl", + "chair2-south" : "Stuhl", + "chair2-west" : "Stuhl", + "chair2-north" : "Stuhl", + //"classroomdesk" : "Klassenzimmerpult", + "classroomdesk-east" : "Klassenzimmerpult", + "classroomdesk-south" : "Klassenzimmerpult", + "classroomdesk-west" : "Klassenzimmerpult", + "classroomdesk-north" : "Klassenzimmerpult", + //"classroomdeskchair" : "Klassenzimmerpult mit Stuhl", + "classroomdeskchair-east" : "Klassenzimmerpult mit Stuhl", + "classroomdeskchair-south" : "Klassenzimmerpult mit Stuhl", + "classroomdeskchair-west" : "Klassenzimmerpult mit Stuhl", + "classroomdeskchair-north" : "Klassenzimmerpult mit Stuhl", + //"classroomtable" : "Klassenzimmertisch", + "classroomtable-east" : "Klassenzimmertisch", + "classroomtable-south" : "Klassenzimmertisch", + "classroomtable-west" : "Klassenzimmertisch", + "classroomtable-north" : "Klassenzimmertisch", + //"classroomtablechair" : "Klassenzimmertisch mit Stuhl", + "classroomtablechair-east" : "Klassenzimmertisch mit Stuhl", + "classroomtablechair-south" : "Klassenzimmertisch mit Stuhl", + "classroomtablechair-west" : "Klassenzimmertisch mit Stuhl", + "classroomtablechair-north" : "Klassenzimmertisch mit Stuhl", + //"coatrack" : "Garderobe", + "coatrack-east" : "Garderobe", + "coatrack-south" : "Garderobe", + "coatrack-west" : "Garderobe", + "coatrack-north" : "Garderobe", + //"conferencetable" : "Konferenztisch", + "conferencetable-horizontal" : "Konferenztisch", + "conferencetable-vertical" : "Konferenztisch", + //"couch" : "Couch", + "couch-east" : "Couch", + "couch-south" : "Couch", + "couch-west" : "Couch", + "couch-north" : "Couch", + //"greenchair" : "Stuhl", + "greenchair-east" : "Stuhl", + "greenchair-south" : "Stuhl", + "greenchair-west" : "Stuhl", + "greenchair-north" : "Stuhl", + "lecturetheaterrow" : "Vorlesungssaalreihe mit Stühlen", + "lecturetheaterrowseats" : "Vorlesungssaalstuhlreihe", + //"locker" : "Schließfach", + "locker-east" : "Schließfach", + "locker-south" : "Schließfach", + "locker-west" : "Schließfach", + "locker-north" : "Schließfach", + //"podium" : "Podium", + "podium-east" : "Podium", + "podium-south" : "Podium", + "podium-west" : "Podium", + "podium-north" : "Podium", + //"roundeddesk" : "Eckschreibtisch", + "roundeddesk-east" : "Eckschreibtisch", + "roundeddesk-south" : "Eckschreibtisch", + "roundeddesk-west" : "Eckschreibtisch", + "roundeddesk-north" : "Eckschreibtisch", + "roundtable" : "Runder Tisch", + //"semicirculartable" : "Nierentisch", + "semicirculartable-east" : "Nierentisch", + "semicirculartable-south" : "Nierentisch", + "semicirculartable-west" : "Nierentisch", + "semicirculartable-north" : "Nierentisch", + "squaretable" : "Quadratischer Tisch", + //"studentdesk" : "Schülerpult", + "studentdesk-east" : "Schülerpult", + "studentdesk-south" : "Schülerpult", + "studentdesk-west" : "Schülerpult", + "studentdesk-north" : "Schülerpult", + //"studentdeskchair" : "Schülerpult mit Stuhl", + "studentdeskchair-east" : "Schülerpult mit Stuhl", + "studentdeskchair-south" : "Schülerpult mit Stuhl", + "studentdeskchair-west" : "Schülerpult mit Stuhl", + "studentdeskchair-north" : "Schülerpult mit Stuhl", + "papertray" : "Papierfach", + "wastecan" : "Papierkorb", + "plant" : "Pflanze", + "plant2" : "Pflanze", + "plant3" : "Pflanze", + "projectionscreen" : "Projektionswand", + "are you sure" : "Sind Sie sicher?" +}; + +function __(key) { + if (translation[key]) { + return translation[key]; + } + + return key; +} diff --git a/modules-available/roomplanner/js/lib/jquery-collision.js b/modules-available/roomplanner/js/lib/jquery-collision.js new file mode 100644 index 00000000..98e37882 --- /dev/null +++ b/modules-available/roomplanner/js/lib/jquery-collision.js @@ -0,0 +1,394 @@ +/* +Copyright (c) 2011 Sean Cusack + +MIT-LICENSE: + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +(function($){ + + // + // Private classes + // + + function CollisionCoords( proto, containment ) + { + if( ! proto ) + { + // default if nothing else: + this.x1 = this.y1 = this.x2 = this.y2 = 0; + this.proto = null; + } + else if( "offset" in proto ) + { + // used to grab stuff from a jquery object + // if it has collision-coordinates data, use that + // otherwise just pull in the offset + + var d = proto.data("jquery-collision-coordinates"); + if( d ) + { + this.x1 = d.x1; + this.y1 = d.y1; + this.x2 = d.x2; + this.y2 = d.y2; + } + else if( containment && containment.length && containment.length >= 4 ) + { + this.x1 = containment[0]; + this.y1 = containment[1]; + this.x2 = containment[2]+proto.outerWidth(true); + this.y2 = containment[3]+proto.outerHeight(true); + } + else if( proto.parent().length <= 0 ) + { + this.x1 = parseInt(proto.css("left" )) || 0; + this.y1 = parseInt(proto.css("top" )) || 0; + this.x2 = parseInt(proto.css("width" )) || 0; + this.y2 = parseInt(proto.css("height")) || 0; + this.x2 += this.x1; + this.x2 += (parseInt(proto.css("margin-left"))||0) + (parseInt(proto.css("border-left"))||0) + (parseInt(proto.css("padding-left"))||0) + + (parseInt(proto.css("padding-right"))||0) + (parseInt(proto.css("border-right"))||0) + (parseInt(proto.css("margin-right"))||0); + this.y2 += this.y1; + this.y2 += (parseInt(proto.css("margin-top"))||0) + (parseInt(proto.css("border-top"))||0) + (parseInt(proto.css("padding-top"))||0) + + (parseInt(proto.css("padding-bottom"))||0) + (parseInt(proto.css("border-bottom"))||0) + (parseInt(proto.css("margin-bottom"))||0); + } + else + { + var o = proto.offset(); + this.x1 = o.left - (parseInt(proto.css("margin-left"))||0); // not also border -- offset starts from inside margin but outside border + this.y1 = o.top - (parseInt(proto.css("margin-top" ))||0); // not also border -- offset starts from inside margin but outside border + this.x2 = this.x1 + proto.outerWidth(true); + this.y2 = this.y1 + proto.outerHeight(true); + } + this.proto = proto; + } + else if( "x1" in proto ) + { + // used to effectively "clone" + this.x1 = proto.x1; + this.y1 = proto.y1; + this.x2 = proto.x2; + this.y2 = proto.y2; + this.proto = proto; + } + + if( "dir" in proto ) + { + this.dir = proto.dir; + } + } + + CollisionCoords.prototype.innerContainer = function() + { + var clone = new CollisionCoords( this ); + if( this.proto["css"] ) + { + clone.x1 += parseInt( this.proto.css( "margin-left" ) ) || 0; + clone.x1 += parseInt( this.proto.css( "border-left" ) ) || 0; + clone.x1 += parseInt( this.proto.css("padding-left" ) ) || 0; + clone.x2 -= parseInt( this.proto.css("padding-right" ) ) || 0; + clone.x2 -= parseInt( this.proto.css( "border-right" ) ) || 0; + clone.x2 -= parseInt( this.proto.css( "margin-right" ) ) || 0; + clone.y1 += parseInt( this.proto.css( "margin-top" ) ) || 0; + clone.y1 += parseInt( this.proto.css( "border-top" ) ) || 0; + clone.y1 += parseInt( this.proto.css("padding-top" ) ) || 0; + clone.y2 -= parseInt( this.proto.css("padding-bottom") ) || 0; + clone.y2 -= parseInt( this.proto.css( "border-bottom") ) || 0; + clone.y2 -= parseInt( this.proto.css( "margin-bottom") ) || 0; + } + return clone; + } + + CollisionCoords.prototype.move = function( dx, dy ) + { + this.x1 += dx; + this.x2 += dx; + this.y1 += dy; + this.y2 += dy; + return this; + }; + + CollisionCoords.prototype.update = function( obj ) + { + if( "x1" in obj ) this.x1 = obj["x1"]; + if( "x2" in obj ) this.x1 = obj["x2"]; + if( "y1" in obj ) this.x1 = obj["y1"]; + if( "y2" in obj ) this.x1 = obj["y2"]; + if( "left" in obj ) + { + var w = this.x2-this.x1; + this.x1 = obj["left"]; + this.x2 = this.x1 + w; + } + if( "top" in obj ) + { + var h = this.y2-this.y1; + this.y1 = obj["top"]; + this.y2 = this.y1 + h; + } + if( "offset" in obj ) + { + var o = obj.offset(); + this.update( o ); + this.x2 = this.x1 + obj.width(); + this.y2 = this.y1 + obj.height(); + } + if( "dir" in obj ) this.x1 = obj["dir"]; + return this; + }; + + CollisionCoords.prototype.width = function() { return ( this.x2 - this.x1 ); }; + CollisionCoords.prototype.height = function() { return ( this.y2 - this.y1 ); }; + CollisionCoords.prototype.centerx = function() { return ( this.x1 + this.x2 ) / 2; }; + CollisionCoords.prototype.centery = function() { return ( this.y1 + this.y2 ) / 2; }; + + + CollisionCoords.prototype.toString = function() + { + return ( this.proto["get"] ? "#"+this.proto.get(0).id : "" ) + "["+[this.x1,this.y1,this.x2,this.y2].join(",")+"]"; + }; + + // the big mistake in a lot of collision-detectors, + // make floating-point arithmetic work for you, not against you: + CollisionCoords.EPSILON = 0.001; + + CollisionCoords.prototype.containsPoint = function( x, y, inclusive ) + { + if( ! inclusive ) inclusive = false; + var epsilon = ( inclusive ? -1 : +1 ) * CollisionCoords.EPSILON; + if( ( x > ( this.x1 + epsilon ) && x < ( this.x2 - epsilon ) ) && + ( y > ( this.y1 + epsilon ) && y < ( this.y2 - epsilon ) ) ) + return true; + else + return false; + }; + + CollisionCoords.prototype.overlaps = function( other, inclusive ) + { + var hit = this._overlaps( other, inclusive ); + if( hit.length > 0 ) return hit; + hit = other._overlaps( this, inclusive ); + if( hit.length > 0 ) + { + hit[0].dir = hit[0].dir == "Inside" ? "Outside" : + hit[0].dir == "Outside" ? "Inside" : + hit[0].dir == "N" ? "S" : + hit[0].dir == "S" ? "N" : + hit[0].dir == "W" ? "E" : + hit[0].dir == "E" ? "W" : + hit[0].dir == "NE" ? "SW" : + hit[0].dir == "SW" ? "NE" : + hit[0].dir == "SE" ? "NW" : + hit[0].dir == "NW" ? "SE" : + undefined; + } + return hit || []; + } + + CollisionCoords.prototype._overlaps = function( other, inclusive ) + { + var c1 = other; + var c2 = this; + if( ! inclusive ) inclusive = false; + var ax = c1.centerx(); + var ay = c1.centery(); + // nine points to check whether they're in e2: e1's four corners, e1's center-sides, and e1's center + // if center of e1 is within e2, there's some kind of total inclusion + var points = [ [c1.x1,c1.y1,"SE"], [c1.x2,c1.y1,"SW"], [c1.x2,c1.y2,"NW"], [c1.x1,c1.y2,"NE"], [ax,c1.y1,"S"], [c1.x2,ay,"W"], [ax,c1.y2,"N"], [c1.x1,ay,"E"], [ax,ay,undefined] ]; + var hit = null; + var dirs = { NW:false, N:false, NE:false, E:false, SE:false, S:false, SW:false, W:false }; + for( var i=0; i0 ) + { + var roff = r.offset(); + xoff -= roff.left; + yoff -= roff.top; + } + } + var c = $(as).offset( { left: xoff, top: yoff } ) + .width( e.overlap.width() ) + .height( e.overlap.height() ); + if( cd ) c.data(cd, $(e.target.proto)); + if( od ) c.data(od, $(e.obstacle.proto)); + if( dd && e.overlap.dir ) c.data(dd, e.overlap.dir); + return c; + } ); + return combineQueries( array ); + }; + +})(jQuery); diff --git a/modules-available/roomplanner/js/lib/jquery-ui-draggable-collision.js b/modules-available/roomplanner/js/lib/jquery-ui-draggable-collision.js new file mode 100644 index 00000000..3ef553b1 --- /dev/null +++ b/modules-available/roomplanner/js/lib/jquery-ui-draggable-collision.js @@ -0,0 +1,826 @@ +/* +Copyright (c) 2014 Djuri Baars +Copyright (c) 2011 Sean Cusack + +MIT-LICENSE: + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +(function($){ + // Default settings + var DEBUG = false; + var VISUAL_DEBUG = DEBUG; + + $.ui.draggable.prototype.options.obstacle = ".ui-draggable-collision-obstacle"; + $.ui.draggable.prototype.options.restraint = ".ui-draggable-collision-restraint"; + $.ui.draggable.prototype.options.collider = ".ui-draggable-dragging"; + $.ui.draggable.prototype.options.colliderData = null; + $.ui.draggable.prototype.options.obstacleData = null; + $.ui.draggable.prototype.options.directionData = null; + $.ui.draggable.prototype.options.relative = "body"; + $.ui.draggable.prototype.options.preventCollision = false; + $.ui.draggable.prototype.options.preventProtrusion = false; + $.ui.draggable.prototype.options.collisionVisualDebug = false; + $.ui.draggable.prototype.options.multipleCollisionInteractions = []; + + // Plugin setup + $.ui.plugin.add( "draggable", "obstacle", { + create: function(event,ui){ handleInit .call( this, event, ui ); }, + start: function(event,ui){ handleStart .call( this, event, ui ); } , + drag: function(event,ui){ return handleCollide.call( this, event, ui ); } , + stop: function(event,ui){ handleCollide.call( this, event, ui ); + handleStop .call( this, event, ui ); } + }); + + // NOTE: the "handleCollide" function must do all collision and protrusion detection at once, in order for the + // simultaneous prevention cases to work properly, so basically, if you ask for both, the obstacle events + // will occur first (and do both), and then these will trigger, see that they have an obstacle, and not + // do anything a second time + $.ui.plugin.add( "draggable", "restraint", { + create: function(event,ui){ handleInit .call( this, event, ui ); }, + start: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle ) // if there are obstacles, we already handled both + { + handleStart .call( this, event, ui ); + } + } , + drag: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle ) // if there are obstacles, we already handled both + { + return handleCollide.call( this, event, ui ); + } + } , + stop: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle ) // if there are obstacles, we already handled both + { + handleCollide.call( this, event, ui ); + handleStop .call( this, event, ui ); + } + } + }); + + // Likewise, if we already have an obstacle or restraint, we've done it all, so don't repeat + $.ui.plugin.add( "draggable", "multipleCollisionInteractions", { + create: function(event,ui){ handleInit .call( this, event, ui ); }, + start: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle && + ! $(this).data("ui-draggable").options.restraint ) + { + handleStart .call( this, event, ui ); + } + } , + drag: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle && + ! $(this).data("ui-draggable").options.restraint ) + { + return handleCollide.call( this, event, ui ); + } + } , + stop: function(event,ui){ if( ! $(this).data("ui-draggable").options.obstacle && + ! $(this).data("ui-draggable").options.restraint ) + { + handleCollide.call( this, event, ui ); + handleStop .call( this, event, ui ); + } + } + }); + + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Private Classes + // + + //////////// + // EVENTS // + //////////// + + function CollisionEvent( eventType, collider, obstacle, collisionType, collision ) + { + jQuery.Event.call( this, eventType ); + this.collider = collider; + this.obstacle = obstacle; + this.collisionType = collisionType; + this.collision = collision; + } + + CollisionEvent.prototype = new $.Event( "" ); + + function CollisionCheckEvent( eventType, collider, obstacle, collisionType ) + { + jQuery.Event.call( this, eventType ); + this.collider = collider; + this.obstacle = obstacle; + this.collisionType = collisionType; + } + + CollisionCheckEvent.prototype = new $.Event( "" ); + + ////////////////////// + // COORDINATE CLASS // + ////////////////////// + + function Coords( x1, y1, x2, y2 ) + { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } + + Coords.prototype.width = function() { return (this.x2-this.x1); }; + Coords.prototype.height = function() { return (this.y2+this.y1); }; + Coords.prototype.centerx = function() { return (this.x1+this.x2)/2; }; + Coords.prototype.centery = function() { return (this.y1+this.y2)/2; }; + Coords.prototype.area = function() { return this.width()*this.height(); }; + Coords.prototype.hash = function() { return "["+[this.x1,this.y1,this.x2,this.y2].join(",")+"]"; }; + Coords.prototype.distance = function(c) + { + return this.distanceTo( c.centerx(), c.centery() ); + }; + + Coords.prototype.distanceTo = function(x,y) + { + var dx = this.centerx()-x; + var dy = this.centerx()-y; + return Math.sqrt( dx*dx + dy*dy ); + }; + + ///////////////////////////////// + // COORDINATE HELPER FUNCTIONS // + ///////////////////////////////// + + // create a box with the same total area, centered at center of gravity + function centerGravity( coordsList ) + { + if( coordsList.length <= 0 ) return null; + var wsumx = 0; + var wsumy = 0; + var suma = 0; + for( var i = 0; i < coordsList.length; i++ ) + { + suma += coordsList[i].area(); + wsumx += coordsList[i].centerx() * coordsList[i].area(); + wsumy += coordsList[i].centery() * coordsList[i].area(); + } + var d = Math.sqrt( suma ); // dimension of square (both w and h) + return new Coords( (wsumx/suma) - d/2, (wsumy/suma) - d/2, (wsumx/suma) + d/2, (wsumy/suma) + d/2 ); + } + + // convert a jq object into a Coords object, handling all the nice-n-messy offsets and margins and crud + function jq2Coords( jq, dx, dy ) + { + var x1,y1, x2, y2; + + if( !dx ) dx=0; + if( !dy ) dy=0; + if( jq.parent().length > 0 ) + { + x1 = dx + jq.offset().left - (parseInt(jq.css("margin-left"))||0); + y1 = dy + jq.offset().top - (parseInt(jq.css("margin-top" ))||0); + x2 = x1 + jq.outerWidth( true); + y2 = y1 + jq.outerHeight(true); + } else { + x1 = dx + parseInt(jq.css("left" )) || 0; + y1 = dy + parseInt(jq.css("top" )) || 0; + x2 = x1 + parseInt(jq.css("width" )) || 0; + y2 = y1 + parseInt(jq.css("height")) || 0; + x2 += (parseInt(jq.css("margin-left"))||0) + (parseInt(jq.css("border-left"))||0) + (parseInt(jq.css("padding-left"))||0) + + (parseInt(jq.css("padding-right"))||0) + (parseInt(jq.css("border-right"))||0) + (parseInt(jq.css("margin-right"))||0); + y2 += (parseInt(jq.css("margin-top"))||0) + (parseInt(jq.css("border-top"))||0) + (parseInt(jq.css("padding-top"))||0) + + (parseInt(jq.css("padding-bottom"))||0) + (parseInt(jq.css("border-bottom"))||0) + (parseInt(jq.css("margin-bottom"))||0); + + } + return new Coords( x1, y1, x2, y2 ); + } + + function jqList2CenterGravity( jqList, dx, dy ) + { + return centerGravity( jqList.toArray().map( function(e,i,a){ return jq2Coords($(e),dx,dy); } ) ); + } + + ///////////////////// + // COLLISION CLASS // + ///////////////////// + + function Collision( jq, cdata, odata, type, dx, dy, ddata, recentCenterOfGravity, mousex, mousey ) + { + if(!recentCenterOfGravity) recentCenterOfGravity=jqList2CenterGravity($(this.collider), dx, dy); + if(!dx) dx = 0; + if(!dy) dy = 0; + this.collision = $(jq ); + this.collider = $(jq.data(cdata)); + this.obstacle = $(jq.data(odata)); + this.direction = jq.data(ddata); + this.type = type; + this.dx = dx; + this.dy = dy; + this.centerOfMass = recentCenterOfGravity; + this.collisionCoords = jq2Coords( this.collision ); + this.colliderCoords = jq2Coords( this.collider, dx, dy ); + this.obstacleCoords = jq2Coords( this.obstacle ); + if(!mousex) mousex = this.colliderCoords.centerx(); + if(!mousey) mousex = this.colliderCoords.centery(); + this.mousex = mousex; + this.mousey = mousey; + } + + // amount "embedded" into obstacle in x-direction + // might be negative or zero if it doesn't make sense + // this is used with the delta calculation - if its <= 0, it'll get skipped + // dirx is -1 or +1, depending on which way we are orienting things (which way we want to move it) + // NOTE: originally, we were taking the collision area into account, but it's easier to recalc embed value + Collision.prototype.embedx = function( dirx ) + { + if( this.type == "collision" ) + { + if( dirx < 0 ) /* want to move left */ return this.colliderCoords.x2 - this.obstacleCoords.x1; + if( dirx > 0 ) /* want to move right */ return this.obstacleCoords.x2 - this.colliderCoords.x1; + } + else if( this.type == "protrusion" ) + { + // if we're embedded in a top/bottom edge, don't move left or right, silly: + if( ( this.direction == "N" ) || ( this.direction == "S" ) ) return 0; + + if( dirx < 0 ) /* want to move left */ return this.colliderCoords.x2 - this.obstacleCoords.x2; + if( dirx > 0 ) /* want to move right */ return this.obstacleCoords.x1 - this.colliderCoords.x1; + } + return 0; + }; + + // and ditto for y-direction + Collision.prototype.embedy = function( diry ) + { + if( this.type == "collision" ) + { + if( diry < 0 ) /* want to move up */ return this.colliderCoords.y2 - this.obstacleCoords.y1; + if( diry > 0 ) /* want to move down */ return this.obstacleCoords.y2 - this.colliderCoords.y1; + } + else if( this.type == "protrusion" ) + { + // if we're embedded in a left/right edge, don't move up or down, silly: + if( ( this.direction == "E" ) || ( this.direction == "W" ) ) return 0; + + if( diry < 0 ) /* want to move up */ return this.colliderCoords.y2 - this.obstacleCoords.y2; + if( diry > 0 ) /* want to move down */ return this.obstacleCoords.y1 - this.colliderCoords.y1; + } + return 0; + }; + + // distance from collision to recent center of mass, i.e. it used to be in one place, and we're dragging it + // to another, so the "overlap" of some collider happens a certain "distance" from the center of where stuff + // used to be... + Collision.prototype.distance = function() + { + var cx1 = this.centerOfMass.centerx(); + var cy1 = this.centerOfMass.centery(); + var cx2 = this.collisionCoords.centerx(); + var cy2 = this.collisionCoords.centery(); + return Math.sqrt( (cx2-cx1)*(cx2-cx1) + (cy2-cy1)*(cy2-cy1) ); + }; + + Collision.prototype.hash = function(){ return this.type+"["+this.colliderCoords.hash()+","+this.obstacleCoords.hash()+"]"; }; + + //////////////////////////////// + // COLLISION HELPER FUNCTIONS // + //////////////////////////////// + + // sort so that collisions closest to recent center of mass come first -- we need to resolve them in order + function collisionComparison(c1,c2) + { + var cd1 = c1.distance(); + var cd2 = c2.distance(); + return ( ( cd1 < cd2 ) ? -1 : ( cd1 > cd2 ) ? +1 : 0 ); + } + + /////////////////////// + // INTERACTION CLASS // + /////////////////////// + + function Interaction( draggable, options ) + { + this.draggable = $(draggable); + this.obstacleSelector = options.obstacle || ".ui-draggable-collision-obstacle" ; + this.restraintSelector = options.restraint || ".ui-draggable-collision-restraint" ; + this.obstacle = $(options.obstacle || ".ui-draggable-collision-obstacle" ); + this.restraint = $(options.restraint || ".ui-draggable-collision-restraint" ); + var collider = options.collider || ".ui-draggable-dragging" ; + this.collider = draggable.find( collider ).andSelf().filter( collider ); + this.colliderData = options.colliderData || null; + this.obstacleData = options.obstacleData || null; + this.directionData = options.directionData || null; + this.relative = options.relative || "body"; + this.preventCollision = options.preventCollision || false; + this.preventProtrusion = options.preventProtrusion || false; + this.collisions = $(); + this.protrusions = $(); + } + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // + // Main handler functions + // + + function uiTrigger( _this, widget, eventName, event, ui ) + { + $.ui.plugin.call( widget, eventName, event, ui ); + _this.trigger( event, ui ); + } + + function handleInit( event, ui, type ) + { + var w = $(this).data("ui-draggable"); + var o = w.options; + } + + function handleStart(event,ui) + { + VISUAL_DEBUG = $(this).data("ui-draggable").options.collisionVisualDebug; + $(this).data( "jquery-ui-draggable-collision-recent-position", ui.originalPosition ); + } + + function handleStop (event,ui) + { + $(this).removeData("jquery-ui-draggable-collision-recent-position"); + if( VISUAL_DEBUG ) $(".testdebug").remove(); + VISUAL_DEBUG = DEBUG; + } + + // This is the monolithic workhorse of the plugin: + // * At the beginning and end, it sends out all the pre/post-collision/protrusion events + // * In the middle, it both calculates collisions, and prevents them if requested + // * When it's either tried its best, or found a fit, or wasn't required to avoid obstacles, it sends out actual collision events + // + // Inside the first big loop is the actual "prevention" logic + // * It calculates the "intended position" of everything, checks all the collision logic, and if it needs to, + // then calculates a delta movement to see if that fits, and the loop continues until it either works, + // or an arbitrary iteration limit is reached, just in case it gets in a loop + // * The delta function is described in more detail below + // + // During all the "trying a new position" and "determining collisions" calculations, it's not using purely the + // current position of the colliders -- it can't because the draggable is now in a new "intended position", + // and with it, all its children, including any collider children + // * So, it keeps track of a dx and dy from known position, and populates a "jquery-collision-coordinates" data value + // that the jquery-collision plugin takes into account during the calculations + // * Also, the Coords() values get populated with these offsets at various times, so that they reflect "intended position" + // + // Note also that the collider, obstacle, and direction data fields are temporarily overriden (because we need them here, + // and the user may not have asked for them), and then erased and placed where the user wants them, right before + // sending out the collision events + // + // Note also that the collisions and protrusions requested are "relative" to "body". If the use asked for + // something relative, it has to get translated right before sending out the events... + function handleCollide( event, ui ) + { + // Note that $(this) is the draggable that's moving - it has a ui.position that moves acording to where + // the draggable is "about to move". However, our "collidable" objects might not be the same as $(this) - + // they might be child elements. So we need to keep track of recent and present position so we can apply the + // "intended" dx and dy to all the moving elements: + var rp = $(this).data("jquery-ui-draggable-collision-recent-position"); + + if( DEBUG ) { console.log( "handleCollision ******************************************************************" ); } + + if( VISUAL_DEBUG ) $(".testdebug").remove(); + + var ctyp = "collision"; + var prec = "precollision"; + var postc = "postcollision"; + var ptyp = "protrusion"; + var prep = "preprotrusion"; + var postp = "postprotrusion"; + + // NOTE: widget is used for uiTrigger, otherwise event-binders don't get a "ui" variable + var widget = $(this).data("ui-draggable"); + var o = widget.options; + + // List of Interactions -- first one is the main set of args from the .draggable() setup call, rest are multipleCollisionInteractions:[...] + var ilist = []; + + if( o.obstacle || o.restraint ) ilist.push( new Interaction( $(this), o ) ); + if( o.multipleCollisionInteractions && o.multipleCollisionInteractions['length'] ) + { + var mci = o.multipleCollisionInteractions; + for( var i=0; i").offset( { left: cn[0], top: cn[1] } ) + .width( cn[2]-cn[0]+$(this).width( ) ) // because it had the draggable's size chopped out :-P + .height( cn[3]-cn[1]+$(this).height() ); // because it had the draggable's size chopped out :-P + + if( VISUAL_DEBUG ) + $cont.clone() + .css("background","transparent") + .css("border","1px solid blue") + .css("margin","-1px").css("padding","0px") + .addClass("testdebug") + .appendTo(); + } + + var deltaCache = {}; + var iter = 0; + while( iter < maxiter ) + { + iter++; + + // Calc offset from recent move, so we can move the objects that are "coming along for the ride" before calculating their + // collisions. Otherwise the ui variable only keeps track of the main draggable, not its contents, which may contain + // the actual things that collide + dx = ui.position.left - rp.left; + dy = ui.position.top - rp.top; + + // Empty the collision containers outside the interaction loop: + ocl = []; + cocl = []; + pocl = []; + + for( var i=0; i", colliderData: d1, obstacleData: d2, directionData: d3, relative: "body" } ); + if( DEBUG ) { console.log( "collisions", oc ); } + + // Add the interaction settings to their data, so we can pick it apart later: + oc.data( di, ilist[i] ); + + // And add the collisions to the interaction: + ilist[i].collisions = ilist[i].collisions.add(oc); + + // And if there are any, make the appropriate Collision() objects and add them to the list + if( oc.length > 0 ) + { + cocl = oc.toArray().map( function(e,i,a){ return new Collision($(e), d1, d2, "collision" , dx, dy, d3, cog, event.pageX, event.pageY ); } ); + ocl = ocl.concat( cocl ); + if(VISUAL_DEBUG) $("c"+iter+"").appendTo(oc.addClass("testdebug").css("position","absolute").css("padding","0px") + .css("border","1px solid black").css("margin","-1").appendTo("body")); + } + + // Calculate protrusions likewise: + oc = $($c[ci]).collision( $r, { mode: "protrusion", as: "
", colliderData: d1, obstacleData: d2, directionData: d3, relative: "body" } ); + if( DEBUG ) { console.log( "protrusions", oc ); } + + // Add the interaction settings to their data, so we can pick it apart later: + oc.data( di, ilist[i] ); + + // And add the protrusions to the interaction: + ilist[i].protrusions = ilist[i].protrusions.add( oc ); + + // And if there are any, make the appropriate Collision() objects and add them to the list + if( oc.length > 0 ) + { + pocl = oc.toArray().map( function(e,i,a){ return new Collision($(e), d1, d2, "protrusion", dx, dy, d3, cog, event.pageX, event.pageY ); } ); + ocl = ocl.concat( pocl ); + if(VISUAL_DEBUG) $("p"+iter+"").appendTo(oc.addClass("testdebug").css("position","absolute").css("padding","0px") + .css("border","1px solid magenta").css("margin","-1").appendTo("body")); + } + } + + // Now remove coordinate offsets before sending events, otherwise event results might futz with em: + $c.each( function(){ $(this).removeData( "jquery-collision-coordinates" ); } ); + } + + if( widget.containment ) + { + // Add offset to coordinates before figuring out collisions, because we're basing it on "where its about to go", not "where it is": + // (Don't do this for anything but colliders! Applying to obstacles or restrictions or containment screws things up!!) + $(this).each( function(){ $(this).data( "jquery-collision-coordinates", jq2Coords($(this),dx,dy) ); } ); + + // Check protrusion from container as well + // NOTE: since draggable plugin has already applied containment, if we accidentally move it outside, it won't fix it for us + var $cc = $(this).collision( $cont, { mode: "protrusion", as: "
", colliderData: d1, obstacleData: d2, directionData: d3, relative: "body" } ); + ccl = $cc.toArray().map( function(e,i,a){ return new Collision($(e), d1, d2, "protrusion", dx, dy, d3, jqList2CenterGravity($c), event.pageX, event.pageY ); } ); + if(VISUAL_DEBUG) $("x"+iter+"").appendTo($cc.addClass("testdebug").css("position","absolute") + .css("padding","0px").css("border","1px solid blue").css("margin","-1").appendTo("body")); + + // Now remove coordinate offsets before sending events, otherwise event results might futz with em: + $(this).each( function(){ $(this).removeData( "jquery-collision-coordinates" ); } ); + } + + if( DEBUG ) console.log("checking if we have any collisions at all..."); + // If there's no collisions, INCLUDING the container, stop now, don't keep doing stuff + if( ( cocl.length <= 0 ) && ( pocl.length <= 0 ) && ( ccl.length <= 0 ) ) break; + + var doneAdjusting = true; + + // Go through each interaction -- if any of them break the prevention rule, we aren't done adjusting yet + for( var i=0; i 0 ) ) + { + if( DEBUG ) { console.log( "not trying to prevent anything, but jumped our containment", ilist[i] ); } + doneAdjusting = false; + } + + if( DEBUG ) console.log("checking if we want to block something we have collided with..."); + // More specifically, if aren't any collisions that we actually want to prevent, stop -- though we have to think of this in the opposite sense: + // if we DO either + // want to prevent collisions yet have a collision or containment failure, OR + // want to prevent protrusions yet have a protrusion or a containment failure, + // then DON'T STOP + if( ( ilist[i].preventCollision && ( ( ilist[i].collisions .length > 0 ) || ( ccl.length > 0 ) ) ) || + ( ilist[i].preventProtrusion && ( ( ilist[i].protrusions.length > 0 ) || ( ccl.length > 0 ) ) ) ) + { + if( DEBUG ) { console.log( "trying to prevent something that we're still hitting", ilist[i] ); } + doneAdjusting = false; + } + } + + if( doneAdjusting ) + { + if( DEBUG ) { console.log( "done adjusting" ); } + break; + } + + if( DEBUG ) console.log("calculating delta with ocl,ccl=",ocl,ccl); + // Calculate a delta to move, based on collisions+protrusions and containment + var d = delta( ocl.concat(), ccl, deltaCache ); + + if( DEBUG ) console.log("dx=",d.dx,"dy=",d.dy); + // If there's nothing to do, stop -- it shouldn't happen if we had collisions, but... + if( d.dx == 0 && d.dy == 0 ) break; + + // Apply the movement, and let the loop run again, to see if our proposed delta movement was any good + ui.position.left += d.dx; + ui.position.top += d.dy; + } + + dx = ui.position.left - rp.left; + dy = ui.position.top - rp.top; + /* deactivated for now - doesn't seem to be needed - may revisit later: + // if our new center of gravity is further from the mouse position than the last one, revert + var origd = jqList2CenterGravity($c,origdx,origdy).distanceTo( event.pageX, event.pageY ); + var newd = jqList2CenterGravity($c, dx, dy).distanceTo( event.pageX, event.pageY ); + if( newd > origd ) { console.log("center of gravity issue: ",origd,newd); } // add this to revert + */ + + // If we failed to find a fit, revert to the previous position + if( ( iter > maxiter ) || // if we ran out of iterations, tough, revert + ( ccl.length > 0 ) || // if we ran outside out containment, also revert + ( o.preventProtrusion && ( pocl.length > 0 ) ) || // if we have a protrusion and are trying to prevent protrusions, revert + ( o.preventCollision && ( cocl.length > 0 ) ) ) // if we have a collision and are trying to prevent collisions, revert + { + if( DEBUG ) console.log("reverting, i=",iter,"maxiter=",maxiter,"cocl=",cocl,"cocl.len=",cocl.length,"pocl=", + pocl,"pocl.len=",pocl.length,"ccl=",ccl,"ccl.len=",ccl.length, + //"newd=",newd,"origd=",origd, + "origdx=",origdx,"origdy=",origdy,"dx=",dx,"dy=",dy); + ui.position.left = origleft; + ui.position.top = origtop; + } + + // NOW we can go through and actually send out the events -- we couldn't before, because we might have hit + // collisions multiple times during the course of trying to prevent them + for( var ci=0; ci 0 ) + { + // note _pop_ not _shift_. we want to grab furthest collision from center of mass first... + // this one is likely the one causing the most problems, because something is embedded deeply into + // some obstacle: + var thisc = c.pop(); + var co = thisc.obstacleCoords; + var cc = thisc.colliderCoords; + var cv = thisc.collisionCoords; + var ct = thisc.type; + var cd = thisc.direction; + var key = thisc.hash(); + var dirx = ( thisc.type=="protrusion" ? ( cc.centerx() > co.centerx() ? -1 : +1 ) + : ( cc.centerx() > co.centerx() ? +1 : -1 ) ); + var diry = ( thisc.type=="protrusion" ? ( cc.centery() > co.centery() ? -1 : +1 ) + : ( cc.centery() > co.centery() ? +1 : -1 ) ); + var dx = thisc.embedx( dirx ); + var dy = thisc.embedy( diry ); + if( DEBUG ) console.log("cv,cc,co,ct,dx,dy,thisc.dx,thisc.dy,dirx,diry,co.centerx,co.centery,cc.centerx,cc.centery,key=", + cv.hash(),cc.hash(),co.hash(),ct,dx,dy,thisc.dx,thisc.dy,dirx,diry,co.centerx(),co.centery(),cc.centerx(),cc.centery(),key); + var tryToAdjustDX = ( dx < dy ); + if( key in cache && cache[key] == "tried reverse" ) { if( DEBUG ) console.log("but already tried reverse too..."); + continue; } + else if( key in cache && cache[key] == "tried normal" ) { if( DEBUG ) console.log("but already tried this..."); + tryToAdjustDX=!tryToAdjustDX; cache[key]="tried reverse"; + } + else { cache[key]="tried normal"; } + if( tryToAdjustDX ) + { + if( VISUAL_DEBUG ) { $(""+thisc.direction+"d"+cache.deltanum+".dx="+dx+"*"+dirx+"").css("color","black").addClass("testdebug") + .css("position","absolute") + .css("white-space","nowrap").offset( { left: thisc.mousex, top: thisc.mousey + 20*(cache.deltanum-1) } ).appendTo("body"); cache.deltanum++; }; + if( dx <= 0 ) { c.push(thisc); continue; } + return { "dx":dx*dirx, "dy":0 }; + } + else + { + if( VISUAL_DEBUG ) { $(""+thisc.direction+"d"+cache.deltanum+".dy="+dy+"*"+diry+"").css("color","black").addClass("testdebug") + .css("position","absolute") + .css("white-space","nowrap").offset( { left: thisc.mousex, top: thisc.mousey + 20*(cache.deltanum-1) } ).appendTo("body"); cache.deltanum++; }; + if( dy <= 0 ) { c.push(thisc); continue; } + return { "dx":0, "dy":dy*diry }; + } + } + return { "dx":0, "dy":0 }; + }; + +})(jQuery); diff --git a/modules-available/roomplanner/page.inc.php b/modules-available/roomplanner/page.inc.php new file mode 100644 index 00000000..b533cf2f --- /dev/null +++ b/modules-available/roomplanner/page.inc.php @@ -0,0 +1,53 @@ + $query]); +// + $result = Database::simpleQuery('SELECT machineuuid, macaddr, clientip, hostname ' + . 'FROM machine ' + . "WHERE machineuuid LIKE :query " + . " OR macaddr LIKE :query " + . " OR clientip LIKE :query " + . " OR hostname LIKE :query ", ['query' => "%$query%"]); + + $returnObject = ['machines' => []]; + + while ($row = $result->fetch(PDO::FETCH_ASSOC)) { + $returnObject['machines'][] = $row; + } + echo json_encode($returnObject, JSON_PRETTY_PRINT); + + } + } +} diff --git a/modules-available/roomplanner/style.css b/modules-available/roomplanner/style.css new file mode 100644 index 00000000..7ad7407b --- /dev/null +++ b/modules-available/roomplanner/style.css @@ -0,0 +1,763 @@ +@CHARSET "UTF-8"; + +body.split #drawpanel { + width:60%; + float: right;} + + +body.full #drawpanel { + width:90%; + float: none; + margin: 0 auto 20px; + } + +#drawpanel { + position:relative;} + +#drawarea { + background: url('images/grid_100_sep.png'); + background-size: 100px 100px;} + +#drawpanel .panel-body { + padding:0; + margin: 0; + overflow: hidden; + height: 350px;} + +#scaleContainer { + position: absolute; + bottom: 5px; + right: 30px; + width: 15%; + z-index: 10000;} + +#scaleslider { + position:relative;} + + + +#scaleContainer .glyphicon { + position: absolute; + top: -2px; + font-size: 1.1em;} + +#scaleContainer .glyphicon-zoom-out { + left:-20px;} + +#scaleContainer .glyphicon-zoom-in { + right:-20px; } + + +[itemlook="computer"] { background: url('images/computer/computer.png') no-repeat;} + + +[itemlook="door-nw"] { background: url('images/wall/door-nw.png') no-repeat;} +[itemlook="door-ne"] { background: url('images/wall/door-ne.png') no-repeat;} +[itemlook="door-sw"] { background: url('images/wall/door-sw.png') no-repeat;} +[itemlook="door-se"] { background: url('images/wall/door-se.png') no-repeat;} +[itemlook="door-en"] { background: url('images/wall/door-en.png') no-repeat;} +[itemlook="door-es"] { background: url('images/wall/door-es.png') no-repeat;} +[itemlook="door-wn"] { background: url('images/wall/door-wn.png') no-repeat;} +[itemlook="door-ws"] { background: url('images/wall/door-ws.png') no-repeat;} + +[itemlook="copier"] { + background: url('images/electricalDevices_wIP/copier.png') no-repeat; + } + +/* +[itemlook="pc"] { + background: url('images/electricalDevices_wIP/pc.png') no-repeat; + z-index:100; + } +*/ +[itemlook="pc-east"] { + background: url('images/electricalDevices_wIP/pc_east.png') no-repeat; + } + +[itemlook="pc-south"] { + background: url('images/electricalDevices_wIP/pc_south.png') no-repeat; + } + +[itemlook="pc-west"] { + background: url('images/electricalDevices_wIP/pc_west.png') no-repeat; + } + +[itemlook="pc-north"] { + background: url('images/electricalDevices_wIP/pc_north.png') no-repeat; + + } + +[itemlook="printer"] { + background: url('images/electricalDevices_wIP/printer.png') no-repeat; + + } + +[itemlook="telephone"] { + background: url('images/electricalDevices_wIP/telephone.png') no-repeat; + + } + +[itemlook="flatscreen"] { + background: url('images/electricalDevices_woIP/flatscreen.png') no-repeat; + + } + +[itemlook="lamp"] { + background: url('images/electricalDevices_woIP/lamp.png') no-repeat; + + } + +[itemlook="tvcamera"] { + background: url('images/electricalDevices_woIP/tvcamera.png') no-repeat; + + } + +[itemlook="4chairs1squaretable"] { + background: url('images/furniture/4chairs1squaretable.png') no-repeat; + + } + +/* +[itemlook="6chairs1table"] { + background: url('images/furniture/6chairs1table.png') no-repeat; + + } +*/ + +[itemlook="6chairs1table-horizontal"] { + background: url('images/furniture/6chairs1table_horizontal.png') no-repeat; + + } + +[itemlook="6chairs1table-vertical"] { + background: url('images/furniture/6chairs1table_vertical.png') no-repeat; + + } + +/* +[itemlook="8chairs1conferencetable"] { + background: url('images/furniture/8chairs1conferencetable.png') no-repeat; + + } +*/ + + +[itemlook="8chairs1conferencetable-horizontal"] { + background: url('images/furniture/8chairs1conferencetable_horizontal.png') no-repeat; + + } + + +[itemlook="8chairs1conferencetable-vertical"] { + background: url('images/furniture/8chairs1conferencetable_vertical.png') no-repeat; + + } + +/* +[itemlook="armchair"] { + background: url('images/furniture/armchair.png') no-repeat; + + } +*/ + +[itemlook="armchair-east"] { + background: url('images/furniture/armchair_east.png') no-repeat; + + } + +[itemlook="armchair-south"] { + background: url('images/furniture/armchair_south.png') no-repeat; + + } + +[itemlook="armchair-west"] { + background: url('images/furniture/armchair_west.png') no-repeat; + + } + +[itemlook="armchair-north"] { + background: url('images/furniture/armchair_north.png') no-repeat; + + } + +/* +[itemlook="chair"] { + background: url('images/furniture/chair.png') no-repeat; + + } +*/ + +[itemlook="chair-east"] { + background: url('images/furniture/chair_east.png') no-repeat; + + } + +[itemlook="chair-south"] { + background: url('images/furniture/chair_south.png') no-repeat; + + } + +[itemlook="chair-west"] { + background: url('images/furniture/chair_west.png') no-repeat; + + } + +[itemlook="chair-north"] { + background: url('images/furniture/chair_north.png') no-repeat; + + } + +/* +[itemlook="chair2"] { + background: url('images/furniture/chair2.png') no-repeat; + + } +*/ + +[itemlook="chair2-east"] { + background: url('images/furniture/chair2_east.png') no-repeat; + + } + +[itemlook="chair2-south"] { + background: url('images/furniture/chair2_south.png') no-repeat; + + } + +[itemlook="chair2-west"] { + background: url('images/furniture/chair2_west.png') no-repeat; + + } + +[itemlook="chair2-north"] { + background: url('images/furniture/chair2_north.png') no-repeat; + + } + +/* +[itemlook="classroomdesk"] { + background: url('images/furniture/classroomdesk.png') no-repeat; + + } +*/ + +[itemlook="classroomdesk-east"] { + background: url('images/furniture/classroomdesk_east.png') no-repeat; + + } + +[itemlook="classroomdesk-south"] { + background: url('images/furniture/classroomdesk_south.png') no-repeat; + + } + +[itemlook="classroomdesk-west"] { + background: url('images/furniture/classroomdesk_west.png') no-repeat; + + } + +[itemlook="classroomdesk-north"] { + background: url('images/furniture/classroomdesk_north.png') no-repeat; + + } + +/* +[itemlook="classroomdeskchair"] { + background: url('images/furniture/classroomdeskchair.png') no-repeat; + + } +*/ + +[itemlook="classroomdeskchair-east"] { + background: url('images/furniture/classroomdeskchair_east.png') no-repeat; + + } + +[itemlook="classroomdeskchair-south"] { + background: url('images/furniture/classroomdeskchair_south.png') no-repeat; + + } + +[itemlook="classroomdeskchair-west"] { + background: url('images/furniture/classroomdeskchair_west.png') no-repeat; + + } + +[itemlook="classroomdeskchair-north"] { + background: url('images/furniture/classroomdeskchair_north.png') no-repeat; + + } + +/* +[itemlook="classroomtable"] { + background: url('images/furniture/classroomtable.png') no-repeat; + + } +*/ + +[itemlook="classroomtable-east"] { + background: url('images/furniture/classroomtable_east.png') no-repeat; + + } + +[itemlook="classroomtable-south"] { + background: url('images/furniture/classroomtable_south.png') no-repeat; + + } + +[itemlook="classroomtable-west"] { + background: url('images/furniture/classroomtable_west.png') no-repeat; + + } + +[itemlook="classroomtable-north"] { + background: url('images/furniture/classroomtable_north.png') no-repeat; + + } + +/* +[itemlook="classroomtablechair"] { + background: url('images/furniture/classroomtablechair.png') no-repeat; + + } +*/ + +[itemlook="classroomtablechair-east"] { + background: url('images/furniture/classroomtablechair_east.png') no-repeat; + + } + +[itemlook="classroomtablechair-south"] { + background: url('images/furniture/classroomtablechair_south.png') no-repeat; + + } + +[itemlook="classroomtablechair-west"] { + background: url('images/furniture/classroomtablechair_west.png') no-repeat; + + } + +[itemlook="classroomtablechair-north"] { + background: url('images/furniture/classroomtablechair_north.png') no-repeat; + + } + +/* +[itemlook="coatrack"] { + background: url('images/furniture/coatrack.png') no-repeat; + + } +*/ + +[itemlook="coatrack-east"] { + background: url('images/furniture/coatrack_east.png') no-repeat; + + } + +[itemlook="coatrack-south"] { + background: url('images/furniture/coatrack_south.png') no-repeat; + + } + +[itemlook="coatrack-west"] { + background: url('images/furniture/coatrack_west.png') no-repeat; + + } + +[itemlook="coatrack-north"] { + background: url('images/furniture/coatrack_north.png') no-repeat; + + } + +/* +[itemlook="conferencetable"] { + background: url('images/furniture/conferencetable.png') no-repeat; + + } +*/ + +[itemlook="conferencetable-horizontal"] { + background: url('images/furniture/conferencetable_horizontal.png') no-repeat; + + } + +[itemlook="conferencetable-vertical"] { + background: url('images/furniture/conferencetable_vertical.png') no-repeat; + + } + +/* +[itemlook="couch"] { + background: url('images/furniture/couch.png') no-repeat; + + } +*/ + +[itemlook="couch-east"] { + background: url('images/furniture/couch_east.png') no-repeat; + + } + +[itemlook="couch-south"] { + background: url('images/furniture/couch_south.png') no-repeat; + + } + +[itemlook="couch-west"] { + background: url('images/furniture/couch_west.png') no-repeat; + + } + +[itemlook="couch-north"] { + background: url('images/furniture/couch_north.png') no-repeat; + + } + +/* +[itemlook="greenchair"] { + background: url('images/furniture/greenchair.png') no-repeat; + + } +*/ + +[itemlook="greenchair-east"] { + background: url('images/furniture/greenchair_east.png') no-repeat; + + } + +[itemlook="greenchair-south"] { + background: url('images/furniture/greenchair_south.png') no-repeat; + + } + +[itemlook="greenchair-west"] { + background: url('images/furniture/greenchair_west.png') no-repeat; + + } + +[itemlook="greenchair-north"] { + background: url('images/furniture/greenchair_north.png') no-repeat; + + } + +[itemlook="lecturetheaterrow"] { + background: url('images/furniture/lecturetheaterrow.png') no-repeat; + + } + +[itemlook="lecturetheaterrowseats"] { + background: url('images/furniture/lecturetheaterrowseats.png') no-repeat; + + } + +/* +[itemlook="locker"] { + background: url('images/furniture/locker.png') no-repeat; + + } +*/ + +[itemlook="locker-east"] { + background: url('images/furniture/locker_east.png') no-repeat; + + } + +[itemlook="locker-south"] { + background: url('images/furniture/locker_south.png') no-repeat; + + } + +[itemlook="locker-west"] { + background: url('images/furniture/locker_west.png') no-repeat; + + } + +[itemlook="locker-north"] { + background: url('images/furniture/locker_north.png') no-repeat; + + } + +/* +[itemlook="podium"] { + background: url('images/furniture/podium.png') no-repeat; + + } +*/ + +[itemlook="podium-east"] { + background: url('images/furniture/podium_east.png') no-repeat; + + } + +[itemlook="podium-south"] { + background: url('images/furniture/podium_south.png') no-repeat; + + } + +[itemlook="podium-west"] { + background: url('images/furniture/podium_west.png') no-repeat; + + } + +[itemlook="podium-north"] { + background: url('images/furniture/podium_north.png') no-repeat; + + } + +/* +[itemlook="roundeddesk"] { + background: url('images/furniture/roundeddesk.png') no-repeat; + + } +*/ + +[itemlook="roundeddesk-east"] { + background: url('images/furniture/roundeddesk_east.png') no-repeat; + + } + +[itemlook="roundeddesk-south"] { + background: url('images/furniture/roundeddesk_south.png') no-repeat; + + } + +[itemlook="roundeddesk-west"] { + background: url('images/furniture/roundeddesk_west.png') no-repeat; + + } + +[itemlook="roundeddesk-north"] { + background: url('images/furniture/roundeddesk_north.png') no-repeat; + + } + +[itemlook="roundtable"] { + background: url('images/furniture/roundtable.png') no-repeat; + + } + +/* +[itemlook="semicirculartable"] { + background: url('images/furniture/semicirculartable.png') no-repeat; + + } +*/ + +[itemlook="semicirculartable-east"] { + background: url('images/furniture/semicirculartable_east.png') no-repeat; + + } + +[itemlook="semicirculartable-south"] { + background: url('images/furniture/semicirculartable_south.png') no-repeat; + + } + +[itemlook="semicirculartable-west"] { + background: url('images/furniture/semicirculartable_west.png') no-repeat; + + } + +[itemlook="semicirculartable-north"] { + background: url('images/furniture/semicirculartable_north.png') no-repeat; + + } + +[itemlook="squaretable"] { + background: url('images/furniture/squaretable.png') no-repeat; + + } + +/* +[itemlook="studentdesk"] { + background: url('images/furniture/studentdesk.png') no-repeat; + + } +*/ + +[itemlook="studentdesk-east"] { + background: url('images/furniture/studentdesk_east.png') no-repeat; + + } + +[itemlook="studentdesk-south"] { + background: url('images/furniture/studentdesk_south.png') no-repeat; + + } + +[itemlook="studentdesk-west"] { + background: url('images/furniture/studentdesk_west.png') no-repeat; + + } + +[itemlook="studentdesk-north"] { + background: url('images/furniture/studentdesk_north.png') no-repeat; + + } + +/* +[itemlook="studentdeskchair"] { + background: url('images/furniture/studentdeskchair.png') no-repeat; + + } +*/ + +[itemlook="studentdeskchair-east"] { + background: url('images/furniture/studentdeskchair_east.png') no-repeat; + + } + +[itemlook="studentdeskchair-south"] { + background: url('images/furniture/studentdeskchair_south.png') no-repeat; + + } + +[itemlook="studentdeskchair-west"] { + background: url('images/furniture/studentdeskchair_west.png') no-repeat; + + } + +[itemlook="studentdeskchair-north"] { + background: url('images/furniture/studentdeskchair_north.png') no-repeat; + + } + +[itemlook="projectionscreen"] { + background: url('images/misc/projectionscreen.png') no-repeat; + + } + +[itemlook="papertray"] { + background: url('images/officeSupply/papertray.png') no-repeat; + + } + +[itemlook="wastecan"] { + background: url('images/officeSupply/wastecan.png') no-repeat; + + } + + +[itemlook="plant"] { + background: url('images/plants/plant.png') no-repeat; + + } + +[itemlook="plant2"] { + background: url('images/plants/plant2.png') no-repeat; + + } + +[itemlook="plant3"] { + background: url('images/plants/plant3.png') no-repeat; + + } + + +[itemlook|="door"] { + z-index:99; + background-size: 100% 100%;} + + +[itemlook|="window"] { + z-index: 99; + background: #ffffff; + border: 1px solid #000000;} + + +.collides { + background-color: red;} + +.marked { + background-color: blue;} + +ul.toollist { + list-style: none;} + +ul.toollist li { + display: inline-block; + padding: 2px; + margin-right: 10px;} + + +.deleteHandle { + display:none; + float: right;} + +.rotationHandle { + display:none; + float: left;} + +div.draggable:hover .rotationHandle { + display:inline; + cursor: pointer;} + +div.draggable:hover .deleteHandle { + display:inline; + cursor: pointer;} + + +[itemtype="furniture"], [itemtype="furniture_drag"] { + z-index: 99; + background-size: 100% 100%;} + +[itemtype="pc"], [itemtype="pc_drag"] { + z-index: 100; + background-size: 100% 100%; +} + +[itemlook="wall-horizontal"] { + background: url('images/wall/wall-horizontal.png') repeat #ffffff; + border: 1px solid #000000; + background-size: auto 15%; +} + +[itemlook="wall-vertical"] { + background: url('images/wall/wall-vertical.png') repeat #ffffff; + border: 1px solid #000000; + background-size: 15% auto; +} + + + +/* select popup */ +.machine-entry { + width: 100%; + border: 1px solid #999; + border-radius: 5px; + margin: 5px 20px 5px 2px; + padding: 5px 10px 5px 10px; +} + +.machine-entry .table { + font-size:12px; + margin-bottom: -5px; +} +.machine-entry .table tr { + line-height: 5px; +} + + +.machine-logo { + float: left; + width:36px; +} +.machine-logo i { + font-size: 20px; + line-height: 50px; +} +.machine-entry-header { + font-weight: bolder; + font-size: 18px; +} + +.machine-uuid { +} + +.machine-ip { +} + +.selectize-dropdown-content { + max-height : 600px; +} + diff --git a/modules-available/roomplanner/templates/page.html b/modules-available/roomplanner/templates/page.html new file mode 100644 index 00000000..a8294dc5 --- /dev/null +++ b/modules-available/roomplanner/templates/page.html @@ -0,0 +1,350 @@ + + + + + + +

Raumplaner

+ +
+
+

Werkzeuge

+
+
+ +
+
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + + +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + +
+
+ + +
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
+
+ +
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
+
+ +
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + +
  • +
    +
  • + + +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + + +
+ +
+ +
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • + + +
  • +
    +
  • +
  • +
    +
  • + +
  • +
    +
  • +
+
+ +
+
    +
  • +
    +
  • +
  • +
    +
  • + +
  • +
    +
  • +
  • +
    +
  • + + +
  • +
    +
  • +
  • +
    +
  • + +
+
+ +
+
    +
  • +
    +
  • +
  • +
    +
  • + +
+
+
+
    +
  • +
    +
  • +
  • +
    +
  • +
  • +
    +
  • +
+
+
+
    +
  • +
    +
  • +
+
+ +
+
+
+ + + +
+
+

Sketchboard

+
+
+
+
+
+
+
+ + +
+
+ + +
+ +
+

Store / Restore

+
+ Load + Serialize +
+ + +
+
+
+ + + + + + + + + -- cgit v1.2.3-55-g7522