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