Skip to content

Commit

Permalink
Merge pull request #18 from jamiefaye/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jamiefaye authored Aug 5, 2018
2 parents 1238a47 + 0351585 commit c6f8159
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
12 changes: 10 additions & 2 deletions xmlView/src/KitList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function fmtTime(tv) {
return v;
}

function forceString(val) {
if (val === undefined) return "";
if (typeof val === 'string' || val instanceof String) return val;
return "";
}

var loopModeTab = ["Cut", "Once", "Loop", "Stretch"];

var KIT_SOUND_NAMES = ["KICK",
Expand Down Expand Up @@ -193,6 +199,8 @@ class EditButtons extends React.Component {
this.setState({showTab: !this.state.showTab});
}



render() {
const defaultOption = loopModeTab[this.props.osc.loopMode];
let openEditing = this.props.editing && this.state.opened;
Expand All @@ -217,8 +225,8 @@ class EditButtons extends React.Component {
rows='1' cols='10' offsetX={120}
trigger='' defaultValue={this.props.name}/></div></td>)
: this.props.osc2 ? <td> </td> : <td>{this.props.name}</td>}
{openEditing ? (<td style={{textAlign: 'left'}}>{this.props.osc.fileName}</td>)
: (<td style={{textAlign: 'left'}}>{this.props.osc.fileName}</td>)}
{openEditing ? (<td style={{textAlign: 'left'}}>{forceString(this.props.osc.fileName)}</td>)
: (<td style={{textAlign: 'left'}}>{forceString(this.props.osc.fileName)}</td>)}
<td className="startms">{startTS}</td>
<td className="endms">{endTS}</td>
{openEditing ? (<td><Dropdown options={loopModeTab} onChange={this.onLoopSelect.bind(this)} value={defaultOption} /></td>)
Expand Down
1 change: 0 additions & 1 deletion xmlView/src/viewXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,6 @@ class DelugeDoc {
// let firstFixed = fixedText.substring(0, 160);
// alert (firstFixed);


var asDOM = getXmlDOMFromString(fixedText);
// Uncomment following to generate ordering table based on a real-world example.
// enOrderTab(asDOM);
Expand Down
7 changes: 2 additions & 5 deletions xmlView/viewXML.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,15 @@
<meta charset="UTF-8">
<title>Downrush XML Viewer</title>
<!-- https://stackoverflow.com/questions/951791/javascript-global-error-handling -->
<div id="npoptemp" style="display: none;"></div>

<script type="text/javascript">

window.onerror = function(msg, url, line, col, error) {
window.onerror = function(msg, url, line, col, error) {
var extra = !col ? '' : '\ncolumn: ' + col;
extra += !error ? '' : '\nerror: ' + error;
alert("Error: " + msg + "\nurl: " + url + "\nline: " + line + extra);
return true;
};
</script>

<div id="npoptemp" style="display: none;"></div>
<link rel="stylesheet" href="edit.css">
<link rel="stylesheet" href="filewidget.css">
</head>
Expand Down

0 comments on commit c6f8159

Please sign in to comment.