← Commit history

fix textures: data-URI images in group GLBs + restore blob shim

John Lauer ·19b70cc5fc ·3mo ago ·parent 4ad82bd
6 files changed +32−4
grp-components.glb.png
⋯ 1 unchanged line ⋯
grp-cu1.glb.png
⋯ 1 unchanged line ⋯
grp-cu16.glb.png
⋯ 1 unchanged line ⋯
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "type": "component",-  "version": "0.1.24",+  "version": "0.1.25",   "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",   "tags": [     "hardware"
page.json+10−3
@@ -4,9 +4,16 @@   "slug": "bq25792-charger",   "title": "BQ25792 Charger",   "brief": "Buck-boost 1S-4S battery charger board (TI BQ25792) with 14 Adom machine pins, by Adonis",-  "version": "0.1.24",+  "version": "0.1.25",   "tags": [-    "hardware"+    "adom",+    "adom-modular",+    "component",+    "charger",+    "battery",+    "bq25792",+    "power",+    "usb-c"   ],   "license": "proprietary",   "component": {@@ -49,7 +56,7 @@     "email": "[email protected]"   },   "visibility": "public",-  "description": "BQ25792 Charger - buck-boost 1S-4S battery charger board by Adonis, with real 3D copper traces and measured stackup.",+  "description": "BQ25792 Charger - a buck-boost 1S-4S battery charger board (Texas Instruments BQ25792) designed by Adonis in Fusion 360, with 14 Adom machine pins for the modular stack. Interactive colored 3D model, schematic and layout views.",   "dependencies": {},   "files": [     "README.md",
readme.html+21
@@ -135,6 +135,27 @@ exported bodies + design rules.</p>     });   } +  // CSP shim: img-src has no blob:, so stamp small Blobs with a data: URI and return+  // that from createObjectURL (Babylon wraps glTF textures in blob object-URLs).+  (function(){+    var orig=URL.createObjectURL.bind(URL);+    URL.createObjectURL=function(b){ return (b&&b.__dataUri)||orig(b); };+    var OB=window.Blob;+    window.Blob=function(parts,opts){+      var bl=new OB(parts,opts);+      try{+        if(parts&&parts.length===1&&(parts[0] instanceof Uint8Array||parts[0] instanceof ArrayBuffer)){+          var u8=parts[0] instanceof Uint8Array?parts[0]:new Uint8Array(parts[0]);+          if(u8.length<3000000){+            var st=""; for(var i=0;i<u8.length;i+=0x8000) st+=String.fromCharCode.apply(null,u8.subarray(i,i+0x8000));+            bl.__dataUri="data:"+((opts&&opts.type)||"application/octet-stream")+";base64,"+btoa(st);+          }+        }+      }catch(e){}+      return bl;+    };+    window.Blob.prototype=OB.prototype;+  })();   const Viewer=window.Adom3DViewerBabylon9;   if(!Viewer){ set("viewer bundle failed to load"); return; }   let viewer;