OnlineUsersController.js 863 B

1234567891011121314151617181920212223242526272829
  1. /* eslint-disable
  2. max-len,
  3. no-return-assign,
  4. */
  5. // TODO: This file was created by bulk-decaffeinate.
  6. // Fix any style issues and re-enable lint.
  7. /*
  8. * decaffeinate suggestions:
  9. * DS102: Remove unnecessary code created because of implicit returns
  10. * DS207: Consider shorter variations of null checks
  11. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  12. */
  13. import App from '../../../base'
  14. export default App.controller('OnlineUsersController', function ($scope, ide) {
  15. $scope.gotoUser = function (user) {
  16. if (user.doc != null && user.row != null) {
  17. return ide.editorManager.openDoc(user.doc, { gotoLine: user.row + 1 })
  18. }
  19. }
  20. return ($scope.userInitial = function (user) {
  21. if (user.user_id === 'anonymous-user') {
  22. return '?'
  23. } else {
  24. return user.name.slice(0, 1)
  25. }
  26. })
  27. })