diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.gitignore b/.gitignore index 9bc33e0..fb931a2 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,4 @@ vendor/canary/logs/* components/* mailhog.log uploads/* -images/qr-codes/ +images/qr-codes/* diff --git a/app/js/main.js b/app/js/main.js index 160b06e..95869a2 100644 --- a/app/js/main.js +++ b/app/js/main.js @@ -8,25 +8,48 @@ * @link https://TheTempusProject.com * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ +/** + * Progressive Web-App + **/ let deferredPrompt; const installPrompt = document.getElementById("install-prompt"); +const chromeMessage = document.getElementById("chrome-install-message"); +const iosMessage = document.getElementById("ios-install-message"); const installButton = document.getElementById("install-button"); const dismissButton = document.querySelector("#install-prompt .btn-close"); // Check if the user previously dismissed the prompt -if (!localStorage.getItem("pwaInstallDismissed")) { +if ( ! localStorage.getItem("pwaInstallDismissed") ) { window.addEventListener("beforeinstallprompt", (event) => { event.preventDefault(); deferredPrompt = event; installPrompt.classList.remove("d-none"); - installPrompt.classList.add("d-block"); // Show the prompt + installPrompt.classList.add("d-block"); // Show the alert + chromeMessage.classList.remove("d-none"); + chromeMessage.classList.add("d-block"); // Show the prompt }); + + if ( isIos() && ! isInStandaloneMode() ) { + installPrompt.classList.remove("d-none"); + installPrompt.classList.add("d-block"); // Show the alert + iosMessage.classList.remove("d-none"); + iosMessage.classList.add("d-block"); // Show the prompt + } } +// ios REQUIRES a service worker +if ( 'serviceWorker' in navigator ) { + navigator.serviceWorker.register('app/js/sw.js') + .then(() => console.log('Service Worker Registered')); +} +// self.addEventListener('install', () => self.skipWaiting()); +// self.addEventListener('activate', () => self.clients.claim()); +// self.addEventListener('fetch', () => {}); // No file interception + // Handle Install Button Click if ( installButton ) { installButton.addEventListener("click", async () => { - if (deferredPrompt) { + if ( deferredPrompt ) { deferredPrompt.prompt(); const { outcome } = await deferredPrompt.userChoice; @@ -65,6 +88,14 @@ if (localStorage.getItem("pwaInstallDismissed")) { } } +function isIos() { + return /iphone|ipad|ipod/i.test(navigator.userAgent); +} + +function isInStandaloneMode() { + return window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone; +} + /** * Automatically selects/de-selects all check boxes associated with that field **/ diff --git a/app/js/sw.js b/app/js/sw.js new file mode 100644 index 0000000..89c3448 --- /dev/null +++ b/app/js/sw.js @@ -0,0 +1 @@ +self.addEventListener('fetch', () => {}); \ No newline at end of file diff --git a/app/models/sessions.php b/app/models/sessions.php index 2070dde..df5f2b2 100644 --- a/app/models/sessions.php +++ b/app/models/sessions.php @@ -59,7 +59,7 @@ class Sessions extends DatabaseModel { public function checkSession( $sessionID ) { $user = new User; // @todo lets put this on some sort of realistic checking regime other than check everything every time - if ( $sessionID == false ) { + if ( empty( $sessionID ) ) { Debug::log( 'sessionID false' ); return false; } diff --git a/app/templates/default/default.tpl b/app/templates/default/default.tpl index 0e9aa7a..24e5a02 100644 --- a/app/templates/default/default.tpl +++ b/app/templates/default/default.tpl @@ -28,7 +28,12 @@ {AUTHOR} {ROBOT} + + + + + diff --git a/app/views/faq.html b/app/views/faq.html index 956f2b6..b914758 100644 --- a/app/views/faq.html +++ b/app/views/faq.html @@ -56,8 +56,8 @@
- {SITENAME} is open source and available free of charge through GitLab and Packagist. - The developer behind the project is Joey Kimsey and he can be contacted through his website for development services. + {SITENAME} is open source and available free of charge through GitLab and Packagist. + The developer behind the project is Joey Kimsey and he can be contacted through his website for development services.
diff --git a/app/views/pwa.html b/app/views/pwa.html index 200ae97..45bfae8 100644 --- a/app/views/pwa.html +++ b/app/views/pwa.html @@ -1,11 +1,18 @@
-
\ No newline at end of file diff --git a/composer.lock b/composer.lock index d520825..8bc84cf 100644 --- a/composer.lock +++ b/composer.lock @@ -244,9 +244,9 @@ }, "require": { "php": ">=8.1.0", - "thetempusproject/canary": "1.0.6", - "thetempusproject/hermes": "1.0.3", - "thetempusproject/houdini": "2.0.2" + "thetempusproject/canary": "1.0.9", + "thetempusproject/hermes": "1.0.5", + "thetempusproject/houdini": "2.0.5" }, "type": "library", "autoload": { @@ -272,20 +272,22 @@ } ], "description": "Bedrock is intended as the core functionality used by The Tempus Project: a rapid prototyping framework. This library utilizes the MVC architecture in addition to a custom templating engine designed to make building web applications simple.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/bedrock", + "homepage": "https://thetempusproject.com/libraries/bedrock", "keywords": [ "framework", - "mvc" + "mvc", + "php", + "thetempusproject" ], "time": "2025-02-06T03:02:46+00:00" }, { "name": "thetempusproject/canary", - "version": "1.0.6", + "version": "1.0.9", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/canary", - "reference": "44b2ad688cff933964ec2ff50b408d94c7f51e40" + "reference": "77cef522e9919573836901eb82b59b20f453fb61" }, "require": { "php": ">=8.1.0" @@ -313,22 +315,23 @@ } ], "description": "Functionality for tracking, logging, and sending log messages to chrome for debugging.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/canary", + "homepage": "https://thetempusproject.com/libraries/canary", "keywords": [ "debugging", + "logging", "php", "thetempusproject", "tools" ], - "time": "2025-01-22T01:39:34+00:00" + "time": "2025-02-04T12:16:29+00:00" }, { "name": "thetempusproject/hermes", - "version": "1.0.3", + "version": "1.0.5", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/hermes", - "reference": "4b4e06a98f0f01695bda18de240bb3294d096ef4" + "reference": "802581b1d2d70877ccc75d8954b33efcc05d9371" }, "require": { "php": ">=8.1.0" @@ -355,28 +358,29 @@ "role": "Lead Developer" } ], - "description": "Php functions that aid in routing and redirecting; requests and responses.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/hermes", + "description": "This library handles redirects, provides a common backbone for routing, and can handle autoloading in cases where composer is unavailable.", + "homepage": "https://thetempusproject.com/libraries/hermes", "keywords": [ + "autoloader", "php", "routing", "thetempusproject", "tools" ], - "time": "2025-01-22T01:43:15+00:00" + "time": "2025-02-02T23:22:15+00:00" }, { "name": "thetempusproject/houdini", - "version": "2.0.2", + "version": "2.0.5", "source": { "type": "git", "url": "https://git.thetempusproject.com/the-tempus-project/houdini", - "reference": "fb027a4ebc327e709ad3da29a4cf112894c2b7e6" + "reference": "2c7538471ab1f900048ccdb2c71d6bf2bee975e0" }, "require": { "php": ">=8.1.0", - "thetempusproject/canary": "1.0.6", - "thetempusproject/hermes": "1.0.3" + "thetempusproject/canary": "1.0.9", + "thetempusproject/hermes": "1.0.5" }, "type": "library", "autoload": { @@ -399,15 +403,15 @@ "role": "Lead Developer" } ], - "description": "Php functions that aid in creating, managing, and displaying frontend components.", - "homepage": "https://git.thetempusproject.com/the-tempus-project/houdini", + "description": "This library handles creating, managing, and displaying frontend components.", + "homepage": "https://thetempusproject.com/libraries/houdini", "keywords": [ "frontend", "php", "thetempusproject", "tools" ], - "time": "2025-01-27T05:02:14+00:00" + "time": "2025-02-04T12:19:25+00:00" }, { "name": "twbs/bootstrap", @@ -463,10 +467,10 @@ "packages-dev": [], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" } diff --git a/images/apple-touch-icon.png b/images/apple-touch-icon.png new file mode 100644 index 0000000..213fa01 Binary files /dev/null and b/images/apple-touch-icon.png differ diff --git a/images/share-icon.png b/images/share-icon.png new file mode 100644 index 0000000..a731a1e Binary files /dev/null and b/images/share-icon.png differ