This commit is contained in:
Alex Yatskov 2016-03-19 19:32:35 -07:00
parent 826bf96311
commit 8f24c5ff6a
3 changed files with 25 additions and 3 deletions

View File

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
function getRangeAtCursor(e, lookAhead) { function getRangeAtCursor(e, lookAhead) {
const range = document.caretRangeFromPoint(e.clientX, e.clientY); const range = document.caretRangeFromPoint(e.clientX, e.clientY);
if (range === null) { if (range === null) {
@ -52,4 +51,4 @@ function onMouseDown(e) {
} }
window.addEventListener('mousemove', onMouseMove, false); window.addEventListener('mousedown', onMouseDown, false);

23
jp/dictionary.js Normal file
View File

@ -0,0 +1,23 @@
/*
* Copyright (C) 2016 Alex Yatskov <alex@foosoft.net>
* Author: Alex Yatskov <alex@foosoft.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class Dictionary {
}

View File

@ -10,7 +10,7 @@
"content_scripts": [{ "content_scripts": [{
"matches": [ "http://*/*", "https://*/*" ], "matches": [ "http://*/*", "https://*/*" ],
"js": [ "content.js" ], "js": [ "jp/dictionary.js", "content.js" ],
"run_at": "document_end" "run_at": "document_end"
}] }]
} }