base.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* eslint-disable
  2. camelcase,
  3. max-len,
  4. no-useless-escape,
  5. */
  6. // TODO: This file was created by bulk-decaffeinate.
  7. // Fix any style issues and re-enable lint.
  8. /*
  9. * decaffeinate suggestions:
  10. * DS101: Remove unnecessary use of Array.from
  11. * DS102: Remove unnecessary code created because of implicit returns
  12. * DS103: Rewrite code to no longer use __guard__
  13. * DS207: Consider shorter variations of null checks
  14. * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  15. */
  16. import './utils/webpack-public-path'
  17. import './libraries'
  18. import './infrastructure/error-reporter'
  19. import './modules/recursionHelper'
  20. import './modules/errorCatcher'
  21. import './modules/localStorage'
  22. import './modules/sessionStorage'
  23. import getMeta from './utils/meta'
  24. import { configureMathJax } from './features/mathjax/configure'
  25. const App = angular
  26. .module('SharelatexApp', [
  27. 'ui.bootstrap',
  28. 'autocomplete',
  29. 'RecursionHelper',
  30. 'ng-context-menu',
  31. 'ngSanitize',
  32. 'ipCookie',
  33. 'ErrorCatcher',
  34. 'localStorage',
  35. 'sessionStorage',
  36. 'ui.select',
  37. ])
  38. .config(function ($qProvider, $httpProvider, uiSelectConfig) {
  39. $qProvider.errorOnUnhandledRejections(false)
  40. uiSelectConfig.spinnerClass = 'fa fa-refresh ui-select-spin'
  41. configureMathJax()
  42. })
  43. App.run(($rootScope, $templateCache) => {
  44. $rootScope.usersEmail = getMeta('ol-usersEmail')
  45. // UI Select templates are hard-coded and use Glyphicon icons (which we don't import).
  46. // The line below simply overrides the hard-coded template with our own, which is
  47. // basically the same but using Font Awesome icons.
  48. $templateCache.put(
  49. 'bootstrap/match.tpl.html',
  50. '<div class="ui-select-match" ng-hide="$select.open && $select.searchEnabled" ng-disabled="$select.disabled" ng-class="{\'btn-default-focus\':$select.focus}"><span tabindex="-1" class="btn btn-default form-control ui-select-toggle" aria-label="{{ $select.baseTitle }} activate" ng-disabled="$select.disabled" ng-click="$select.activate()" style="outline: 0;"><span ng-show="$select.isEmpty()" class="ui-select-placeholder text-muted">{{$select.placeholder}}</span> <span ng-hide="$select.isEmpty()" class="ui-select-match-text pull-left" ng-class="{\'ui-select-allow-clear\': $select.allowClear && !$select.isEmpty()}" ng-transclude=""></span> <i class="caret pull-right" ng-click="$select.toggle($event)"></i> <a ng-show="$select.allowClear && !$select.isEmpty() && ($select.disabled !== true)" aria-label="{{ $select.baseTitle }} clear" style="margin-right: 10px" ng-click="$select.clear($event)" class="btn btn-xs btn-link pull-right"><i class="fa fa-times" aria-hidden="true"></i></a></span></div>'
  51. )
  52. })
  53. export default App