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

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

Issue 2720793005: Add Open my editor (Closed)
Patch Set: change python2 to python 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 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // For cs.chromium.org
6
7 let line = 0;
8
9 document.addEventListener('mousedown', (event) => {
10 // right click
11 if (event.button == 2) {
12 let element = event.target;
13 while (element != null && element.tagName == 'SPAN') {
14 if (element.className == 'stx-line') {
15 line = parseInt(element.id.split('_')[1]);
16 break;
17 } else {
18 element = element.parentElement;
19 }
20 }
21 }
22 }, true);
23
24 chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
25 if (request == 'getLine') {
26 sendResponse({line: line});
27 }
28 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698