Skip to content

Commit 6251927

Browse files
Fix copyright comment syntax to survive updated minification, initial tests of new parallel loading sequence for js files
1 parent e76d90e commit 6251927

50 files changed

Lines changed: 217 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.htaccess

Lines changed: 45 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
11
# Enable rewrite engine
22
RewriteEngine On
33

4-
# Set WASM MIME type
5-
AddType application/wasm .wasm
6-
7-
# Fix MIME types for favicons and webmanifest
8-
AddType image/svg+xml .svg .svgz
9-
AddType image/x-icon .ico
10-
AddType application/manifest+json .webmanifest
4+
# Force HTTPS
5+
RewriteCond %{HTTPS} off
6+
RewriteRule ^(.*)$ https://cam.eltryus.design/$1 [R=301,L]
7+
8+
# MIME types
9+
<IfModule mod_mime.c>
10+
AddType text/javascript .js
11+
AddType application/wasm .wasm
12+
AddType application/json .json
13+
AddType application/manifest+json .webmanifest
14+
AddType image/svg+xml .svg
15+
AddType image/x-icon .ico
16+
</IfModule>
1117

12-
# Enable compression
18+
# Compression
1319
<IfModule mod_deflate.c>
14-
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json image/svg+xml application/wasm
20+
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json application/wasm image/svg+xml
1521
</IfModule>
1622

17-
# Force LICENSE file to display as text
18-
<Files "LICENSE">
19-
ForceType text/plain
20-
</Files>
21-
22-
# Set index.html as directory index
23-
DirectoryIndex index.html
23+
# Security headers & Caching
24+
<IfModule mod_headers.c>
25+
# Security
26+
Header set X-Content-Type-Options "nosniff"
27+
Header set X-Frame-Options "SAMEORIGIN"
28+
Header set X-XSS-Protection "1; mode=block"
29+
Header set Referrer-Policy "strict-origin-when-cross-origin"
30+
31+
# --- CACHING STRATEGY ---
32+
33+
# GROUP 1: Code & Logic (The "Safe" Group)
34+
# Includes: HTML, CSS, JS, JSON
35+
# Action: Browser must check with server every time (0 latency if unchanged).
36+
# Prevents "stale code" issues.
37+
<FilesMatch "\.(html|css|js|mjs|json)$">
38+
Header set Cache-Control "no-cache, must-revalidate"
39+
</FilesMatch>
40+
41+
# GROUP 2: Heavy Binaries & Assets (The "Fast" Group)
42+
# Includes: WASM, Images
43+
# Action: Cache for 1 month.
44+
# Assumption: These change rarely.
45+
<FilesMatch "\.(wasm|png|jpg|jpeg|gif|webp|svg|ico)$">
46+
Header set Cache-Control "public, max-age=2592000, immutable"
47+
</FilesMatch>
2448

25-
# Disable MultiViews to prevent conflicts
26-
Options -MultiViews
49+
</IfModule>
2750

28-
# --- REMOVING EXTENSIONS ---
51+
# Directory and file handling
52+
DirectoryIndex index.html
53+
Options -MultiViews -Indexes
2954

30-
# 1. External Redirect (The "prettifier")
31-
# If someone types/links to "page.html", redirect them to "page"
32-
# (Skips if it's a directory like /clipper2/)
55+
# Clean URLs
3356
RewriteCond %{REQUEST_FILENAME} !-d
3457
RewriteCond %{THE_REQUEST} \s/+([^/]+)\.html[\s?] [NC]
3558
RewriteRule ^(.+)\.html$ /$1 [R=301,L]
3659

37-
# 2. Internal Rewrite (The "worker")
38-
# If they ask for "page", silently serve "page.html"
39-
# (Skips if "page" is actually a real directory)
4060
RewriteCond %{REQUEST_FILENAME} !-d
4161
RewriteCond %{REQUEST_FILENAME} !-f
4262
RewriteRule ^([^\.]+)$ $1.html [NC,L]

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ The application has been developed and tested with files generated from **KiCAD*
9292
* **Excellon:** `.drl`, `.xln`, `.txt`, `.drill`, `.exc`
9393
* **SVG**
9494

95-
Note: The parser understands all SVG data including complex Bézier curves and creates the corresponding Cubic or Quadratic primitives. Bézier primitives are then interpolated by the plotter into line segments, as the geometry engine does not support analytic Bézier offsetting, yet.
95+
Note 1: Exporting Gerber files with Protel file extensions allows drag'n'drop to automatically assign files to the expected operation.
96+
97+
Note 2: The parser understands all SVG data including complex Bézier curves and creates the corresponding Cubic or Quadratic primitives. Bézier primitives are then interpolated by the plotter into line segments, as the geometry engine does not support analytic Bézier offsetting, yet.
9698

9799
## Usage
98100

cam-core.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file cam-core.js
33
* @description Core application logic
44
* @author Eltryus - Ricardo Marques
@@ -104,29 +104,6 @@
104104

105105
this.debug('Initializing processors with Clipper2...');
106106

107-
// Check required classes
108-
const requiredClasses = ['GerberParser', 'ExcellonParser', 'ParserPlotter', 'GeometryProcessor'];
109-
110-
if (typeof ParserCore === 'undefined') {
111-
console.error('ParserCore base class not available');
112-
this.isInitializing = false;
113-
return false;
114-
}
115-
116-
let allAvailable = true;
117-
requiredClasses.forEach(className => {
118-
if (typeof window[className] === 'undefined') {
119-
console.error(`❌ ${className} not available`); // Review - replace emoji for character like ✓
120-
allAvailable = false;
121-
} else this.debug(`✓ ${className} available`);
122-
123-
});
124-
125-
if (!allAvailable) {
126-
this.isInitializing = false;
127-
return false;
128-
}
129-
130107
// Initialize GeometryProcessor
131108
if (typeof GeometryProcessor !== 'undefined') {
132109
this.geometryProcessor = new GeometryProcessor({

cam-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file cam-ui.js
33
* @description Tooltip integration, status manager usage
44
* @author Eltryus - Ricardo Marques

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file config.js
33
* @description Configuration - Single file (to be split later) - Under review
44
* @author Eltryus - Ricardo Marques

css/canvas.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file canvas.css
33
* @description Canvas-specific rendering styles
44
* @author Eltryus - Ricardo Marques

css/doc.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file css/doc.css
33
* @description Documentation specific elements
44
* @author Eltryus - Ricardo Marques

css/theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file theme.css
33
* @description Theme application layer - applies theme tokens as CSS variables
44
* @author Eltryus - Ricardo Marques

gcode/gcode-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file gcode/gcode-generator.js
33
* @description Complete G-code generation from toolpath plans
44
* @author Eltryus - Ricardo Marques

gcode/processors/base-processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/*!
22
* @file gcode/processors/base-processor.js
33
* @description Base post-processing orchestrator
44
* @author Eltryus - Ricardo Marques

0 commit comments

Comments
 (0)