|
@@ -1,6 +1,7 @@
|
|
|
define [
|
|
define [
|
|
|
"base"
|
|
"base"
|
|
|
"ide/file-tree/FileTreeManager"
|
|
"ide/file-tree/FileTreeManager"
|
|
|
|
|
+ "ide/connection/ConnectionManager"
|
|
|
"ide/directives/layout"
|
|
"ide/directives/layout"
|
|
|
"ide/services/ide"
|
|
"ide/services/ide"
|
|
|
"directives/focus"
|
|
"directives/focus"
|
|
@@ -9,6 +10,7 @@ define [
|
|
|
], (
|
|
], (
|
|
|
App
|
|
App
|
|
|
FileTreeManager
|
|
FileTreeManager
|
|
|
|
|
+ ConnectionManager
|
|
|
) ->
|
|
) ->
|
|
|
App.controller "IdeController", ["$scope", "$timeout", "ide", ($scope, $timeout, ide) ->
|
|
App.controller "IdeController", ["$scope", "$timeout", "ide", ($scope, $timeout, ide) ->
|
|
|
$scope.state = {
|
|
$scope.state = {
|
|
@@ -20,31 +22,9 @@ define [
|
|
|
|
|
|
|
|
ide.project_id = $scope.project_id = window.project_id
|
|
ide.project_id = $scope.project_id = window.project_id
|
|
|
ide.$scope = $scope
|
|
ide.$scope = $scope
|
|
|
- ide.socket = io.connect null,
|
|
|
|
|
- reconnect: false
|
|
|
|
|
- "force new connection": true
|
|
|
|
|
|
|
|
|
|
|
|
+ ide.connectionManager = new ConnectionManager(ide, $scope)
|
|
|
ide.fileTreeManager = new FileTreeManager(ide, $scope)
|
|
ide.fileTreeManager = new FileTreeManager(ide, $scope)
|
|
|
-
|
|
|
|
|
- ide.socket.on "connect", () ->
|
|
|
|
|
- $scope.$apply () ->
|
|
|
|
|
- $scope.state.load_progress = 80
|
|
|
|
|
-
|
|
|
|
|
- joinProject = () =>
|
|
|
|
|
- ide.socket.emit 'joinProject', {
|
|
|
|
|
- project_id: ide.project_id
|
|
|
|
|
- }, (err, project, permissionsLevel, protocolVersion) =>
|
|
|
|
|
- if $scope.protocolVersion? and $scope.protocolVersion != protocolVersion
|
|
|
|
|
- location.reload(true)
|
|
|
|
|
-
|
|
|
|
|
- $scope.$apply () ->
|
|
|
|
|
- $scope.protocolVersion = protocolVersion
|
|
|
|
|
- $scope.project = project
|
|
|
|
|
- $scope.state.load_progress = 100
|
|
|
|
|
- $scope.state.loading = false
|
|
|
|
|
-
|
|
|
|
|
- $scope.$emit "project:joined"
|
|
|
|
|
-
|
|
|
|
|
- setTimeout(joinProject, 100) ]
|
|
|
|
|
|
|
+ ]
|
|
|
|
|
|
|
|
angular.bootstrap(document.body, ["SharelatexApp"])
|
|
angular.bootstrap(document.body, ["SharelatexApp"])
|