Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21,964 changes: 15,797 additions & 6,167 deletions package-lock.json

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,49 @@
"url": "https://github.com/uncinc/layer-notes/issues"
},
"devDependencies": {
"babel": "^6.23.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-loader": "^7.1.2",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babelify": "^8.0.0",
"browserify": "^15.0.0",
"eslint": "^4.15.0",
"eslint-plugin-react": "^7.5.1",
"babel": "6.23.0",
"babel-cli": "6.24.0",
"babel-core": "6.20.0",
"babel-eslint": "^6.1.2",
"babel-loader": "6.2.9",
"babel-plugin-transform-class-properties": "6.19.0",
"babel-plugin-transform-object-rest-spread": "6.20.2",
"babel-preset-es2015": "6.18.0",
"babel-preset-react": "6.16.0",
"babel-preset-stage-2": "6.18.0",
"babelify": "^7.3.0",
"browserify": "^14.1.0",
"eslint": "^3.19.0",
"eslint-plugin-react": "^6.10.3",
"event-stream": "^3.3.4",
"gulp": "^3.9.0",
"gulp-babel": "^7.0.0",
"gulp-babel": "^6.1.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.6.1",
"gulp-eslint": "^4.0.1",
"gulp-eslint": "^2.0.0",
"gulp-if": "^2.0.2",
"gulp-livereload": "^3.8.1",
"gulp-load-plugins": "^1.5.0",
"gulp-merge-json": "^1.2.1",
"gulp-newer": "^1.4.0",
"gulp-plumber": "^1.2.0",
"gulp-load-plugins": "^0.5.3",
"gulp-merge-json": "^1.0.0",
"gulp-newer": "^1.3.0",
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-responsive": "^2.8.0",
"gulp-responsive": "^2.7.0",
"gulp-run-sequence": "*",
"gulp-sass": "^3.1.0",
"gulp-sourcemaps": "^2.6.3",
"gulp-svg-sprites": "^4.1.2",
"gulp-uglify": "^3.0.0",
"gulp-zip": "^4.1.0",
"gulp-sass": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-svg-sprites": "^4.1.1",
"gulp-uglify": "^1.5.4",
"gulp-zip": "^2.0.3",
"preprocessify": "^1.0.1",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"bowser": "^1.9.1",
"bowser": "^1.6.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-anime": "^2.0.1",
"react-dom": "^16.2.0"
"react": "^15.5.4",
"react-anime": "^0.3.4",
"react-dom": "^15.5.4"
}
}
}
4 changes: 2 additions & 2 deletions src/scripts/components/commentbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CommentBox extends Component {
* Adds for normal inputs
* @param {e} the event of the input
*/
_handleStateChange = (e) => {
handleStateChange = (e) => {
// get the new state from the old state
let newState = helpers.setNewState(
this.props.ticket,
Expand Down Expand Up @@ -470,7 +470,7 @@ class CommentBox extends Component {
{this.renderExtraInfo()}
<TextareaAutosize
minRows={3}
onChange={this._handleStateChange.bind(this)}
onChange={this.handleStateChange.bind(this)}
name="ticketText"
className="ln-commentbox--textarea"
useCacheForDOMMeasurements
Expand Down
76 changes: 32 additions & 44 deletions src/scripts/components/selector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class Selector extends Component {
startX: -1,
startY: -1,
x: -1,
y: -1,
last_position: {}
y: -1
// last_position: {}
};
}
componentWillMount() {
Expand Down Expand Up @@ -86,7 +86,7 @@ class Selector extends Component {
}

// set the start of the drawing of the square
onMouseDown = (e) => {
onMouseDown = e => {
e.preventDefault();
if (this.state.isDrawing) {
this.setState({ cursorStyle: 'default', isDrawing: false });
Expand All @@ -101,7 +101,7 @@ class Selector extends Component {
};

// listen to the esc key. Then go the home page;
onKeyDown = (e) => {
onKeyDown = e => {
const ESC_KEY = 27;

if (e.keyCode === ESC_KEY) {
Expand All @@ -111,21 +111,21 @@ class Selector extends Component {
}
};

_takeScreenshot = (screenshotName) => {
_takeScreenshot = screenshotName => {
const _this = this;
return new Promise((resolve, reject) => {
try {
message
.send('takeScreenschot', {})
.then((image) => {
.then(image => {
const oldState = _this.state.ticket.assets;
const newScreenshot = {
name: screenshotName, // the name of the file
size: image.data.length, // the pure size, will be conferted in the FileItem.js
content: image.data,
show: false,
file_type: 'image/jpeg',
id: helpers.generateUUID(), // a random genreated id
id: helpers.generateUUID() // a random genreated id
};
oldState.push(newScreenshot);
const newStateTicket = helpers.setNewState(
Expand Down Expand Up @@ -172,13 +172,13 @@ class Selector extends Component {
const positionY = this.state.ticket.position.y;
const pageHeight = helpers.pageHeight();

if (positionY < pageHeight) {
if (positionY < pageHeight && positionY > 10) {
helpers.scrollTo(0, positionY);
}
};

// for setting the new state in the ticket {Object}
handleStateChange = (newState) => {
handleStateChange = newState => {
// set the new state to the selected ticket;
this.setState({ ticket: newState });
};
Expand Down Expand Up @@ -245,19 +245,19 @@ class Selector extends Component {
});
// take a screenshot of the selected item
this._takeScreenshot(translate('selectorScreenshotNameAfter')).then(
function() {
() => {
message
.send('submitNewTicket', {
ticket: _this.state.ticket,
hostname: generalConfig.hostname,
url: generalConfig.url,
shortlink: generalConfig.shortlink
})
.then(function() {
setTimeout(function() {
.then(() => {
setTimeout(() => {
_this.setState({ isLoading: false, isUploaded: true });
}, 600);
setTimeout(function() {
setTimeout(() => {
_this.setState({ isUploaded: false });
routerHelper.setStateApp('home');
}, 2000);
Expand All @@ -266,29 +266,19 @@ class Selector extends Component {
);
};

_updateFramePosition = (left, top) => {
let position = {
x: left,
y: top,
width: this.state.ticket.position.width,
height: this.state.ticket.position.height
};
let newStateTicket = helpers.setNewState(
this.state.ticket,
'position',
position
);

updateFrame = (position) => {
this.setState({
ticket: newStateTicket,
positionClass: this._checkClassname()
...this.state,
ticket: {
...this.state.ticket,
position: {
...this.state.ticket.position,
...position,
},
},
});
};

_updateFrameSize = (prop, value) => {
this.setState({ [prop]: value });
};

_setMousePosition = e => {
let ev = e || window.event; // Moz || IE
let margin = 10;
Expand Down Expand Up @@ -320,7 +310,7 @@ class Selector extends Component {
/**
* RENDER
*/
_helperElement = () => {
helperElement = () => {
if (!this.state.showCommentbox) {
return (
<span
Expand All @@ -337,7 +327,7 @@ class Selector extends Component {
return '';
};

_renderCommentBox = () => {
renderCommentBox = () => {
if (this.state.showCommentbox) {
return (
<CommentBox
Expand All @@ -350,12 +340,11 @@ class Selector extends Component {
onchange={this.handleStateChange}
/>
);
} else {
return '';
}
return '';
};

_drawElement = () => {
drawElement = () => {
return (
<div>
<div
Expand All @@ -371,11 +360,11 @@ class Selector extends Component {
width={this.state.ticket.position.width}
height={this.state.ticket.position.height}
left={this.state.ticket.position.x}
top={this.state.ticket.position.y}
showCommentbox={this.state.showCommentbox}
updateFramePosition={this._updateFramePosition}
updateFrameSize={this._updateFrameSize}
updateFrame={this.updateFrame}
/>
{this._renderCommentBox()}
{this.renderCommentBox()}
</div>
<SelectorBackground
width={this.state.ticket.position.width}
Expand All @@ -397,13 +386,12 @@ class Selector extends Component {
cursor: this.state.cursorStyle
}}
>
{this._drawElement()}
{this._helperElement()}
{this.drawElement()}
{this.helperElement()}
</div>
);
} else {
return <div />;
}
return <div />;
};
}

Expand Down
Loading