Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
05be24c4
Commit
05be24c4
authored
Oct 25, 2014
by
Aron Carroll
Committed by
Nick Stenning
Oct 25, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove console.log statements from within the app
Log statements do not belong in production code.
parent
660bf572
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
0 additions
and
28 deletions
+0
-28
controllers.coffee
h/static/scripts/controllers.coffee
+0
-1
guest.coffee
h/static/scripts/guest.coffee
+0
-6
bridge.coffee
h/static/scripts/plugin/bridge.coffee
+0
-7
discovery.coffee
h/static/scripts/plugin/discovery.coffee
+0
-2
heatmap.coffee
h/static/scripts/plugin/heatmap.coffee
+0
-5
services.coffee
h/static/scripts/services.coffee
+0
-7
No files found.
h/static/scripts/controllers.coffee
View file @
05be24c4
...
...
@@ -134,7 +134,6 @@ class AppController
,
slots
*
500
_sock
.
onmessage
=
(
msg
)
->
#console.log msg
unless
msg
.
data
.
type
?
and
msg
.
data
.
type
is
'annotation-notification'
return
data
=
msg
.
data
.
payload
...
...
h/static/scripts/guest.coffee
View file @
05be24c4
...
...
@@ -57,7 +57,6 @@ class Annotator.Guest extends Annotator
origin
:
origin
scope
:
"
#{
scope
}
:provider"
onReady
:
=>
console
.
log
"Guest functions are ready for
#{
origin
}
"
setTimeout
=>
event
=
document
.
createEvent
"UIEvents"
event
.
initUIEvent
"annotatorReady"
,
false
,
false
,
window
,
0
...
...
@@ -101,7 +100,6 @@ class Annotator.Guest extends Annotator
pages
=
Object
.
keys
(
hls
).
map
(
s
)
->
parseInt
s
# Do we have any highlights left?
if
pages
.
length
console
.
log
"We still have something left"
firstPage
=
pages
.
sort
()[
0
]
# Determine the first page
firstHl
=
hls
[
firstPage
]
# Determine the first (topmost) hl
# Store the position of this anchor inside target
...
...
@@ -109,7 +107,6 @@ class Annotator.Guest extends Annotator
top
:
highlight
.
getTop
()
heigth
:
highlight
.
getHeight
()
else
console
.
log
"No pos left"
delete
highlight
.
anchor
.
target
.
pos
# Announce the new positions, so that the sidebar knows
...
...
@@ -169,13 +166,10 @@ class Annotator.Guest extends Annotator
.
bind
(
'getDocumentInfo'
,
(
trans
)
=>
(
@
plugins
.
PDF
?
.
getMetaData
()
?
Promise
.
reject
())
.
then
(
md
)
=>
# console.log "Returning PDF metadata", md
trans
.
complete
uri
:
@
getHref
()
metadata
:
md
.
catch
(
problem
)
=>
# console.log "Returning standard metadata, because"
# console.log problem.stack ? problem
trans
.
complete
uri
:
@
getHref
()
metadata
:
@
plugins
.
Document
?
.
metadata
...
...
h/static/scripts/plugin/bridge.coffee
View file @
05be24c4
...
...
@@ -111,8 +111,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
(
options
.
origin
.
match
/^resource:\/\//
)
options
.
origin
=
'*'
console
.
log
"Bridge plugin connecting to
#{
options
.
origin
}
"
# options.debugOutput = true
channel
=
Channel
.
build
(
options
)
## Remote method call bindings
...
...
@@ -165,7 +163,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
while
queue
.
length
parent
=
queue
.
shift
()
if
parent
isnt
window
console
.
log
window
.
location
.
toString
(),
'sending beacon...'
parent
.
postMessage
'__annotator_dhcp_discovery'
,
@
options
.
origin
for
child
in
parent
.
frames
queue
.
push
child
...
...
@@ -183,10 +180,6 @@ class Annotator.Plugin.Bridge extends Annotator.Plugin
success
:
(
result
)
->
d
.
resolve
result
error
:
(
error
,
reason
)
->
if
error
isnt
'timeout_error'
console
.
log
'Error in call! Reason: '
+
reason
console
.
log
error
console
.
log
"Call was:"
,
options
console
.
log
'Destroying channel!'
d
.
reject
error
,
reason
else
d
.
resolve
null
...
...
h/static/scripts/plugin/discovery.coffee
View file @
05be24c4
class
Annotator
.
Plugin
.
Discovery
extends
Annotator
.
Plugin
pluginInit
:
->
console
.
log
"Initializing discovery plugin."
svc
=
$
(
'link'
)
.
filter
->
this
.
rel
is
'service'
and
this
.
type
is
'application/annotatorsvc+json'
...
...
h/static/scripts/plugin/heatmap.coffee
View file @
05be24c4
...
...
@@ -135,7 +135,6 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
anchor
=
ann
.
anchors
[
0
]
if
not
next
?
or
start
.
page
*
dir
<
anchor
.
startPage
*
dir
# This one is obviously better
#console.log "Found anchor on better page."
start
:
page
:
anchor
.
startPage
top
:
anchor
.
highlight
[
anchor
.
startPage
]
?
.
getTop
()
...
...
@@ -146,7 +145,6 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
if
hl
?
# We have a real highlight, let's compare coordinates
if
start
.
top
*
dir
<
hl
.
getTop
()
*
dir
#console.log "Found anchor on same page, better pos."
# OK, this one is better
start
:
page
:
start
.
page
...
...
@@ -154,19 +152,16 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
next
:
[
anchor
]
else
# No, let's keep the old one instead
#console.log "Found anchor on same page, worse pos. (Known: ", start.top, "; found: ", hl.getTop(), ")"
acc
else
# The page is not yet rendered, can't decide yet.
# Let's just store this one, too
#console.log "Found anchor on same page, unknown pos."
start
:
page
:
start
.
page
next
:
$
.
merge
next
,
[
anchor
]
else
# No, we have clearly seen better alternatives
acc
,
{}
#console.log "Next is", next
# Get an anchor from the page we want to go to
anchor
=
next
[
0
]
...
...
h/static/scripts/services.coffee
View file @
05be24c4
...
...
@@ -92,7 +92,6 @@ class Hypothesis extends Annotator
origin
:
origin
scope
:
"
#{
scope
}
:provider"
onReady
:
=>
console
.
log
"Provider functions are ready for
#{
origin
}
"
if
source
is
$window
.
parent
then
@
host
=
channel
entities
=
[]
channel
=
this
.
_setupXDM
options
...
...
@@ -272,7 +271,6 @@ class Hypothesis extends Annotator
for
p
in
@
annotator
.
providers
for
uri
in
p
.
entities
unless
entities
[
uri
]
?
console
.
log
"Loading annotations for: "
+
uri
entities
[
uri
]
=
true
this
.
loadAnnotationsFromSearch
(
angular
.
extend
{},
query
,
uri
:
uri
)
...
...
@@ -308,17 +306,12 @@ class Hypothesis extends Annotator
switch
@
socialView
.
name
when
"none"
# Sweet, nothing to do, just clean up previous filters
console
.
log
"Not applying any Social View filters."
delete
query
.
user
when
"single-player"
if
@
plugins
.
Permissions
?
.
user
console
.
log
"Social View filter: single player mode."
query
.
user
=
@
plugins
.
Permissions
.
user
else
console
.
log
"Social View: single-player mode, but ignoring it, since not logged in."
delete
query
.
user
else
console
.
warn
"Unsupported Social View: '"
+
@
socialView
.
name
+
"'!"
setTool
:
(
name
)
->
return
if
name
is
@
tool
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment