Skip to content

Commit 1cf6f3b

Browse files
AWolf81Rokt33r
authored andcommitted
WIP: Change space before parens. Tag link handling issue present.
1 parent 4d5939a commit 1cf6f3b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

extra_scripts/codemirror/addon/hyperlink/hyperlink.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;(function (mod) {
1+
;(function(mod) {
22
if (typeof exports === 'object' && typeof module === 'object') {
33
// Common JS
44
mod(require('../codemirror/lib/codemirror'))
@@ -9,13 +9,13 @@
99
// Plain browser env
1010
mod(CodeMirror)
1111
}
12-
})(function (CodeMirror) {
12+
})(function(CodeMirror) {
1313
'use strict'
1414

1515
const shell = require('electron').shell
1616
const remote = require('electron').remote
1717
const eventEmitter = {
18-
emit: function () {
18+
emit: function() {
1919
remote.getCurrentWindow().webContents.send.apply(null, arguments)
2020
}
2121
}
@@ -25,7 +25,7 @@
2525
const modifier = macOS ? 'metaKey' : 'ctrlKey'
2626

2727
class HyperLink {
28-
constructor (cm) {
28+
constructor(cm) {
2929
this.cm = cm
3030
this.lineDiv = cm.display.lineDiv
3131

@@ -61,7 +61,7 @@
6161
passive: true
6262
})
6363
}
64-
getUrl (el) {
64+
getUrl(el) {
6565
const className = el.className.split(' ')
6666

6767
if (className.indexOf('cm-url') !== -1) {
@@ -74,7 +74,7 @@
7474

7575
return null
7676
}
77-
specialLinkHandler (e, rawHref, linkHash) {
77+
specialLinkHandler(e, rawHref, linkHash) {
7878
const isStartWithHash = rawHref[0] === '#'
7979

8080
const extractIdRegex = /file:\/\/.*main.?\w*.html#/ // file://path/to/main(.development.)html
@@ -128,7 +128,7 @@
128128
return
129129
}
130130
}
131-
onMouseDown (e) {
131+
onMouseDown(e) {
132132
const { target } = e
133133
if (!e[modifier]) {
134134
return
@@ -155,7 +155,7 @@
155155
shell.openExternal(url)
156156
}
157157
}
158-
onMouseEnter (e) {
158+
onMouseEnter(e) {
159159
const { target } = e
160160

161161
const url = this.getUrl(target)
@@ -172,7 +172,7 @@
172172
this.showInfo(target)
173173
}
174174
}
175-
onMouseLeave (e) {
175+
onMouseLeave(e) {
176176
if (this.tooltip.parentElement === this.lineDiv) {
177177
e.target.classList.remove(
178178
'CodeMirror-activeline-background',
@@ -182,7 +182,7 @@
182182
this.lineDiv.removeChild(this.tooltip)
183183
}
184184
}
185-
onMouseMove (e) {
185+
onMouseMove(e) {
186186
if (this.tooltip.parentElement === this.lineDiv) {
187187
if (e[modifier]) {
188188
e.target.classList.add('CodeMirror-hyperlink')
@@ -191,7 +191,7 @@
191191
}
192192
}
193193
}
194-
showInfo (relatedTo) {
194+
showInfo(relatedTo) {
195195
const b1 = relatedTo.getBoundingClientRect()
196196
const b2 = this.lineDiv.getBoundingClientRect()
197197
const tdiv = this.tooltip

0 commit comments

Comments
 (0)