-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dao Han Lim
committed
Mar 15, 2019
1 parent
f36b56e
commit 4cbafe9
Showing
61 changed files
with
2,251 additions
and
380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"printWidth": 100, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Ember from 'ember'; | ||
import PropTypesMixin, { PropTypes } from 'ember-prop-types'; | ||
|
||
export default Ember.Component.extend(PropTypesMixin, { | ||
propTypes: { | ||
hintTitle: PropTypes.string.isRequired, | ||
hintText: PropTypes.string.isRequired, | ||
closeWindowFunction: PropTypes.func.isRequired, | ||
closeButton: PropTypes.bool, | ||
closeButtonText: PropTypes.string | ||
}, | ||
getDefaultProps() { | ||
return { | ||
closeButton: true, | ||
closeButtonText: 'Got it!' | ||
}; | ||
}, | ||
closeWindow: function() { | ||
this.get('closeWindowFunction')(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import Ember from 'ember'; | ||
import { PropTypes } from 'ember-prop-types'; | ||
import * as HintUtil from 'textup-frontend/utils/hint-info'; | ||
|
||
const { computed } = Ember; | ||
|
||
export default Ember.Component.extend({ | ||
// hintService: Ember.inject.service(), | ||
|
||
propTypes: { | ||
hintId: PropTypes.string.isRequired, | ||
type: PropTypes.string.isRequired, | ||
verticalPosition: PropTypes.bool | ||
}, | ||
getDefaultProps() { | ||
return { | ||
verticalPosition: false | ||
}; | ||
}, | ||
|
||
classNames: ['hint'], | ||
|
||
shouldShow: computed(function() { | ||
return true; | ||
}), | ||
|
||
dot: computed('type', function() { | ||
const type = this.get('type'); | ||
return type === 'dot'; | ||
}), | ||
|
||
focus: computed('type', function() { | ||
const type = this.get('type'); | ||
return type === 'focus'; | ||
}), | ||
|
||
hintTitle: computed('hintId', function() { | ||
const hintId = this.get('hintId'); | ||
return HintUtil.getTitle(hintId); | ||
}), | ||
hintText: computed('hintId', function() { | ||
const hintId = this.get('hintId'); | ||
return HintUtil.getMessage(hintId); | ||
}), | ||
|
||
focusIn() { | ||
if (!this.get('mobile')) { | ||
this.get('_popOver').actions.open(); | ||
} | ||
}, | ||
|
||
focusOut() { | ||
if (!this.get('mobile')) { | ||
this.get('_popOver').actions.close(); | ||
} | ||
} | ||
|
||
// shouldShow: computed.alias("hintService.shouldShow"), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import Ember from 'ember'; | ||
import { PropTypes } from 'ember-prop-types'; | ||
|
||
const { computed, tryInvoke } = Ember; | ||
|
||
export default Ember.Component.extend({ | ||
tutorialService: Ember.inject.service(), | ||
|
||
propTypes: { | ||
doRegister: PropTypes.func, | ||
firstIncompleteTask: PropTypes.object | ||
}, | ||
|
||
init() { | ||
this._super(...arguments); | ||
tryInvoke(this, 'doRegister', [this.get('_publicAPI')]); | ||
}, | ||
|
||
// didInsertElement() { | ||
// this._resetTasks(); | ||
// this._closeIfAllComplete(); | ||
// }, | ||
|
||
classNames: ['task-manager'], | ||
|
||
_publicAPI: computed(function() { | ||
return { | ||
actions: { | ||
finishCompleteTask: this._finishCompleteTask.bind(this), | ||
resetTasks: this._resetTasks.bind(this), | ||
closeTaskManager: this._close.bind(this), | ||
startCompleteTask: this._startCompleteTask.bind(this) | ||
} | ||
}; | ||
}), | ||
|
||
_taskStep: null, | ||
|
||
_close() { | ||
this.destroy(); | ||
}, | ||
|
||
_closeIfAllComplete() { | ||
const firstIncomplete = this.get('firstIncompleteTask'); | ||
if (firstIncomplete === null) { | ||
this._close(); | ||
} | ||
}, | ||
|
||
_getTaskStatus(taskId) { | ||
const tutorialService = this.get('tutorialService'); | ||
return tutorialService.getTaskStatus(taskId); | ||
}, | ||
|
||
_startCompleteTask(taskId, shouldShowCompleteMessage) { | ||
const taskStep = this.get('_taskStep'); | ||
taskStep.actions.completeTask(taskId, shouldShowCompleteMessage); | ||
}, | ||
|
||
_finishCompleteTask(taskId) { | ||
const tutorialService = this.get('tutorialService'); | ||
tutorialService.finishCompleteTask(taskId); | ||
// this._closeIfAllComplete(); | ||
}, | ||
|
||
_resetTasks() { | ||
const tutorialService = this.get('tutorialService'); | ||
tutorialService.resetTasks(); | ||
} | ||
}); |
Oops, something went wrong.