overleaf/services/web/public/coffee/app/ide.coffee

64 lines
1.6 KiB
CoffeeScript
Raw Normal View History

2014-06-21 17:20:37 -04:00
define [
"base"
"ide/file-tree/FileTreeManager"
"ide/connection/ConnectionManager"
2014-06-24 10:31:44 -04:00
"ide/editor/EditorManager"
2014-06-25 13:17:17 -04:00
"ide/online-users/OnlineUsersManager"
2014-06-26 11:39:52 -04:00
"ide/track-changes/TrackChangesManager"
2014-06-28 08:25:06 -04:00
"ide/pdf/PdfManager"
2014-07-01 10:05:32 -04:00
"ide/settings/index"
2014-07-01 09:12:28 -04:00
"ide/share/index"
"ide/chat/index"
2014-06-21 17:20:37 -04:00
"ide/directives/layout"
2014-06-22 07:10:42 -04:00
"ide/services/ide"
"directives/focus"
2014-06-22 12:32:15 -04:00
"directives/fineUpload"
2014-06-22 15:08:56 -04:00
"directives/onEnter"
2014-06-26 11:39:52 -04:00
"filters/formatDate"
2014-06-21 17:20:37 -04:00
], (
App
FileTreeManager
ConnectionManager
2014-06-24 10:31:44 -04:00
EditorManager
2014-06-25 13:17:17 -04:00
OnlineUsersManager
2014-06-26 11:39:52 -04:00
TrackChangesManager
2014-06-28 08:25:06 -04:00
PdfManager
2014-06-21 17:20:37 -04:00
) ->
2014-06-22 07:10:42 -04:00
App.controller "IdeController", ["$scope", "$timeout", "ide", ($scope, $timeout, ide) ->
2014-06-25 11:06:04 -04:00
# Don't freak out if we're already in an apply callback
$scope.$originalApply = $scope.$apply
$scope.$apply = (fn = () ->) ->
phase = @$root.$$phase
if (phase == '$apply' || phase == '$digest')
fn()
else
this.$originalApply(fn);
2014-06-21 17:20:37 -04:00
$scope.state = {
loading: true
load_progress: 40
}
2014-06-24 15:28:53 -04:00
$scope.ui = {
leftMenuShown: false
2014-06-26 11:39:52 -04:00
view: "editor"
chatOpen: false
2014-06-24 15:28:53 -04:00
}
2014-06-27 08:46:38 -04:00
$scope.user = window.user
2014-07-01 10:05:32 -04:00
$scope.settings = window.userSettings
2014-06-21 17:20:37 -04:00
2014-07-02 10:56:09 -04:00
$scope.chat = {}
2014-06-22 07:10:42 -04:00
window._ide = ide
2014-06-21 17:20:37 -04:00
2014-06-22 12:32:15 -04:00
ide.project_id = $scope.project_id = window.project_id
2014-06-22 07:10:42 -04:00
ide.$scope = $scope
2014-06-21 17:20:37 -04:00
ide.connectionManager = new ConnectionManager(ide, $scope)
2014-06-22 07:10:42 -04:00
ide.fileTreeManager = new FileTreeManager(ide, $scope)
2014-06-24 10:31:44 -04:00
ide.editorManager = new EditorManager(ide, $scope)
2014-06-25 13:17:17 -04:00
ide.onlineUsersManager = new OnlineUsersManager(ide, $scope)
2014-06-26 11:39:52 -04:00
ide.trackChangesManager = new TrackChangesManager(ide, $scope)
2014-06-28 08:25:06 -04:00
ide.pdfManager = new PdfManager(ide, $scope)
]
2014-06-21 17:20:37 -04:00
angular.bootstrap(document.body, ["SharelatexApp"])