1. <!DOCTYPE html>
  2. <html lang="en-US">
  3. <!--
  4. SWF list for f/ags
  5. v1.0.0 (25-Nov-2018) by Anonymous
  6. Convenient tool for browsing local SWF collection.
  7. No dependecies aside of reasonable new web browser from before 2020.
  8. 1. Place close/next to/inside your swf collection.
  9. 2. Generate swfs.js - list of relative paths to your swfs and place it alogside of this file.
  10. 3. ???
  11. 4. Profit
  12. swfs.js
  13. should contain "pathsString" variable with a line per file paths. E.g.:
  14. pathsString = `
  15. dir/subdir/file.swf
  16. dir/file.swf
  17. file.swf
  18. `;
  19. Use '/' as path separator!
  20. Run this in bash terminal to generate swfs.js
  21. echo "let pathsString = \`" > swfs.js && find -iname \*.swf -print >> swfs.js && echo "\`;" >> swfs.js
  22. Uniocode should work just fine. E.g:
  23. (ノ^∇^)ノ☎------[](; ̄Д ̄).swf
  24. どこに.swf
  25. SUNDAY SCHOOL (Short).swf
  26. -->
  27. <head>
  28. <meta charset="UTF-8">
  29. <meta name="viewport" content="width=device-width, initial-scale=1">
  30. <style>
  31. body {
  32. background-color: black;
  33. color: white;
  34. font-family: arial,helvetica,sans-serif;
  35. }
  36. a {
  37. color: #81a2be;
  38. text-decoration: none;
  39. }
  40. a:hover, a.clicked {
  41. color: lightgray;
  42. }
  43. .ctr {
  44. color: khaki;
  45. }
  46. </style>
  47. <title>SWF list for f/ags</title>
  48. <script type="text/javascript" charset="utf-8" src="swfs.js"></script>
  49. <script>
  50. let showing = null;
  51. let height = 720;
  52. let width = 1280;
  53. let sizeStep = 100;
  54. let unit = "px";
  55. document.addEventListener('DOMContentLoaded', loadAs, false);
  56. function loadAs()
  57. {
  58. let paths = pathsString.split("\n").filter(x => x !== "").sort();
  59. let container = document.getElementById("container");
  60. for (var i = 0; i < paths.length; i++) {
  61. let diva = getNewDivA(i, paths[i], esc(paths[i]));
  62. container.appendChild(diva);
  63. }
  64. }
  65. function getNewDivA(id, name, src)
  66. {
  67. let div = document.createElement("div");
  68. let a = document.createElement("a");
  69. div.appendChild(a);
  70. a.id = id;
  71. a.title = src;
  72. a.text = name;
  73. a.href = "#" + id;
  74. a.onclick = function() { toggle(this.id, src); };
  75. return div;
  76. }
  77. function esc(str)
  78. {
  79. return encodeURIComponent(str).replace(/%2F/g, "/");
  80. }
  81. function toggle(id, src)
  82. {
  83. if (showing === id)
  84. {
  85. hide();
  86. }
  87. else {
  88. show(id, src);
  89. }
  90. }
  91. function hide()
  92. {
  93. if (!showing) return;
  94. hideController();
  95. let swf = document.getElementById( getSwfId(showing) );
  96. swf.parentNode.removeChild(swf);
  97. showing = null;
  98. }
  99. function getSwfId(id)
  100. {
  101. return id + "_";
  102. }
  103. function hideController()
  104. {
  105. let ctr = getControllerDiv();
  106. ctr.style.visibility = "hidden";
  107. document.body.appendChild(ctr);
  108. }
  109. function getControllerDiv()
  110. {
  111. let ctr = document.getElementById("controller");
  112. ctr.parentNode.removeChild(ctr);
  113. ctr.style.visibility = "visible";
  114. return ctr;
  115. }
  116. function show(id, src)
  117. {
  118. hide();
  119. showing = id;
  120. let a = document.getElementById( showing );
  121. a.classList.add("clicked");
  122. a.parentNode.insertBefore(getNewSwf(id, src), a.nextSibling);
  123. }
  124. function getNewSwf(id, src)
  125. {
  126. let div = document.createElement("div");
  127. let swf = document.createElement("embed");
  128. div.appendChild(swf);
  129. div.appendChild(getControllerDiv());
  130. div.id = getSwfId(id);
  131. div.style = "text-align: center";
  132. swf.classList.add("swf");
  133. swf.src = src;
  134. swf.height = height + unit;
  135. swf.width = width + unit;
  136. swf.allowscriptaccess = "never";
  137. return div;
  138. }
  139. function setSize(w, h)
  140. {
  141. let swfs = document.getElementsByClassName("swf");
  142. width = w;
  143. height = h;
  144. wu = w + unit;
  145. hu = h + unit;
  146. for (var i = 0; i < swfs.length; i++) {
  147. swfs[i].width = wu;
  148. swfs[i].height = hu;
  149. }
  150. let span = document.getElementById("size");
  151. span.textContent = "(" + width + "x" + height + ")";
  152. }
  153. function setWidthRel(dir)
  154. {
  155. setSize(width + dir * sizeStep, height);
  156. }
  157. function setHeightRel(dir)
  158. {
  159. setSize(width, height + dir * sizeStep);
  160. }
  161. function scale(dir) {
  162. let ratio = height / width;
  163. let w = width + dir * sizeStep;
  164. let h = height + dir * sizeStep * ratio;
  165. setSize(w, h);
  166. }
  167. </script>
  168. </head>
  169. <body>
  170. <h1>Enjoy</h1>
  171. <div id="container">
  172. <!-- This should be on load populated with <div><a ... </a></div> like this:
  173. <div><a id="1" title="PATH" href="#" onclick="toggle(this.id, 'PATH');return false;">NAME</a></div>
  174. Where PATH and NAME are loaded from swfs.js.
  175. After clicking on a link, <embed> with swf should be appended (or deleted):
  176. <embed id="1_" src="PATH" width="WIDTH" height="HEIGHT"></embed>
  177. And the "controller" is moved here.
  178. -->
  179. </div>
  180. <div id="controller" style="visibility: hidden;">
  181. <a class="ctr b" href="#" title="Hide" onclick="hide(); return false;">[Remove]</a>&ensp;
  182. <span id="size">(1280:720)</span>&ensp;
  183. <a class="ctr" href="#" title="+" onclick="scale(1); return false;">Bigger</a> |
  184. <a class="ctr" href="#" title="-" onclick="scale(-1); return false;">Smaller</a>&ensp;
  185. <a class="ctr" href="#" title="16:9" onclick="setSize(1280, 720); return false;">1280x720</a> |
  186. <a class="ctr" href="#" title="4:3" onclick="setSize(1280, 960); return false;">1280x960</a>&ensp;
  187. <a class="ctr" href="#" title="+" onclick="setWidthRel(0.5); return false;">Width +</a> |
  188. <a class="ctr" href="#" title="-" onclick="setWidthRel(-0.5); return false;">Width -</a>&ensp;
  189. <a class="ctr" href="#" title="+" onclick="setHeightRel(0.5); return false;">Height +</a> |
  190. <a class="ctr" href="#" title="-" onclick="setHeightRel(-0.5); return false;">Height -</a>
  191. </div>
  192. </body>
  193. </html>

SWF list for f/ags

v1.0.0 (25-Nov-2018) by Anonymous