Skip to content

Commit

Permalink
Styling changes to buttons, moved save button to first. Sourcemaps on
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Slattery committed May 19, 2016
1 parent f6996ad commit 7cdfcdc
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 422 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "carbondream",
"version": "0.2.0",
"version": "0.3.0",
"description": "React web annotation engine",
"homepage": "http://carbondream.zeroarc.com/",
"main": "dist/entry.js",
Expand Down Expand Up @@ -34,6 +34,7 @@
[
"babelify",
{
"sourceMaps": "inline",
"presets": [
"es2015",
"react"
Expand All @@ -47,6 +48,7 @@
]
},
"babel": {
"sourceMaps": "inline",
"presets": [
"es2015",
"react"
Expand Down
1 change: 1 addition & 0 deletions src/Annotation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const Annotation = (props) => {
? <Input invert={invert} pushHorizontal={pushHorizontal} pullHorizontal={pullHorizontal} offset={offset} {...other} />
: '';

//console.log(`drawing indicator at left: ${divStyle.left}, top: ${divStyle.top}`);
return (
<div style={divStyle} className={'cd-annotation ' + props.type} onMouseOver={handleMouseOver} onMouseOut={handleMouseOut} onClick={handleClick}>
{contentComponent}
Expand Down
6 changes: 3 additions & 3 deletions src/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default class Container extends React.Component {
}

handleClick(e) {
console.log(`click fired. scale: ${this.props.scale}, offset(top/left): ${this.state.containerOffset.top}/${this.state.containerOffset.left}, clientX: ${e.clientX}, clientY: ${e.clientY}, screenX: ${e.screenX}, screenY: ${e.screenY}` );
//console.log(`click fired. scale: ${this.props.scale}, offset(top/left): ${this.state.containerOffset.top}/${this.state.containerOffset.left}, clientX: ${e.clientX}, clientY: ${e.clientY}, screenX: ${e.screenX}, screenY: ${e.screenY}` );
e.stopPropagation();
if (this.props.viewOnlyMode) return;

Expand All @@ -179,7 +179,7 @@ export default class Container extends React.Component {
y2: Math.round((e.clientY + 24 - this.state.containerOffset.top) / this.props.scale),
});

console.log(`annotation: scale: ${this.props.scale}, offset(top/left): ${this.state.containerOffset.top}/${this.state.containerOffset.left}, x1: ${annotation.get('x1')}, y1: ${annotation.get('y1')}, x2: ${annotation.get('x2')}, y2: ${annotation.get('y2')}`);
//console.log(`annotation: scale: ${this.props.scale}, offset(top/left): ${this.state.containerOffset.top}/${this.state.containerOffset.left}, x1: ${annotation.get('x1')}, y1: ${annotation.get('y1')}, x2: ${annotation.get('x2')}, y2: ${annotation.get('y2')}`);

this.setState({
pendingAnnotation: annotation
Expand Down Expand Up @@ -231,7 +231,7 @@ export default class Container extends React.Component {
}

handleMouseUp(e) {
console.log(`mouseup fired. scale: ${this.props.scale}, clientX: ${e.clientX}, clientY: ${e.clientY}, screenX: ${e.screenX}, screenY: ${e.screenY}` );
//console.log(`mouseup fired. scale: ${this.props.scale}, clientX: ${e.clientX}, clientY: ${e.clientY}, screenX: ${e.screenX}, screenY: ${e.screenY}` );
e.stopPropagation();
if (this.props.viewOnlyMode) return;

Expand Down
10 changes: 8 additions & 2 deletions src/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export default class Input extends React.Component {
shadowStyle.left = 234;
}

const saveClasses = ClassNames('btn btn-xs save', {
disabled: !this.state.value.length
});

const cancelClasses = ClassNames('btn btn-xs cancel');

return (
<div style={divStyle} className={editorClasses}>
<div style={shadowStyle} className={shadowClasses}></div>
Expand All @@ -62,8 +68,8 @@ export default class Input extends React.Component {
onBlur={this.handleBlur}
/>
<div className='cd-annotation-input-controls'>
<button className='save' onClick={this.handleSaveClick}><i className='fa fa-check'> Save</i></button>
<button className='cancel' onClick={this.handleCancelClick}><i className='fa fa-times'> Cancel</i></button>
<button className={cancelClasses} onClick={this.handleCancelClick}><i className='fa fa-times'></i> Cancel</button>
<button className={saveClasses} onClick={this.handleSaveClick}><i className='fa fa-check'></i> Save</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
// Local
let Container = require('./Container');

console.log('Weaving a new carbon dream (0.1.1).');
console.log('Weaving a new carbon dream (0.3.0).');

module.exports = Container;
Loading

0 comments on commit 7cdfcdc

Please sign in to comment.