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

51 lines
1.3 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-24 15:28:53 -04:00
"ide/settings/SettingsManager"
2014-06-25 13:17:17 -04:00
"ide/online-users/OnlineUsersManager"
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-21 17:20:37 -04:00
], (
App
FileTreeManager
ConnectionManager
2014-06-24 10:31:44 -04:00
EditorManager
2014-06-24 15:28:53 -04:00
SettingsManager
2014-06-25 13:17:17 -04:00
OnlineUsersManager
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-21 17:20:37 -04:00
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-24 15:28:53 -04:00
ide.settingsManager = new SettingsManager(ide, $scope)
2014-06-25 13:17:17 -04:00
ide.onlineUsersManager = new OnlineUsersManager(ide, $scope)
]
2014-06-21 17:20:37 -04:00
angular.bootstrap(document.body, ["SharelatexApp"])