Skip to content

Commit

Permalink
Modularization working and complete! We can now use common.ts as a mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
basshelal committed Jul 2, 2022
1 parent 12f7fa1 commit c367342
Show file tree
Hide file tree
Showing 18 changed files with 319 additions and 211 deletions.
3 changes: 3 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"homepage": "https://github.com/basshelal/Wudooh",
"readme": "https://github.com/basshelal/Wudooh/README.md",
"type": "module",
"scripts": {
"minifyMain": "uglifyjs -c -m --output src/main.min.js -- src/main.js",
"minifyPopup": "uglifyjs -c -m --output src/popup.min.js -- src/popup.js",
Expand Down
6 changes: 3 additions & 3 deletions public/custom_fonts.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "public/animations.css";
@import "public/material.css";
@import "public/fonts.css";
@import "animations.css";
@import "material.css";
@import "fonts.css";

/* The main parts of the HTML, but not the items */
html, header, body, footer {
Expand Down
4 changes: 2 additions & 2 deletions public/custom_fonts.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ <h1>Add New Font</h1>
</div>
</div>
</body>
<script src="../dist/js/common.js"></script>
<script src="../dist/js/custom_fonts.js"></script>
<script src="js/common.js"></script>
<script src="js/custom_fonts.js"></script>
</html>
7 changes: 3 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@
"all_frames": true,
"run_at": "document_start",
"js": [
"common.js",
"plugins.js",
"main.js"
"js/main.js"
],
"css": [
"fonts.css"
]
}
],
"background": {
"service_worker": "background.js"
"service_worker": "js/background.js",
"type": "module"
},
"web_accessible_resources": [
{
Expand Down
6 changes: 3 additions & 3 deletions public/popup.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "public/animations.css";
@import "public/material.css";
@import "public/fonts.css";
@import "animations.css";
@import "material.css";
@import "fonts.css";

/* The main parts of the HTML, but not the items */
header, body, footer {
Expand Down
4 changes: 2 additions & 2 deletions public/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<div class="centered" style="font-family: 'Noto Nastaliq Urdu', 'Roboto Light', sans-serif">
<a href="https://github.com/basshelal/Wudooh" target="_blank">By Bassam Helal بسّام هلال</a>
</div>
<script src="../dist/js/common.js"></script>
<script src="../dist/js/popup.js"></script>
<script src="js/common.js"></script>
<script src="js/popup.js"></script>
</body>
</html>
13 changes: 12 additions & 1 deletion src/background.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
importScripts("./common.js")
import {
DefaultWudoohStorage,
extensions,
MessageReasons,
runtime,
sync,
tabs,
WudoohKeys,
WudoohStorage
} from "./common"
/**
* This is the code that runs on the background page of the extension.
*
* Here we only run code that will execute when the extension is installed or updated.
*/

extensions()

/**
* Runs on install or update to check if the storage has initialized all its values correctly.
* If some key has not been initialized then it will create it and set it to its default value
Expand Down
Loading

0 comments on commit c367342

Please sign in to comment.