OnlineUsersController.js 879 B

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