2014-06-21 17:20:37 -04:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
"ide/file-tree/FileTreeManager"
|
2014-06-23 12:47:08 -04:00
|
|
|
"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-07-03 10:05:35 -04:00
|
|
|
"ide/permissions/PermissionsManager"
|
2014-06-28 08:25:06 -04:00
|
|
|
"ide/pdf/PdfManager"
|
2014-07-03 12:05:50 -04:00
|
|
|
"ide/binary-files/BinaryFilesManager"
|
2014-07-01 10:05:32 -04:00
|
|
|
"ide/settings/index"
|
2014-07-01 09:12:28 -04:00
|
|
|
"ide/share/index"
|
2014-07-02 08:23:04 -04:00
|
|
|
"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"
|
2014-06-23 06:25:36 -04:00
|
|
|
"directives/focus"
|
2014-06-22 12:32:15 -04:00
|
|
|
"directives/fineUpload"
|
2014-06-22 15:08:56 -04:00
|
|
|
"directives/onEnter"
|
2014-07-08 05:08:38 -04:00
|
|
|
"directives/scroll"
|
2014-06-26 11:39:52 -04:00
|
|
|
"filters/formatDate"
|
2014-06-21 17:20:37 -04:00
|
|
|
], (
|
|
|
|
App
|
|
|
|
FileTreeManager
|
2014-06-23 12:47:08 -04:00
|
|
|
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-07-03 10:05:35 -04:00
|
|
|
PermissionsManager
|
2014-06-28 08:25:06 -04:00
|
|
|
PdfManager
|
2014-07-03 12:05:50 -04:00
|
|
|
BinaryFilesManager
|
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"
|
2014-07-02 08:23:04 -04:00
|
|
|
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
|
|
|
|
2014-06-23 12:47:08 -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-07-03 10:05:35 -04:00
|
|
|
ide.permissionsManager = new PermissionsManager(ide, $scope)
|
2014-07-03 12:05:50 -04:00
|
|
|
ide.binaryFilesManager = new BinaryFilesManager(ide, $scope)
|
2014-06-23 12:47:08 -04:00
|
|
|
]
|
2014-06-21 17:20:37 -04:00
|
|
|
|
|
|
|
angular.bootstrap(document.body, ["SharelatexApp"])
|