Permalink
Browse files

Add shorcuts for windows & linux to debugger.html

Summary:
Very simple PR to add the shorcuts for windows/linux to the web debuger interface so it's less mac-centric.

**Test plan**: Open the debugger and see the shorcuts for windows/linux/mac
Closes #9812

Differential Revision: D3862570

fbshipit-source-id: 54605af66b674d176b3cbbb9efcfa93f84fcd552
  • Loading branch information...
1 parent f3253c0 commit f4e3e19f8cb36e566adda68b1999392b97d52589 @mdamien mdamien committed with Facebook Github Bot 4 Sep 14, 2016
Showing with 12 additions and 4 deletions.
  1. +12 −4 local-cli/server/util/debugger.html
@@ -21,7 +21,15 @@
document.getElementById('status').innerHTML = status;
}
-var INITIAL_MESSAGE = 'Waiting, press <span class="shortcut">⌘R</span> in simulator to reload and connect.';
+var isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
+var refresh_shortcut = isMacLike ? '⌘R' : 'Ctrl R';
+window.onload = function() {
+ if (!isMacLike) {
+ document.getElementById('dev_tools_shortcut').innerHTML = 'Ctrl⇧J';
+ }
+}
+
+var INITIAL_MESSAGE = 'Waiting, press <span class="shortcut">' + refresh_shortcut + '</span> in simulator to reload and connect.';
function connectToDebuggerProxy() {
var worker;
@@ -37,7 +45,7 @@
};
window.onbeforeunload = function() {
return 'If you reload this page, it is going to break the debugging session. ' +
- 'You should press ⌘R in simulator to reload.';
+ 'You should press' + refresh_shortcut + 'in simulator to reload.';
};
}
@@ -61,7 +69,7 @@
if (object.$event === 'client-disconnected') {
shutdownJSRuntime();
- setStatus('Waiting, press <span class="shortcut">⌘R</span> in simulator to reload and connect.');
+ setStatus('Waiting, press <span class="shortcut">' + refresh_shortcut + '</span> in simulator to reload and connect.');
return;
}
@@ -127,7 +135,7 @@
<p>
React Native JS code runs inside this Chrome tab.
</p>
- <p>Press <kbd class="shortcut">⌘⌥J</kbd> to open Developer Tools. Enable <a href="http://stackoverflow.com/a/17324511/232122" target="_blank">Pause On Caught Exceptions</a> for a better debugging experience.</p>
+ <p>Press <kbd id='dev_tools_shortcut' class="shortcut">⌘⌥J</kbd> to open Developer Tools. Enable <a href="https://stackoverflow.com/a/17324511/232122" target="_blank">Pause On Caught Exceptions</a> for a better debugging experience.</p>
<p>Status: <span id="status">Loading...</span></p>
</div>
</body>

0 comments on commit f4e3e19

Please sign in to comment.