commit 5caafc001bc8f7043da98cfabee0eb3c5e754d96 Author: OverPoweredDev Date: Sun Jun 27 17:44:07 2021 +0530 refactored a new directory lib to contain all library-ish scripts I got super annoyed having to import bootstrap from pop-up/, jQuery from background/ and hover from content/ in different files diff --git a/README.md b/README.md index 06fd8a3..f2c8a71 100644 --- a/README.md +++ b/README.md @@ -65,15 +65,16 @@ Check the [Edge Documentation](https://docs.microsoft.com/en-us/microsoft-edge/e ├── misc/... ├── src │   ├── assets/... -│   ├── background -│   │   ├── background.html/js +│   ├── lib +│   │   ├── bootstrap.min.css │   │   ├── jquery.min.js +│   │   ├── hover.js │   │   └── storage.js +│   ├── background +│   │   └── background.html/js │   ├── content -│   │   ├── content.js -│   │   └── hover.css/js +│   │   └── content.css/js │   ├── popup -│   │   ├── bootstrap.min.css │   │   ├── options.html/js │   │   └── popup.html/css/js │   ├── settings @@ -86,8 +87,13 @@ Check the [Edge Documentation](https://docs.microsoft.com/en-us/microsoft-edge/e │   └── README.md └── README.md ``` + +- **lib/** +All library-ish files i.e. those that contain only function definitions which are called from multiple places. jQuery and Bootstrap are well known, storage.js is meant for all functions that deal with localStorage, and hover for hover-translation related stuff. + + - **Background/** -background.js contains all background scripts such as the ContextMenu option, the script to redirect the user to the settings page on being installed and so on. storage.js is meant for all functions that deal with the two localStorage Objects, apertium.settings and apertium.langPairs. +background.js contains all background scripts such as the ContextMenu option, the script to redirect the user to the settings page on being installed and so on. - **Content/** diff --git a/src/background/background.html b/src/background/background.html index deab8b0..0dcad30 100644 --- a/src/background/background.html +++ b/src/background/background.html @@ -1,8 +1,8 @@ - - + + \ No newline at end of file diff --git a/src/content/hover.css b/src/content/content.css similarity index 100% rename from src/content/hover.css rename to src/content/content.css diff --git a/src/popup/bootstrap.min.css b/src/lib/bootstrap.min.css similarity index 100% rename from src/popup/bootstrap.min.css rename to src/lib/bootstrap.min.css diff --git a/src/content/hover.js b/src/lib/hover.js similarity index 100% rename from src/content/hover.js rename to src/lib/hover.js diff --git a/src/background/jquery.min.js b/src/lib/jquery.min.js similarity index 100% rename from src/background/jquery.min.js rename to src/lib/jquery.min.js diff --git a/src/background/storage.js b/src/lib/storage.js similarity index 100% rename from src/background/storage.js rename to src/lib/storage.js diff --git a/src/manifest.json b/src/manifest.json index cd4060b..fdc2622 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -33,12 +33,12 @@ ], "all_frames": true, "js": [ - "background/jquery.min.js", - "content/hover.js", - "background/storage.js", + "lib/jquery.min.js", + "lib/hover.js", + "lib/storage.js", "content/content.js" ], - "css": ["content/hover.css"] + "css": ["content/content.css"] } ], "permissions": [ diff --git a/src/popup/options.html b/src/popup/options.html index e21ef85..b4dbd01 100644 --- a/src/popup/options.html +++ b/src/popup/options.html @@ -3,11 +3,11 @@ Apertium - - + + - +