-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consult CHANGELOG.md for v0.0.8 Changes.
- Loading branch information
Diemen Design
committed
Dec 2, 2019
1 parent
5818e55
commit 1b80341
Showing
41 changed files
with
708 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v0.0.7 | ||
v0.0.8 |
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,12 @@ | |
* @author Dennis Suitters <[email protected]> | ||
* @copyright 2014-2019 Diemen Design | ||
* @license http://opensource.org/licenses/MIT MIT License | ||
* @version 0.0.4 | ||
* @version 0.0.8 | ||
* @link https://github.com/DiemenDesign/AuroraCMS | ||
* @notes This PHP Script is designed to be executed using PHP 7+ | ||
* @changes v0.0.4 Fix creation of Developer Account Insert SQL | ||
* @changes v0.0.4 Add processing Timezone. | ||
* @changes v0.0.8 Fix SQL error when creating Developer Account in Install. | ||
*/ | ||
echo'<script>'; | ||
$error=0; | ||
|
@@ -111,7 +112,7 @@ | |
$atimezone=isset($_POST['atimezone'])?filter_input(INPUT_POST,'atimezone',FILTER_SANITIZE_STRING):''; | ||
$prefix=$settings['database']['prefix']; | ||
$hash=password_hash($apassword,PASSWORD_DEFAULT); | ||
$sql=$db->prepare("INSERT INTO `".$prefix."login` (options,bio_options,username,password,email,name,language,timezone,ti,active,rank) VALUES ('11111111100000000000000000000000','11110000000000000000000000000000',:username,:password,:email,:name,'en-AU',:timezone,:ti,'1','1000')"); | ||
$sql=$db->prepare("INSERT IGNORE INTO `".$prefix."login` (options,bio_options,username,password,email,name,language,timezone,ti,active,rank) VALUES ('11111111100000000000000000000000','11110000000000000000000000000000',:username,:password,:email,:name,'en-AU',:timezone,:ti,'1','1000')"); | ||
$sql->execute([ | ||
':username'=>$ausername, | ||
':password'=>$hash, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
const waitUntil = ExtendableEvent.prototype.waitUntil; | ||
const respondWith = FetchEvent.prototype.respondWith; | ||
const promisesMap = new WeakMap(); | ||
|
||
ExtendableEvent.prototype.waitUntil = function(promise) { | ||
const extendableEvent = this; | ||
let promises = promisesMap.get(extendableEvent); | ||
|
||
if (promises) { | ||
promises.push(Promise.resolve(promise)); | ||
return; | ||
} | ||
|
||
promises = [Promise.resolve(promise)]; | ||
promisesMap.set(extendableEvent, promises); | ||
|
||
// call original method | ||
return waitUntil.call(extendableEvent, Promise.resolve().then(function processPromises() { | ||
const len = promises.length; | ||
|
||
// wait for all to settle | ||
return Promise.all(promises.map(p => p.catch(()=>{}))).then(() => { | ||
// have new items been added? If so, wait again | ||
if (promises.length != len) return processPromises(); | ||
// we're done! | ||
promisesMap.delete(extendableEvent); | ||
// reject if one of the promises rejected | ||
return Promise.all(promises); | ||
}); | ||
})); | ||
}; | ||
|
||
FetchEvent.prototype.respondWith = function(promise) { | ||
this.waitUntil(promise); | ||
return respondWith.call(this, promise); | ||
}; | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* AuroraCMS - Copyright (C) Diemen Design 2019 | ||
* | ||
* @category Administration - Preferences - Interface | ||
* @package core/js/service-worker.php | ||
* @author Dennis Suitters <[email protected]> | ||
* @copyright 2014-2019 Diemen Design | ||
* @license http://opensource.org/licenses/MIT MIT License | ||
* @version 0.0.8 | ||
* @link https://github.com/DiemenDesign/AuroraCMS | ||
* @notes This PHP Script is designed to be executed using PHP 7+ | ||
*/ | ||
header('Content-Type: application/javascript'); | ||
header('Service-Worker-Allowed:/'); | ||
$getcfg=true; | ||
require'../db.php'; | ||
$config=$db->query("SELECT * FROM config WHERE id='1'")->fetch(PDO::FETCH_ASSOC); | ||
if(!defined('DS'))define('DS',DIRECTORY_SEPARATOR); | ||
if(!defined('URL'))define('URL',PROTOCOL.$_SERVER['HTTP_HOST'].$settings['system']['url'].'/'); | ||
$html=file_get_contents('..'.DS.'layout'.DS.'offline.html'); | ||
$html=preg_replace([ | ||
'/<print url>/', | ||
'/<print seo=[\'\"]title[\'\"]?>/', | ||
'/<print background>/', | ||
'/<print logo>/' | ||
],[ | ||
URL, | ||
$config['business'].' - Administration - AuroraCMS', | ||
'data:'.mime_content_type('..'.DS.'images'.DS.'loginbg-dark.jpeg').';base64,'.base64_encode(file_get_contents('..'.DS.'images'.DS.'loginbg-dark.jpeg')), | ||
'data:'.mime_content_type('..'.DS.'images'.DS.'auroracms-white.svg').';base64,'.base64_encode(file_get_contents('..'.DS.'images'.DS.'auroracms-white.svg')) | ||
],$html); | ||
?> | ||
const CACHE="AuroraCMSv0-0-8"; | ||
const offlineFallbackPage=`<?php echo$html;?>`; | ||
const offlineFallbackPages=["/",]; | ||
|
||
self.addEventListener("install",function(event){ | ||
console.log("[AuroraCMS] Install Event processing"); | ||
event.waitUntil( | ||
caches.open(CACHE).then(function(cache){ | ||
console.log("[AuroraCMS] Cached offline page during install"); | ||
return cache.addAll(offlineFallbackPages); | ||
}) | ||
); | ||
}); | ||
|
||
self.addEventListener('fetch',event=>{ | ||
if(event.request.method!=="GET")return; | ||
event.respondWith( | ||
fetch(event.request).catch(()=>{ | ||
return new Response(offlineFallbackPage,{ | ||
headers:{'Content-Type':'text/html'} | ||
}); | ||
}) | ||
) | ||
}); | ||
|
||
self.addEventListener("refreshOffline",function(){ | ||
const offlinePageRequest=new Request(offlineFallbackPage); | ||
return fetch(offlineFallbackPage).then(function(response){ | ||
return caches.open(CACHE).then(function(cache){ | ||
console.log("[AuroraCMS] Offline page updated from refreshOffline event: "+response.url); | ||
return cache.put(offlinePageRequest,response); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
/** | ||
* AuroraCMS - Copyright (C) Diemen Design 2019 | ||
* | ||
* @category Administration - Preferences - Interface | ||
* @package core/js/service-worker.php | ||
* @author Dennis Suitters <[email protected]> | ||
* @copyright 2014-2019 Diemen Design | ||
* @license http://opensource.org/licenses/MIT MIT License | ||
* @version 0.0.8 | ||
* @link https://github.com/DiemenDesign/AuroraCMS | ||
* @notes This PHP Script is designed to be executed using PHP 7+ | ||
*/ | ||
header('Content-Type: application/javascript'); | ||
header('Service-Worker-Allowed:/'); | ||
$getcfg=true; | ||
require'../db.php'; | ||
$config=$db->query("SELECT * FROM config WHERE id='1'")->fetch(PDO::FETCH_ASSOC); | ||
if(!defined('DS'))define('DS',DIRECTORY_SEPARATOR); | ||
if(!defined('THEME'))define('THEME','..'.DS.'..'.DS.'layout'.DS.$config['theme']); | ||
if(!defined('URL'))define('URL',PROTOCOL.$_SERVER['HTTP_HOST'].$settings['system']['url'].'/'); | ||
$html=file_get_contents(THEME.DS."offline.html"); | ||
$html=preg_replace([ | ||
'/<print seo=[\'\"]?title[\'\"]?>/', | ||
'/<print css=[\'\"]?bootstrap[\'\"]?>/', | ||
'/<print css=[\'\"]?offline[\'\"]?>/', | ||
'/<print logo=[\'\"]?image[\'\"]?>/', | ||
'/<print logo=[\'\"]?alt[\'\"]?>/', | ||
'/<print config=[\'\"]?email[\'\"]?>/', | ||
'/<print config=[\'\"]?phone[\'\"]?>/', | ||
'/<print config=[\'\"]?mobile[\'\"]?>/', | ||
'/<print config=[\'\"]?address[\'\"]?>/' | ||
],[ | ||
($config['business']!=''?$config['business']:'AuroraCMS Offline'), | ||
file_get_contents(THEME.DS.'css'.DS.'bootstrap.min.css'), | ||
file_get_contents(THEME.DS.'css'.DS.'offline.css'), | ||
(file_exists(THEME.DS.'images'.DS.'offlinelogo.png')? | ||
'data:'.mime_content_type(THEME.DS.'images'.DS.'offlinelogo.png').';base64,'.base64_encode(file_get_contents(THEME.DS.'images'.DS.'offlinelogo.png')): | ||
'data:'.mime_content_type(THEME.DS.'images'.DS.'logo.png').';base64,'.base64_encode(file_get_contents(THEME.DS.'images'.DS.'logo.png'))), | ||
($config['business']!=''?$config['business']:'AuroraCMS Offline Logo'), | ||
($config['email']!=''?'Email: <a href="mailto:'.$config['email'].'">'.$config['email'].'</a>':''), | ||
($config['phone']!=''?'Phone: <a href="tel:'.$config['phone'].'">'.$config['phone'].'</a>':''), | ||
($config['mobile']!=''?'Mobile: <a href="tel:'.$config['mobile'].'">'.$config['mobile'].'</a>':''), | ||
($config['address']!=''?'Address: '.$config['address'].', '.$config['suburb'].', '.$config['state'].', '.$config['postcode'].', '.$config['country']:'') | ||
],$html);?> | ||
|
||
const CACHE="AuroraCMSv0-0-8"; | ||
const offlineFallbackPage=`<?php echo$html;?>`; | ||
const offlineFallbackPages=["/",]; | ||
|
||
self.addEventListener("install",function(event){ | ||
console.log("[AuroraCMS] Install Event processing"); | ||
event.waitUntil( | ||
caches.open(CACHE).then(function(cache){ | ||
console.log("[AuroraCMS] Cached offline page during install"); | ||
return cache.addAll(offlineFallbackPages); | ||
}) | ||
); | ||
}); | ||
|
||
self.addEventListener('fetch',event=>{ | ||
if(event.request.method!=="GET")return; | ||
event.respondWith( | ||
fetch(event.request).catch(()=>{ | ||
return new Response(offlineFallbackPage,{ | ||
headers:{'Content-Type':'text/html'} | ||
}); | ||
}) | ||
) | ||
}); | ||
|
||
self.addEventListener("refreshOffline",function(){ | ||
const offlinePageRequest=new Request(offlineFallbackPage); | ||
return fetch(offlineFallbackPage).then(function(response){ | ||
return caches.open(CACHE).then(function(cache){ | ||
console.log("[AuroraCMS] Offline page updated from refreshOffline event: "+response.url); | ||
return cache.put(offlinePageRequest,response); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.