Add in debug pop up

This commit is contained in:
James Allen 2014-03-27 17:33:07 +00:00
parent 767b220fab
commit cc522f5d07
3 changed files with 39 additions and 0 deletions

View file

@ -430,6 +430,10 @@
div div
a(href="#", title='Show Hot Keys List')#hotkeysLink Hot keys a(href="#", title='Show Hot Keys List')#hotkeysLink Hot keys
script(type='text/template')#DebugLinkTemplate
div
a(href="#", title='Show Debug Information')#debugLink Debug
script(type='text/template')#trackChangesPanelTemplate script(type='text/template')#trackChangesPanelTemplate
#trackChangesPanel #trackChangesPanel
.track-changes-side-bar .track-changes-side-bar

View file

@ -0,0 +1,32 @@
define [
"utils/Modal"
], (Modal) ->
class DebugManager
template: $("#DebugLinkTemplate").html()
constructor: (@ide) ->
@$el = $(@template)
$("#toolbar-footer").append(@$el)
@$el.on "click", (e) =>
e.preventDefault()
@showDebugModal()
showDebugModal: () ->
useragent = navigator.userAgent
server_id = document.cookie.match(/SERVERID=([^;]*)/)?[1]
transport = @ide.socket.socket.transport.name
new Modal(
title: "Debug info"
message: """
Please give this information to the ShareLaTeX team:
<p><pre>
user-agent: #{useragent}
server-id: #{server_id}
transport: #{transport}
</pre></p>
"""
buttons: [
text: "OK"
]
)

View file

@ -26,6 +26,7 @@ define [
"tour/IdeTour" "tour/IdeTour"
"analytics/AnalyticsManager" "analytics/AnalyticsManager"
"track-changes/TrackChangesManager" "track-changes/TrackChangesManager"
"debug/DebugManager"
"ace/ace" "ace/ace"
"libs/jquery.color" "libs/jquery.color"
"libs/jquery-layout" "libs/jquery-layout"
@ -59,6 +60,7 @@ define [
IdeTour, IdeTour,
AnalyticsManager, AnalyticsManager,
TrackChangesManager TrackChangesManager
DebugManager
) -> ) ->
@ -194,6 +196,7 @@ define [
ide.hotkeysManager = new HotkeysManager ide ide.hotkeysManager = new HotkeysManager ide
ide.layoutManager.resizeAllSplitters() ide.layoutManager.resizeAllSplitters()
ide.tourManager = new IdeTour ide ide.tourManager = new IdeTour ide
ide.debugManager = new DebugManager(ide)
ide.savingAreaManager = ide.savingAreaManager =
$savingArea : $('#saving-area') $savingArea : $('#saving-area')