2014-06-17 07:43:42 -04:00
|
|
|
define [
|
2017-12-13 12:07:58 -05:00
|
|
|
"libraries"
|
2014-06-21 17:20:37 -04:00
|
|
|
"modules/recursionHelper"
|
2014-12-12 08:58:07 -05:00
|
|
|
"modules/errorCatcher"
|
2015-02-12 06:32:27 -05:00
|
|
|
"modules/localStorage"
|
2014-07-01 09:25:32 -04:00
|
|
|
"utils/underscore"
|
2014-06-17 07:43:42 -04:00
|
|
|
], () ->
|
|
|
|
App = angular.module("SharelatexApp", [
|
|
|
|
"ui.bootstrap"
|
|
|
|
"autocomplete"
|
2014-06-21 17:20:37 -04:00
|
|
|
"RecursionHelper"
|
2014-06-23 12:25:45 -04:00
|
|
|
"ng-context-menu"
|
2014-07-01 09:25:32 -04:00
|
|
|
"underscore"
|
|
|
|
"ngSanitize"
|
2014-08-13 11:04:23 -04:00
|
|
|
"ipCookie"
|
2015-10-27 06:58:27 -04:00
|
|
|
"mvdSixpack"
|
2014-12-12 08:58:07 -05:00
|
|
|
"ErrorCatcher"
|
2015-02-12 06:32:27 -05:00
|
|
|
"localStorage"
|
2015-10-07 12:32:35 -04:00
|
|
|
"ngTagsInput"
|
2018-06-15 06:28:44 -04:00
|
|
|
"ui.select"
|
|
|
|
]).config ($qProvider, sixpackProvider, $httpProvider, uiSelectConfig) ->
|
2017-07-03 06:19:13 -04:00
|
|
|
$qProvider.errorOnUnhandledRejections(false)
|
2018-06-15 06:28:44 -04:00
|
|
|
uiSelectConfig.spinnerClass = 'fa fa-refresh ui-select-spin'
|
2015-10-27 06:58:27 -04:00
|
|
|
sixpackProvider.setOptions({
|
2015-10-27 07:20:54 -04:00
|
|
|
debug: false
|
2015-10-27 06:58:27 -04:00
|
|
|
baseUrl: window.sharelatex.sixpackDomain
|
2015-11-17 10:54:59 -05:00
|
|
|
client_id: window.user_id
|
2015-10-27 06:58:27 -04:00
|
|
|
})
|
2018-07-23 10:30:58 -04:00
|
|
|
|
|
|
|
MathJax?.Hub?.Config(
|
|
|
|
extensions: ["Safe.js"]
|
|
|
|
messageStyle: "none"
|
|
|
|
imageFont:null
|
2018-07-23 11:03:49 -04:00
|
|
|
"HTML-CSS":
|
|
|
|
availableFonts: ["TeX"]
|
|
|
|
# MathJax's automatic font scaling does not work well when we render math
|
|
|
|
# that isn't yet on the page, so we disable it and set a global font
|
|
|
|
# scale factor
|
|
|
|
scale: 110
|
|
|
|
matchFontHeight: false
|
2018-07-23 10:30:58 -04:00
|
|
|
TeX:
|
2018-07-23 11:03:49 -04:00
|
|
|
equationNumbers: { autoNumber: "AMS" }
|
2018-07-23 10:30:58 -04:00
|
|
|
useLabelIDs: false
|
|
|
|
skipStartupTypeset: true
|
|
|
|
tex2jax:
|
2018-07-23 11:03:49 -04:00
|
|
|
processEscapes: true
|
|
|
|
# Dollar delimiters are added by the mathjax directive
|
|
|
|
inlineMath: [ ["\\(","\\)"] ]
|
2018-07-23 10:30:58 -04:00
|
|
|
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
|
|
|
|
)
|
|
|
|
|
2018-06-15 06:28:44 -04:00
|
|
|
App.run ($templateCache) ->
|
2018-06-28 12:02:04 -04:00
|
|
|
# UI Select templates are hard-coded and use Glyphicon icons (which we don't import).
|
|
|
|
# The line below simply overrides the hard-coded template with our own, which is
|
|
|
|
# basically the same but using Font Awesome icons.
|
2018-06-15 06:28:44 -04:00
|
|
|
$templateCache.put "bootstrap/match.tpl.html", "<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>"
|
|
|
|
|
2016-05-26 08:54:34 -04:00
|
|
|
sl_debugging = window.location?.search?.match(/debug=true/)?
|
|
|
|
window.sl_console =
|
|
|
|
log: (args...) -> console.log(args...) if sl_debugging
|
2014-06-17 07:43:42 -04:00
|
|
|
|
2014-11-25 11:00:21 -05:00
|
|
|
return App
|