Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: tools/chrome_extensions/open_my_editor/ext/cs-content.js

Issue 2720793005: Add Open my editor (Closed)
Patch Set: add owners and change to py2 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 Google Inc.
2 //
3 // Copyright 2017 The Chromium Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style license that can be
5 // found in the LICENSE file.
6
7 // For cs.chromium.org
8
9 let line = 0;
10
11 document.addEventListener("mousedown", (event) => {
12 //right click
watk 2017/03/02 23:13:49 Proper punctuation. Space after //.
13 if (event.button == 2) {
14 let element = event.target;
15 while (element != null && element.tagName == "SPAN") {
16 if (element.className == "stx-line") {
17 line = parseInt(element.id.split("_")[1]);
18 break;
19 } else {
20 element = element.parentElement;
21 }
22 }
23 }
24 }, true);
25
26 chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
27 if (request == "getLine") {
28 sendResponse({ line: line });
29 }
30 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698