Browse Source

Remove debug logs

Shane Kilkelly 9 years ago
parent
commit
b871cdab4c

+ 0 - 4
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

@@ -45,7 +45,6 @@ define [
 			labelsManager = @labelsManager
 			labelsManager = @labelsManager
 			LabelsCompleter =
 			LabelsCompleter =
 				getCompletions: (editor, session, pos, prefxi, callback) ->
 				getCompletions: (editor, session, pos, prefxi, callback) ->
-					# console.log ">> [LabelsCompleter] getting completions"
 					upToCursorRange = new Range(pos.row, 0, pos.row, pos.column)
 					upToCursorRange = new Range(pos.row, 0, pos.row, pos.column)
 					lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
 					lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
 					commandFragment = getLastCommandFragment(lineUpToCursor)
 					commandFragment = getLastCommandFragment(lineUpToCursor)
@@ -120,7 +119,6 @@ define [
 			})
 			})
 
 
 		onChange: (change) ->
 		onChange: (change) ->
-			window.EDITOR = @editor
 			cursorPosition = @editor.getCursorPosition()
 			cursorPosition = @editor.getCursorPosition()
 			end = change.end
 			end = change.end
 			# Check that this change was made by us, not a collaborator
 			# Check that this change was made by us, not a collaborator
@@ -134,7 +132,6 @@ define [
 
 
 					if commandFragment? and commandFragment.length > 2
 					if commandFragment? and commandFragment.length > 2
 						if commandFragment.startsWith('\\label{')
 						if commandFragment.startsWith('\\label{')
-							# console.log ">> LABEL IS HERE"
 							@labelsManager.scheduleLoadLabelsFromOpenDoc()
 							@labelsManager.scheduleLoadLabelsFromOpenDoc()
 						setTimeout () =>
 						setTimeout () =>
 							@editor.execCommand("startAutocomplete")
 							@editor.execCommand("startAutocomplete")
@@ -144,7 +141,6 @@ define [
 				# and see if that contains a `\label{}`
 				# and see if that contains a `\label{}`
 				if change.action == 'remove'
 				if change.action == 'remove'
 					if _.any(change.lines, (line) -> line.match(/\\label{.*}/))
 					if _.any(change.lines, (line) -> line.match(/\\label{.*}/))
-						# console.log ">> a label has been removed"
 						@labelsManager.scheduleLoadLabelsFromOpenDoc()
 						@labelsManager.scheduleLoadLabelsFromOpenDoc()
 
 
 		monkeyPatchAutocomplete: () ->
 		monkeyPatchAutocomplete: () ->

+ 1 - 4
services/web/public/coffee/ide/labels/LabelsManager.coffee

@@ -25,7 +25,6 @@ define [
 
 
 		loadLabelsFromOpenDoc: () ->
 		loadLabelsFromOpenDoc: () ->
 			docId = @ide.editorManager.getCurrentDocId()
 			docId = @ide.editorManager.getCurrentDocId()
-			# console.log ">> [LabelsMangager] loading labels", docId
 			docText = @ide.editorManager.getCurrentDocValue()
 			docText = @ide.editorManager.getCurrentDocValue()
 			labels = []
 			labels = []
 			re = /\\label{(.*)}/g
 			re = /\\label{(.*)}/g
@@ -33,16 +32,14 @@ define [
 				if labelMatch[1]
 				if labelMatch[1]
 					labels.push(labelMatch[1])
 					labels.push(labelMatch[1])
 			@state.documents[docId] = labels
 			@state.documents[docId] = labels
-			# console.log ">> [LabelsMangager] success, loaded labels", docId, labels
 
 
 		scheduleLoadLabelsFromOpenDoc: () ->
 		scheduleLoadLabelsFromOpenDoc: () ->
 			if @loadLabelsTimeout
 			if @loadLabelsTimeout
 				clearTimeout(@loadLabelsTimeout)
 				clearTimeout(@loadLabelsTimeout)
 			@loadLabelsTimeout = setTimeout(
 			@loadLabelsTimeout = setTimeout(
 				(self) ->
 				(self) ->
-					# console.log ">> trigger timeout"
 					self.loadLabelsFromOpenDoc()
 					self.loadLabelsFromOpenDoc()
-				, 500
+				, 1000
 				, this
 				, this
 			)
 			)