Commit 05be24c4 authored by Aron Carroll's avatar Aron Carroll Committed by Nick Stenning

Remove console.log statements from within the app

Log statements do not belong in production code.
parent 660bf572
......@@ -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
......
......@@ -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
......
......@@ -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
......
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'
......
......@@ -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]
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment