Guest User

Untitled

a guest
Oct 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function asset_selector_type(asset_type) {
  2. console.log(asset_type);
  3. switch(asset_type) {
  4. case audio:
  5. $.getJSON('/teacher/' + asset_type + ".json", function(data) {
  6. console.log(data)
  7. for(var i=0; i < data.length; i++) {
  8. $('#asset_list form').append("<input type='radio' name='asset' /><span>" + data[i].audio.content_file_name + "'/>");
  9. }
  10. });
  11. break;
  12. case document:
  13. break;
  14. case image:
  15. $.getJSON('/teacher/' + asset_type + "s.json", function(data) {
  16. console.log(data)
  17. for(var i=0; i < data.length; i++) {
  18. $('#asset_list form').append("<input type='radio' name='asset' /><img src='/assets/" + asset_type + "s/" + data[i].image.id + "/small/" + data[i].image.content_file_name + "'/>");
  19. }
  20. })
  21. break;
  22. case quiz:
  23. break;
  24. case video:
  25. break;
  26. }
  27. }
Add Comment
Please, Sign In to add comment