You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fs_hook.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. function resize_filmstrips(that,fn_name,args=[]){
  2. }
  3. function resize_filmstrips2(that,fn_name,args=[]){
  4. }
  5. glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
  6. glob_mx.filmstrip_tile_handlers = glob_mx.filmstrip_tile_handlers || {}
  7. // run callbacks for all filmstrips on resize
  8. function resizeThumbnailsForCustomView(that,fn_name,args=[]){
  9. const thumbs = glob_react.Filmstrip._getThumbs()
  10. const all_thumbs = $(".small_vid")
  11. const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
  12. const vid_containers = $(".vid_container")
  13. const loose_thumbs = custom_thumbs.not(vid_containers.children())
  14. var k,v
  15. let fs_handler_key
  16. let fs_handler
  17. let fs_tile_handler
  18. let fs_handlers = new Map()
  19. let i
  20. // console.trace("rtscv...")
  21. let fs_tile_handlers = []
  22. for (v of vid_containers){
  23. // clog(":",v,v.dataset.fs_type)
  24. fs_handler_key = v.dataset.fs_handler
  25. // clog("~",v,v.dataset,fs_handler)
  26. fs_tile_handler = glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop
  27. fs_handler = glob_mx.filmstrip_handlers[fs_handler_key] || nop
  28. // glob_mx.filmstrip_tile_handlers[fs_handler_key] ? glob_mx.filmstrip_tile_handlers[fs_handler_key](v) : 1
  29. // fs_tile_handlers.push([glob_mx.filmstrip_tile_handlers[fs_handler_key] || nop,v])
  30. // fs_handlers.setD(glob_mx.filmstrip_handlers[fs_handler_key] || nop,)
  31. fs_tile_handlers.push([fs_tile_handler,v])
  32. fs_handlers.setD(fs_handler,[])
  33. i = fs_handlers.get(fs_handler)
  34. i.push(v)
  35. // glob_mx.filmstrip_handlers
  36. }
  37. clog("fs_tile_handlers",fs_tile_handlers)
  38. for ([k,v] of fs_handlers){
  39. // clog("ft0",k,v)
  40. k(v)
  41. }
  42. for ([k,v] of fs_tile_handlers){
  43. // clog("ft",k,v)
  44. k(v)
  45. }
  46. // return
  47. // const custom_thumbs = all_thumbs
  48. var aspect = 16/18
  49. var width = 135
  50. var height = Math.round(width/aspect)
  51. loose_thumbs.css({
  52. 'padding-top': '',
  53. "min-height": `${height}px`,
  54. "min-width": `${width}px`,
  55. width: `${width}px`,
  56. height: `${height}px`,
  57. })
  58. clog("rtscv",fn_name,[that,...args])
  59. }
  60. function onover(){
  61. clog(this,[...arguments])
  62. }