JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
tweak clicking/activating, more keybindings
[userscripts.git] / duolingo-html5-audio.user.js
1 /*\r
2 *   Written by JasonWoof 2012 public domain\r
3 */\r
4 \r
5 // ==UserScript==\r
6 // @name          duolingo html5 audio\r
7 // @namespace     http://patcavit.com/greasemonkey\r
8 // @description   convert flash player to html5 audio\r
9 // @include       http://duolingo.com/*\r
10 // ==/UserScript==\r
11 \r
12 (function() \r
13 {\r
14         setTimeout(function() {\r
15                 var $ = window.jQuery;\r
16                 console.log('tick');\r
17                 var speaker = $('#big-speaker');\r
18                 speaker.children('div').each(function() {\r
19                         var el = $(this);\r
20                         var id = el.attr('id');\r
21                         if(id && id.substr(0, 13) == 'speaker-audio' && id.substr(id.length - 6) != 'button') {\r
22                                 var new_el = '<div><audio controls="controls" src="';\r
23                                 new_el += el.attr('src');\r
24                                 new_el += '"></audio><span onclick="$(this).parent().remove()">x</span></div>';\r
25                                 speaker.append($(new_el));\r
26                         }\r
27                 });\r
28         }, 5000);\r
29 })();\r