summaryrefslogtreecommitdiff
path: root/widgets/jenkins_build_status/jenkins_build_status.coffee
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-07-17 19:06:53 +0200
committerVarac <varac@leap.se>2017-10-16 13:20:42 +0200
commitd8e6b9f73339b5e73f77a418c1ba1a3206393e73 (patch)
treedcb50e56fd0e61505a77517b34e9634197293078 /widgets/jenkins_build_status/jenkins_build_status.coffee
parent4db50705a9bf22701ae43011d4b9485dadcaad8b (diff)
cleanup: jenkins - we don't use anymore
Diffstat (limited to 'widgets/jenkins_build_status/jenkins_build_status.coffee')
-rw-r--r--widgets/jenkins_build_status/jenkins_build_status.coffee28
1 files changed, 0 insertions, 28 deletions
diff --git a/widgets/jenkins_build_status/jenkins_build_status.coffee b/widgets/jenkins_build_status/jenkins_build_status.coffee
deleted file mode 100644
index d7d8630..0000000
--- a/widgets/jenkins_build_status/jenkins_build_status.coffee
+++ /dev/null
@@ -1,28 +0,0 @@
-class Dashing.JenkinsBuildStatus extends Dashing.Widget
-
- lastPlayed: 0
- timeBetweenSounds: 300000
-
- onData: (data) ->
- if data.failed
- $(@node).find('div.build-failed').show()
- $(@node).find('div.build-succeeded').hide()
- $(@node).css("background-color", "red")
-
- if 'speechSynthesis' of window
- @playSoundForUser data.failedJobs[0].value if Date.now() - @lastPlayed > @timeBetweenSounds
- else
- $(@node).find('div.build-failed').hide()
- $(@node).find('div.build-succeeded').show()
- $(@node).css("background-color", "#12b0c5")
-
- playSoundForUser: (user) ->
- @lastPlayed = Date.now()
- texts = ["#{user} has broken the build.", "The build is broken by #{user}", "#{user} is great, but lacks some programming skills", "Oops, I did it again."]
- textNr = Math.floor((Math.random() * texts.length));
- @playSound texts[textNr]
-
- playSound: (text) ->
- msg = new SpeechSynthesisUtterance(text)
- msg.voice = speechSynthesis.getVoices()[0]
- speechSynthesis.speak msg \ No newline at end of file