(dataURI)
| 78 | } |
| 79 | |
| 80 | function dataURItoBlob(dataURI) { |
| 81 | // convert base64/URLEncoded data component to raw binary data held in a string |
| 82 | var byteString, |
| 83 | mimeString, |
| 84 | ia, |
| 85 | i; |
| 86 | |
| 87 | if (dataURI.split(',')[0].indexOf('base64') >= 0) { |
| 88 | byteString = atob(dataURI.split(',')[1]); |
| 89 | } else { |
| 90 | byteString = unescape(dataURI.split(',')[1]); |
| 91 | } |
| 92 | |
| 93 | // separate out the mime component |
| 94 | mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; |
| 95 | |
| 96 | // write the bytes of the string to a typed array |
| 97 | ia = new Uint8Array(byteString.length); |
| 98 | for (i = 0; i < byteString.length; i += 1) { |
| 99 | ia[i] = byteString.charCodeAt(i); |
| 100 | } |
| 101 | |
| 102 | return new Blob([ia], {type: mimeString}); |
| 103 | } |
| 104 | |
| 105 | // keyCode, ctrlKey, target, relatedTarget, shiftKey, altKey |
| 106 | function fireEvent(element, eventName, options) { |
no outgoing calls
no test coverage detected
searching dependent graphs…