Commit 6da1ce63 authored by Jérémie Garcia's avatar Jérémie Garcia

Bug fixes + release ready

Multiplay improved
Background drawing
File path OK for source and build versions
New Icon
parent 539dbeaa
var NwBuilder = require('nw-builder');
var gulp = require('gulp');
var gutil = require('gulp-util');
gulp.task('traj', function () {
var nw = new NwBuilder({
version: '0.12.1',
macIcns: './icon-design/icon.icns',
zip:'false',
files: [ './**',
'!./gulpfile.js',
'!./icon-design/**',
'!./cache/**',
'!./build/**',
'!./node_modules/gulp/**',
'!./node_modules/gulp-util/**',
'!./node_modules/nw-builder/**'],
//platforms: ['osx32', 'win32', 'linux32'] // change this to 'win' for/on windows
platforms: ['osx'] // change this to 'win' for/on windows
});
// Log stuff you want
nw.on('log', function (msg) {
gutil.log('nw-builder', msg);
});
// Build returns a promise, return it so the task isn't called in parallel
return nw.build().catch(function (err) {
gutil.log('nw-builder', err);
});
});
\ No newline at end of file
<html>
<head>
<script src="./jquery-ui-1.10.1.custom/js/jquery-1.9.1.js"></script>
<script src="jquery-ui-1.10.1.custom/js/jquery-ui-1.10.1.custom.js" type="text/javascript" charset="utf-8"></script>
<script src="mousetrap.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="jquery-ui-1.10.1.custom/css/base/jquery.ui.theme.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="jquery-ui-1.10.1.custom/css/base/jquery.ui.button.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="jquery-ui-1.10.1.custom/css/base/jquery.ui.resizable.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="jquery-ui-1.10.1.custom/css/base/jquery.ui.accordion.css" type="text/css" media="screen" title="no title" charset="utf-8">
<title>Web-OSC-Bridge</title>
<style>
.highlightedRow { background-color: #dedede; }
body { font-family:Helvetica, sans-serif; background-color:#ededed; }
ul { list-style:none; margin:0; padding:0;}
h3 { font-size:1em; display:inline; color:#333; margin-right:3em; margin-left:1em;}
h1 { font-size:1.2em;}
td { font-size:.6em; }
.infoTable td { border:none !important; }
.infoTable td { font-size:.8em !important; }
.infoTable tr td:first-child { text-align: right; white-space: nowrap !important; width:25%; font-color:#666; font-weight:bold;}
.infoTable tr td:last-child { width:75%; padding-left: 2em; text-align:left !important; }
table { border-collapse:collapse; width: 100%; table-layout:fixed; }
#monitorTable, #serverTable, #clientsTable, th { border: 1px solid #666;}
table thead th { font-size:.8em; }
th { white-space: nowrap !important; margin: 0; padding: 5px; font-weight:normal; font-size: .8em; background:#999; color:#fff;}
.ui-widget{font-size:.7em;}
thead tr { width: 100%; }
tbody { height: 2em;}
#clientsTableBody tr td, #monitorTableBody tr td { text-align: center; border-right:1px solid #666; border-top:1px solid #666; font-size:.9em; overflow:hidden; }
#serverTableBody td { border-right:1px solid #666; border-top:1px solid #666; }
#serverTableBody td:last-child, #serverTableBody td:nth-child(2) { text-align: center; vertical-align: top; }
#monitorTable, #serverTable, #clientsTable { border:1px solid #666; margin-bottom:1.5em; }
#clientsTable tbody, #serverTable tbody { font-size:.85em; }
#monitorTable tbody { font-size:.75em;}
#newServerTable { text-align:left ; }
input[type="text"] { width: 90%; }
.interfaceHeader { line-height:1.75em !important;}
</style>
</head>
<body>
<div id='servers'>
<div class="ui-widget-header ui-corner-all interfaceHeader">
<h3>Servers</h3>
<!-- <button id="newButton">New Server</button>
<button id="deleteButton">Remove Selected Server</button> -->
</div>
<table id='serverTable'>
<thead>
<tr>
<th width='80%'>server info</th><th width='10%'>append client id</th><th width='10%'>monitor</th>
</tr>
</thead>
<tbody id="serverTableBody">
</tbody>
</table>
</div>
<div style="height:245px ; text-align: center; diplay: block; margin:auto;">
<div id='target-qrcode'></div>
<div id='target-url' style="text-align: center; font-size:2em; margin:auto;"></div>
</div>
<div id='clients'>
<div class="ui-widget-header ui-corner-all interfaceHeader">
<h3>Clients</h3>
</div>
<table id='clientsTable'>
<thead>
<tr>
<th>id #</th><th>ip address</th><th>connected to</th><th>interface</th><th>monitor</th>
</tr>
</thead>
<tbody id="clientsTableBody">
</tbody>
</table>
</div>
<div id='monitor'>
<div class="ui-widget-header ui-corner-all interfaceHeader">
<h3>Monitor</h3>
<button id="clearMonitorButton">Clear</button>
</div>
<table id='monitorTable'>
<thead>
<tr>
<th width='10%'>server</th><th width='10%'>client id</th><th width='15%'>address / type</th><th width='15%'>typetags / channel</th><th width='50%'>values</th>
</tr>
</thead>
<tbody id="monitorTableBody">
</tbody>
</table>
</div>
<input type="file" nwfile style='display:none' id='fileButton'/>
<input type="file" nwsaveas style='display:none' id='saveFileButton'/>
<script>
if(typeof global.interface === 'undefined') {
var s = $('<script src="server.js" type="text/javascript" charset="utf-8">');
$('head').append(s);
}else{
// page reloaded, remove all servers
global.interface.removeAllServers();
}
</script>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* jQuery UI Accordion 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
.ui-accordion .ui-accordion-header {
display: block;
cursor: pointer;
position: relative;
margin-top: 2px;
padding: .5em .5em .5em .7em;
min-height: 0; /* support: IE7 */
}
.ui-accordion .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-noicons {
padding-left: .7em;
}
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
padding-left: 2.2em;
}
.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
position: absolute;
left: .5em;
top: 50%;
margin-top: -8px;
}
.ui-accordion .ui-accordion-content {
padding: 1em 2.2em;
border-top: 0;
overflow: auto;
}
/*!
* jQuery UI Button 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Button#theming
*/
.ui-button {
display: inline-block;
position: relative;
padding: 0;
line-height: normal;
margin-right: .1em;
cursor: pointer;
vertical-align: middle;
text-align: center;
overflow: visible; /* removes extra width in IE */
}
.ui-button,
.ui-button:link,
.ui-button:visited,
.ui-button:hover,
.ui-button:active {
text-decoration: none;
}
/* to make room for the icon, a width needs to be set here */
.ui-button-icon-only {
width: 2.2em;
}
/* button elements seem to need a little more width */
button.ui-button-icon-only {
width: 2.4em;
}
.ui-button-icons-only {
width: 3.4em;
}
button.ui-button-icons-only {
width: 3.7em;
}
/* button text element */
.ui-button .ui-button-text {
display: block;
line-height: normal;
}
.ui-button-text-only .ui-button-text {
padding: .4em 1em;
}
.ui-button-icon-only .ui-button-text,
.ui-button-icons-only .ui-button-text {
padding: .4em;
text-indent: -9999999px;
}
.ui-button-text-icon-primary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 1em .4em 2.1em;
}
.ui-button-text-icon-secondary .ui-button-text,
.ui-button-text-icons .ui-button-text {
padding: .4em 2.1em .4em 1em;
}
.ui-button-text-icons .ui-button-text {
padding-left: 2.1em;
padding-right: 2.1em;
}
/* no icon support for input elements, provide padding by default */
input.ui-button {
padding: .4em 1em;
}
/* button icon element(s) */
.ui-button-icon-only .ui-icon,
.ui-button-text-icon-primary .ui-icon,
.ui-button-text-icon-secondary .ui-icon,
.ui-button-text-icons .ui-icon,
.ui-button-icons-only .ui-icon {
position: absolute;
top: 50%;
margin-top: -8px;
}
.ui-button-icon-only .ui-icon {
left: 50%;
margin-left: -8px;
}
.ui-button-text-icon-primary .ui-button-icon-primary,
.ui-button-text-icons .ui-button-icon-primary,
.ui-button-icons-only .ui-button-icon-primary {
left: .5em;
}
.ui-button-text-icon-secondary .ui-button-icon-secondary,
.ui-button-text-icons .ui-button-icon-secondary,
.ui-button-icons-only .ui-button-icon-secondary {
right: .5em;
}
/* button sets */
.ui-buttonset {
margin-right: 7px;
}
.ui-buttonset .ui-button {
margin-left: 0;
margin-right: -.3em;
}
/* workarounds */
/* reset extra padding in Firefox, see h5bp.com/l */
input.ui-button::-moz-focus-inner,
button.ui-button::-moz-focus-inner {
border: 0;
padding: 0;
}
/*!
* jQuery UI Resizable 1.10.1
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable {
position: relative;
}
.ui-resizable-handle {
position: absolute;
font-size: 0.1px;
display: block;
}
.ui-resizable-disabled .ui-resizable-handle,
.ui-resizable-autohide .ui-resizable-handle {
display: none;
}
.ui-resizable-n {
cursor: n-resize;
height: 7px;
width: 100%;
top: -5px;
left: 0;
}
.ui-resizable-s {
cursor: s-resize;
height: 7px;
width: 100%;
bottom: -5px;
left: 0;
}
.ui-resizable-e {
cursor: e-resize;
width: 7px;
right: -5px;
top: 0;
height: 100%;
}
.ui-resizable-w {
cursor: w-resize;
width: 7px;
left: -5px;
top: 0;
height: 100%;
}
.ui-resizable-se {
cursor: se-resize;
width: 12px;
height: 12px;
right: 1px;
bottom: 1px;
}
.ui-resizable-sw {
cursor: sw-resize;
width: 9px;
height: 9px;
left: -5px;
bottom: -5px;
}
.ui-resizable-nw {
cursor: nw-resize;
width: 9px;
height: 9px;
left: -5px;
top: -5px;
}
.ui-resizable-ne {
cursor: ne-resize;
width: 9px;
height: 9px;
right: -5px;
top: -5px;
}
This diff is collapsed.
This diff is collapsed.
{
"name": "WOB",
"description": "Web-OSC-Bridge-Server",
"main": "index.html",
"version": "0.12.1",
"license": "MIT",
"window": {
"title": "Web-OSC-Bridge",
"show": true,
"toolbar": false,
"icon": "/icon-design/wob-icon.png",
"frame": true
},
"repository": {
"type": "git",
"url": "https://forge.ircam.fr/p/trajectories/source/tree/master/mobile/WOB"
},
"dependencies": {
"connect": "2.29.1",
"omgosc": "1.0.0",
"qr-image": "^3.1.0",
"ws": "0.7.1"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-util": "3.0.4",
"nw-builder": "^2.0.2"
}
}
This diff is collapsed.
Interface.autogui = {
hasPageButtons: false,
children: [
[{
"bounds": [0, 0, 1, 1],
"widget": null,
"sacrosanct": false,
"parent": null,
"id": 0,
"children": [],
},]
],
getBestChildForNewWidget: function(page) {
var _maxSize = 0;
page = 0;
if (typeof this.children[page] === "undefined") {
this.children[page] = [{
"bounds": [0, 0, 1, 1],
"widget": null,
"sacrosanct": false,
"parent": null,
"id": 0,
"children": [],
}, ];
}
var bestChild = this.children[page][0];
// TODO include sacrosanct check
function check(child) {
if (child.children.length === 0) {
if (child.widget === null) {
if (child.bounds[2] + child.bounds[3] > _maxSize) {
bestChild = child;
_maxSize = child.bounds[2] + child.bounds[3];
}
} else {
if ((child.bounds[2] + child.bounds[3]) / 2 > _maxSize) {
bestChild = child;
_maxSize = (child.bounds[2] + child.bounds[3]) / 2;
}
}
} else {;
for (var i = 0; i < child.children.length; i++) {
var _child = child.children[i];
check(_child, _maxSize);
}
}
}
check(bestChild);
return bestChild;
},
placeWidget: function(_widget, sacrosanct) {
if (_widget === null) console.log("ALERT ALERT ALERT ALERT ALERT ALERT ALERT ALERT ALERT ALERT ALERT ALERT");
var maxSize = 0;
var bestDiv = -1;
var bestChild = null;
bestChild = this.getBestChildForNewWidget(0);
if (bestChild.widget === null) {
bestChild.widget = _widget;
_widget.bounds = bestChild.bounds;
_widget.div = bestChild;
} else {
var w = bestChild.widget;
var splitDir = (bestChild.bounds[2] > bestChild.bounds[3]) ? 0 : 1; // will the cell be split horizontally or vertically?
var widgetWidth, widgetHeight;
widgetWidth = (splitDir == 0) ? bestChild.bounds[2] / 2 : bestChild.bounds[2];
widgetHeight = (splitDir == 1) ? bestChild.bounds[3] / 2 : bestChild.bounds[3];
var div1 = {
"bounds": [bestChild.bounds[0], bestChild.bounds[1], widgetWidth, widgetHeight],
"widget": w,
"sacrosanct": false,
"parent": bestChild,
"children": [],
}
var newDivX = (splitDir == 0) ? bestChild.bounds[0] + widgetWidth : bestChild.bounds[0];
var newDivY = (splitDir == 1) ? bestChild.bounds[1] + widgetHeight : bestChild.bounds[1];
var div2 = {
"bounds": [newDivX, newDivY, widgetWidth, widgetHeight],
"widget": _widget,
"sacrosanct": sacrosanct,
"parent": bestChild,
"children": [],
}
div1.widget.div = div1;
div1.widget.bounds = div1.bounds;
div2.widget.bounds = div2.bounds;
div2.widget.div = div2;
bestChild.children.push(div1);
bestChild.children.push(div2);
}
},
removeWidget: function(_widget) {
_widget.div.widget = null;
var parent = _widget.div.parent;
if (parent != null) {
var childNumber = parent.children.indexOf( _widget.div );
// determine if sibling is already empty, if so, remove sibling and self from parent array
var siblingNumber = (childNumber === 1) ? 0 : 1;
if (parent.children[siblingNumber].widget == null) {
parent.