diff --git a/Cargo.lock b/Cargo.lock index 9540e96..403746d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -863,19 +863,6 @@ dependencies = [ "winit", ] -[[package]] -name = "eframe_template" -version = "0.1.0" -dependencies = [ - "eframe", - "egui", - "env_logger", - "log", - "serde", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "egui" version = "0.29.0" @@ -2184,6 +2171,19 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +[[package]] +name = "rdx" +version = "0.1.0" +dependencies = [ + "eframe", + "egui", + "env_logger", + "log", + "serde", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "redox_syscall" version = "0.4.1" diff --git a/Cargo.toml b/Cargo.toml index e7a9406..6502d63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "eframe_template" +name = "rdx" version = "0.1.0" authors = ["Emil Ernerfeldt "] edition = "2021" @@ -13,10 +13,10 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] egui = "0.29" eframe = { version = "0.29", default-features = false, features = [ - "accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies. - "default_fonts", # Embed the default egui fonts. - "glow", # Use the glow rendering backend. Alternative: "wgpu". - "persistence", # Enable restoring app state when restarting the app. + "accesskit", # Make egui compatible with screen readers. NOTE: adds a lot of dependencies. + "default_fonts", # Embed the default egui fonts. + "glow", # Use the glow rendering backend. Alternative: "wgpu". + "persistence", # Enable restoring app state when restarting the app. ] } log = "0.4" @@ -30,7 +30,7 @@ env_logger = "0.11" # web: [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4" -web-sys = "0.3.70" # to access the DOM (to hide the loading text) +web-sys = "0.3.70" # to access the DOM (to hide the loading text) [profile.release] opt-level = 2 # fast and small wasm diff --git a/assets/sw.js b/assets/sw.js index 7ecd229..675c1be 100644 --- a/assets/sw.js +++ b/assets/sw.js @@ -1,25 +1,20 @@ -var cacheName = 'egui-template-pwa'; -var filesToCache = [ - './', - './index.html', - './eframe_template.js', - './eframe_template_bg.wasm', -]; +var cacheName = "rhai-markdown-extension-pwa"; +var filesToCache = ["./", "./index.html", "./rdx.js", "./rdx_bg.wasm"]; /* Start the service worker and cache all of the app's content */ -self.addEventListener('install', function (e) { +self.addEventListener("install", function (e) { e.waitUntil( caches.open(cacheName).then(function (cache) { return cache.addAll(filesToCache); - }) + }), ); }); /* Serve cached content when offline */ -self.addEventListener('fetch', function (e) { +self.addEventListener("fetch", function (e) { e.respondWith( caches.match(e.request).then(function (response) { return response || fetch(e.request); - }) + }), ); }); diff --git a/index.html b/index.html index f1657ca..0770f95 100644 --- a/index.html +++ b/index.html @@ -1,148 +1,179 @@ - + - + - - + + - + - eframe template + Rhai Markdown Extension - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + - +
-

- Loading… -

-
+

Loading…

+
- - + diff --git a/src/main.rs b/src/main.rs index 029bf61..ee1b52f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,9 +18,9 @@ fn main() -> eframe::Result { ..Default::default() }; eframe::run_native( - "eframe template", + "Rhai Markdown Extension", native_options, - Box::new(|cc| Ok(Box::new(eframe_template::TemplateApp::new(cc)))), + Box::new(|cc| Ok(Box::new(rdx::TemplateApp::new(cc)))), ) } @@ -50,7 +50,7 @@ fn main() { .start( canvas, web_options, - Box::new(|cc| Ok(Box::new(eframe_template::TemplateApp::new(cc)))), + Box::new(|cc| Ok(Box::new(rdx::TemplateApp::new(cc)))), ) .await;