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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. clog("!")
  2. glob_mx.filmstrip_handlers = glob_mx.filmstrip_handlers || {}
  3. dflt_css = {
  4. 'padding-top': '',
  5. "min-height": ``,
  6. "min-width": ``,
  7. width: ``,
  8. height: ``,
  9. }
  10. function resize_thumbs(thumbs,css){
  11. const computed_css = Object.assign({},dflt_css,css)
  12. var k,v
  13. for ([k,v] of Object.entries(computed_css)){
  14. Number(v) ? computed_css[k] = v + "px" : 0
  15. }
  16. // clog("RTHUMBS")
  17. thumbs.css(computed_css)
  18. }
  19. function resize_thumbs_vertical(cont){
  20. const computed_css = Object.assign({},dflt_css)
  21. var aspect = 16/9
  22. var width = 335
  23. var thumbs = $(cont).children(".small_vid")
  24. width = $(cont).width() - 1
  25. // computed_css["--v_index"]=`"VERT"`
  26. var height = Math.round(width/aspect)
  27. computed_css.height = height
  28. computed_css["min-height"] = height
  29. computed_css.width = width
  30. computed_css["min-width"] = width
  31. var k,v
  32. for ([k,v] of Object.entries(computed_css)){
  33. Number(v) ? computed_css[k] = v + "px" : 0
  34. }
  35. // clog("RTHUMBS")
  36. thumbs.css(computed_css)
  37. }
  38. function resize_thumbs_horizontal(cont){
  39. const computed_css = Object.assign({},dflt_css)
  40. var aspect = 16/9
  41. var width = 335
  42. // computed_css["--v_index"]=`"horizontal"`
  43. var thumbs = $(cont).children(".small_vid")
  44. width = ($(cont).height() * aspect)
  45. width = ($(cont).height() * aspect) - 1
  46. var height = Math.round(width/aspect)
  47. computed_css.height = height
  48. computed_css.width = width
  49. var k,v
  50. for ([k,v] of Object.entries(computed_css)){
  51. Number(v) ? computed_css[k] = v + "px" : 0
  52. }
  53. // clog("RTHUMBS")
  54. thumbs.css(computed_css)
  55. }
  56. function resize_thumbs_center(cont){
  57. const computed_css = Object.assign({},dflt_css)
  58. var aspect = 16/9
  59. var width = 335
  60. // computed_css["--v_index"]=`"horizontal"`
  61. var thumbs = $(cont).children(".small_vid")
  62. width = ($(cont).height() * aspect)
  63. width = ($(cont).height() * aspect) - 1
  64. var height = Math.round(width/aspect)
  65. computed_css.height = height
  66. computed_css.width = width
  67. var k,v
  68. for ([k,v] of Object.entries(computed_css)){
  69. Number(v) ? computed_css[k] = v + "px" : 0
  70. }
  71. // clog("RTHUMBS")
  72. thumbs.css(computed_css)
  73. }
  74. function resize_filmstrips(that,fn_name,args=[]){
  75. }
  76. function resize_filmstrips2(that,fn_name,args=[]){
  77. }
  78. function resizeThumbnailsForCustomView(that,fn_name,args=[]){
  79. const thumbs = glob_react.Filmstrip._getThumbs()
  80. const all_thumbs = $(".small_vid")
  81. const custom_thumbs = all_thumbs.not(thumbs.remlocThumbs)
  82. const vid_containers = $(".vid_container")
  83. const loose_thumbs = custom_thumbs.not(vid_containers.children())
  84. var k,v
  85. for (v of vid_containers){
  86. // clog(":",v,v.dataset.fs_type)
  87. switch (v.dataset.fs_type){
  88. case "vertical":{
  89. resize_thumbs_vertical(v)
  90. /*
  91. resize_thumbs($(v).children(".small_vid"),{
  92. width: `${100}px`,
  93. height: `${100}px`,
  94. })
  95. */
  96. break;
  97. }
  98. case "horizontal":{
  99. resize_thumbs_horizontal(v)
  100. break;
  101. }
  102. case "single":{
  103. resize_thumbs_center(v)
  104. break;
  105. }
  106. default:{
  107. break;
  108. }
  109. clog("HI")
  110. }
  111. }
  112. // return
  113. // const custom_thumbs = all_thumbs
  114. var aspect = 16/18
  115. var width = 135
  116. var height = Math.round(width/aspect)
  117. loose_thumbs.css({
  118. 'padding-top': '',
  119. "min-height": `${height}px`,
  120. "min-width": `${width}px`,
  121. width: `${width}px`,
  122. height: `${height}px`,
  123. })
  124. clog("rtscv",fn_name,[that,...args])
  125. }
  126. function calc_fs_dims0(){
  127. const hd_w = 16
  128. const hd_h = 9
  129. const aspect_ratio_hd = hd_w / hd_h
  130. const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
  131. const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
  132. const state = APP.store.getState();
  133. var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
  134. var avail_width =clientWidth
  135. var avail_height =clientHeight - 100
  136. var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
  137. columns:1,
  138. visibleRows:1,
  139. clientWidth:avail_width,
  140. clientHeight:avail_height,
  141. TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
  142. verticalMargin:0,
  143. // sideMargins=0,
  144. // topBottomPadding:100,
  145. })
  146. var dim_65 = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
  147. columns:1,
  148. visibleRows:1,
  149. clientWidth:avail_width,
  150. clientHeight:avail_height,
  151. TILE_ASPECT_RATIO:aspect_ratio_65 ,
  152. verticalMargin:0,
  153. // sideMargins=0,
  154. // topBottomPadding:100,
  155. })
  156. var dim_64 = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
  157. columns:1,
  158. visibleRows:1,
  159. clientWidth:avail_width,
  160. clientHeight:avail_height,
  161. TILE_ASPECT_RATIO:aspect_ratio_64 ,
  162. verticalMargin:0,
  163. // sideMargins=0,
  164. // topBottomPadding:100,
  165. })
  166. clog("~~",dim_hd)
  167. resize_thumbs_proto($(".a1"),{
  168. width:clientWidth,
  169. height:clientHeight,
  170. "--vtext":`"window"`
  171. })
  172. resize_thumbs_proto($(".a2"),{
  173. width:avail_width,
  174. height:avail_height,
  175. "--vtext":`"avail"`
  176. })
  177. resize_thumbs_proto($(".b2"),[dim_hd,
  178. {
  179. "--vtext":`"dim_hd"`
  180. },])
  181. resize_thumbs_proto($(".b3"),[dim_65,
  182. {
  183. "--vtext":`"dim_65"`
  184. },])
  185. resize_thumbs_proto($(".b4"),[dim_64,
  186. {
  187. "--vtext":`"dim_64"`
  188. },])
  189. let w5,h5,w53,h53,w54,h54
  190. h5 = dim_hd.height/5
  191. w5 = dim_hd.width/5
  192. w53 = w5 * 3
  193. h53 = h5 * 3
  194. w54 = w5 * 4
  195. h54 = h5 * 4
  196. resize_thumbs_proto($(".a3z"),[
  197. {
  198. width:w5,
  199. height:h5,
  200. "--vtext":`"t5"`
  201. },])
  202. resize_thumbs_proto($(".a4"),[
  203. {
  204. width:dim_hd.width,
  205. height:h5,
  206. "--vtext":`"top_fs"`
  207. },])
  208. resize_thumbs_proto($(".a5"),[
  209. {
  210. width:w5,
  211. height:h53,
  212. top:h5,
  213. "--vtext":`"left_fs"`,
  214. },])
  215. resize_thumbs_proto($(".a6"),[
  216. {
  217. width:w5,
  218. height:h53,
  219. top:h5,
  220. left:w54,
  221. // right:0,
  222. "--vtext":`"right_fs"`,
  223. },])
  224. resize_thumbs_proto($(".a7"),[
  225. {
  226. width:dim_hd.width,
  227. height:h5,
  228. top:h54,
  229. // left:w54,
  230. // right:0,
  231. "--vtext":`"bottom_fs"`,
  232. },])
  233. // resize_thumbs_proto($(".b2"),dim_hd)
  234. }
  235. function calc_fs_dims(){
  236. const hd_w = 16
  237. const hd_h = 9
  238. const aspect_ratio_hd = hd_w / hd_h
  239. const aspect_ratio_65 = (hd_w * 6) / (hd_h * 5)
  240. const aspect_ratio_64 = (hd_w * 6) / (hd_h * 4)
  241. const state = APP.store.getState();
  242. var { clientHeight, clientWidth } = state['features/base/responsive-ui'];
  243. var avail_width =clientWidth
  244. var avail_height =clientHeight - 100
  245. var dim_hd = glob_dev_fns.calculateThumbnailSizeForTileView_dev({
  246. columns:1,
  247. visibleRows:1,
  248. clientWidth:avail_width,
  249. clientHeight:avail_height,
  250. TILE_ASPECT_RATIO:TILE_ASPECT_RATIO ,
  251. verticalMargin:0,
  252. // sideMargins=0,
  253. // topBottomPadding:100,
  254. })
  255. let w5,h5,w53,h53,w54,h54
  256. h5 = dim_hd.height/5
  257. w5 = dim_hd.width/5
  258. w53 = w5 * 3
  259. h53 = h5 * 3
  260. w54 = w5 * 4
  261. h54 = h5 * 4
  262. // fs_type: "vertical"
  263. resize_thumbs_proto($(".ic1"),[
  264. {
  265. width:dim_hd.width,
  266. height:h5,
  267. "--vtext":`"top_fs"`,
  268. // data:{fs_type: "vertical"},
  269. data:{fs_type: "horizontal",},
  270. },])
  271. resize_thumbs_proto($(".ic2"),[
  272. {
  273. width:w5,
  274. height:h53,
  275. top:h5,
  276. "--vtext":`"left_fs"`,
  277. data:{fs_type: "vertical"},
  278. },])
  279. resize_thumbs_proto($(".ic3"),[
  280. {
  281. width:w5,
  282. height:h53,
  283. top:h5,
  284. left:w54,
  285. // left:0,
  286. // right:0,
  287. "--vtext":`"right_fs"`,
  288. data:{fs_type: "vertical"},
  289. },])
  290. resize_thumbs_proto($(".ic6"),[
  291. {
  292. width:dim_hd.width,
  293. height:h5,
  294. top:h54,
  295. left:0,
  296. // left:w54,
  297. // right:0,
  298. "--vtext":`"bottom_fs"`,
  299. data:{fs_type: "horizontal"},
  300. },])
  301. resize_thumbs_proto($(".ic4"),[
  302. {
  303. width:w53,
  304. height:h53,
  305. height:h53,
  306. top:h5,
  307. left:w5,
  308. // left:w54,
  309. // right:0,
  310. "--vtext":`"center"`,
  311. data:{fs_type: "single"},
  312. },])
  313. }
  314. function new_move(){
  315. var j
  316. try {
  317. j = jc(window.sorted_tiles)
  318. } catch (err) {
  319. clog("NEW MOVE err:",err)
  320. }
  321. // var j = $(".small_vid")
  322. $(".ic1").append(j.splice(2,5))
  323. $(".ic2").append(j.splice(0,3))
  324. $(".ic3").append(j.splice(0,3))
  325. $(".ic6").append(j.splice(0,5))
  326. $(".ic4").append(j.splice(0,1))
  327. }
  328. function move_info(){
  329. var j = $(".small_vid")
  330. var k,v
  331. for (v of j){
  332. clog(v)
  333. }
  334. // $(".ic1").append(j.splice(2,5))
  335. // $(".ic2").append(j.splice(0,3))
  336. // $(".ic3").append(j.splice(0,3))
  337. // $(".ic6").append(j.splice(0,5))
  338. // $(".ic4").append(j.splice(0,1))
  339. }
  340. if (window.saftly_remove){
  341. init_api6()
  342. // calc_fs_dims0()
  343. calc_fs_dims()
  344. new_move()
  345. // get_avail_width()
  346. // clog("REZIE PROTO READY")
  347. }