Minor fixes
This commit is contained in:
parent
16fffcd9d0
commit
1e7ebeb23f
|
@ -10,6 +10,7 @@ vk_music.search "Kasabian", "L.S.F. (Lost Souls Forever)", "2:17", (url) ->
|
|||
audio.setAttribute "src", url
|
||||
document.getElementsByTagName("body")[0].appendChild audio
|
||||
audio.play()
|
||||
false
|
||||
```
|
||||
|
||||
### JavaScript example
|
||||
|
@ -21,6 +22,7 @@ vk_music.search("Kasabian", "L.S.F. (Lost Souls Forever)", "2:17", function(url)
|
|||
audio = document.createElement("audio");
|
||||
audio.setAttribute("src", url);
|
||||
document.getElementsByTagName("body")[0].appendChild(audio);
|
||||
return audio.play();
|
||||
audio.play();
|
||||
return false;
|
||||
});
|
||||
```
|
|
@ -61,10 +61,10 @@ class VkontakteMusic
|
|||
artist+" "+track.replace(/\(.*\)/i, '').split('/')[0]
|
||||
|
||||
trim: (str) ->
|
||||
while str.indexOf(' ') isnt -1
|
||||
str = str.replace ' ', ' '
|
||||
if str.charAt(0) is ' '
|
||||
str = str.substring 1
|
||||
if str.charAt(str.length - 1) is ' '
|
||||
str = str.substring 0, str.length - 1
|
||||
str
|
||||
while str.indexOf(' ') isnt -1
|
||||
str = str.replace ' ', ' '
|
||||
if str.charAt(0) is ' '
|
||||
str = str.substring 1
|
||||
if str.charAt(str.length - 1) is ' '
|
||||
str = str.substring 0, str.length - 1
|
||||
str
|
||||
|
|
Loading…
Reference in New Issue