diff --git a/brain/utility/Setup.php b/brain/utility/Setup.php index 9d4cf1a..afa9a20 100644 --- a/brain/utility/Setup.php +++ b/brain/utility/Setup.php @@ -17,7 +17,7 @@ class SetUp public static function init($body) { - //grab template files + //grab template files $newFolks = json_decode( file_get_contents("../config/init/folks-template.json"), true @@ -26,15 +26,15 @@ class SetUp file_get_contents("../config/init/settings-template.json"), true ); - //get form values - //$body = $request->getParsedBody(); + //get form values + //$body = $request->getParsedBody(); $handle = $body["new_member_handle"]; $email = $body["new_member_email"]; $pass = $body["new_member_pass"]; $title = $body["new_member_title"]; $now = new \Moment\Moment(); - //setup folks config + //setup folks config $hash = password_hash($pass, PASSWORD_DEFAULT); $newFolks[0]["id"] = 0; $newFolks[0]["handle"] = $handle; @@ -45,17 +45,18 @@ class SetUp $newFolks[0]["role"] = "hnic"; $newFolks[0]["created"] = $now->format("Y-m-d\TH:i:sP"); $newFolks[0]["updated"] = $now->format("Y-m-d\TH:i:sP"); - //set up settings config + //set up settings config $newSettings["global"]["title"] = $title; - //create index file - //$rightNow = $now->format("Y-m-d\TH:i:sP"); - //var_dump($now->format("Y-m-d\TH:i:sP")); + //create index file + //$rightNow = $now->format("Y-m-d\TH:i:sP"); + //var_dump($now->format("Y-m-d\TH:i:sP")); $index = [ "id" => 1, "uuid" => StringTools::createUUID(), "title" => "FIRST!", "feature" => "/assets/images/global/default-bg.jpg", + "files" => "", "path" => "content/pages/start", "layout" => "index", "tags" => "start, welcome", @@ -73,7 +74,7 @@ class SetUp $freshIndex = DocTools::objectToMD($index); - //once all files created, write down + //once all files created, write down DocTools::writeSettings("../config/settings.json", $newSettings); DocTools::writeSettings("../config/folks.json", $newFolks); @@ -85,7 +86,7 @@ class SetUp $freshIndex ); - //if there is an older session file, get rid of it + //if there is an older session file, get rid of it if (is_file("../content/.session")) { unlink("../content/.session"); } @@ -108,16 +109,16 @@ class SetUp $size = $file->getSize(); $name = $file->getClientFileName(); - //park it so it can be read + //park it so it can be read $file->moveTo("../content" . "/" . $name); - //open it and get files to verify user + //open it and get files to verify user $zip = new ZipArchive(); if ($zip->open("../content" . "/" . $name) === true) { $folks = json_decode($zip->getFromName("settings/folks.json"), true); $found = find($folks, ["handle" => $body["restore_member_handle"]]); - //if member is found in back up, check pass + //if member is found in back up, check pass if ($found) { if (password_verify($body["restore_member_pass"], $found["password"])) { //backup verified, restore site @@ -144,25 +145,25 @@ class SetUp file_get_contents("../content/settings/settings.json"), true ); - //check for key, add if not there + //check for key, add if not there if (!isset($newConfig["global"]["externalAPI"])) { $newConfig["global"]["externalAPI"] = "false"; } - //write new config file - DocTools::writeSettings("../config/settings.json", $newConfig); + //write new config file + DocTools::writeSettings("../config/settings.json", $newConfig); - //rename("../content/settings/folks.json", "../config/folks.json"); - DocTools::writeSettings("../config/folks.json", $newFolks); + //rename("../content/settings/folks.json", "../config/folks.json"); + DocTools::writeSettings("../config/folks.json", $newFolks); - rename("../content/settings/tags.json", "../config/tags.json"); + rename("../content/settings/tags.json", "../config/tags.json"); - //images path for blog and user - $blogImagePath = "../public/assets/images/blog"; - $userImagePath = "../public/assets/images/user"; + //images path for blog and user + $blogImagePath = "../public/assets/images/blog"; + $userImagePath = "../public/assets/images/user"; - //check to see if image dirs are empty, if not chill + //check to see if image dirs are empty, if not chill if ($globs = glob($blogImagePath . "/*")) { - //directory not empty, relax + //directory not empty, relax } else { rename("../content/public/assets/images/blog", $blogImagePath); } @@ -175,22 +176,22 @@ class SetUp rename("../content/content/pages/", "../content/pages"); - //legacy check for old file structure + //legacy check for old file structure if (is_file("../content/pages/index.md")) { if (!is_dir("../content/pages/start")) { - //Directory does not exist, so lets create it. + //Directory does not exist, so lets create it. mkdir("../content/pages/start", 0755, true); - //move start page to appropriate spot + //move start page to appropriate spot rename( "../content/pages/index.md", "../content/pages/start/index.md" ); } } else { - //chill + //chill } - //clean up + //clean up DocTools::deleteFolder("../content/settings"); DocTools::deleteFolder("../content/public"); @@ -214,7 +215,7 @@ class SetUp $zip->close(); $zipPath = "../content/" . $name; - //trash zip when done + //trash zip when done unlink($zipPath); } else { $result = [ diff --git a/brain/views/dash/init.twig b/brain/views/dash/init.twig index fcae15e..121f8e6 100644 --- a/brain/views/dash/init.twig +++ b/brain/views/dash/init.twig @@ -12,7 +12,7 @@
-
+ @@ -26,7 +26,7 @@
- +
@@ -44,5 +44,5 @@ {% endblock %} {% block javascripts %} - + {% endblock %} \ No newline at end of file diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index cda5f3b..72413a9 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -1,2 +1,8528 @@ -(()=>{class t{constructor(){this.start()}start(){console.log("Connected like F.E.")}}document.addEventListener("DOMContentLoaded",(function(){new t}),!1)})(); +// modules are defined as an array +// [ module function, map of requires ] +// +// map of requires is short require name -> numeric require +// +// anything defined in a previous bundle is accessed via the +// orig method which is the require for previous bundles + +(function (modules, entry, mainEntry, parcelRequireName, globalName) { + /* eslint-disable no-undef */ + var globalObject = + typeof globalThis !== 'undefined' + ? globalThis + : typeof self !== 'undefined' + ? self + : typeof window !== 'undefined' + ? window + : typeof global !== 'undefined' + ? global + : {}; + /* eslint-enable no-undef */ + + // Save the require from previous bundle to this closure if any + var previousRequire = + typeof globalObject[parcelRequireName] === 'function' && + globalObject[parcelRequireName]; + + var cache = previousRequire.cache || {}; + // Do not use `require` to prevent Webpack from trying to bundle this call + var nodeRequire = + typeof module !== 'undefined' && + typeof module.require === 'function' && + module.require.bind(module); + + function newRequire(name, jumped) { + if (!cache[name]) { + if (!modules[name]) { + // if we cannot find the module within our internal map or + // cache jump to the current global require ie. the last bundle + // that was added to the page. + var currentRequire = + typeof globalObject[parcelRequireName] === 'function' && + globalObject[parcelRequireName]; + if (!jumped && currentRequire) { + return currentRequire(name, true); + } + + // If there are other bundles on this page the require from the + // previous one is saved to 'previousRequire'. Repeat this as + // many times as there are bundles until the module is found or + // we exhaust the require chain. + if (previousRequire) { + return previousRequire(name, true); + } + + // Try the node require function if it exists. + if (nodeRequire && typeof name === 'string') { + return nodeRequire(name); + } + + var err = new Error("Cannot find module '" + name + "'"); + err.code = 'MODULE_NOT_FOUND'; + throw err; + } + + localRequire.resolve = resolve; + localRequire.cache = {}; + + var module = (cache[name] = new newRequire.Module(name)); + + modules[name][0].call( + module.exports, + localRequire, + module, + module.exports, + this + ); + } + + return cache[name].exports; + + function localRequire(x) { + return newRequire(localRequire.resolve(x)); + } + + function resolve(x) { + return modules[name][1][x] || x; + } + } + + function Module(moduleName) { + this.id = moduleName; + this.bundle = newRequire; + this.exports = {}; + } + + newRequire.isParcelRequire = true; + newRequire.Module = Module; + newRequire.modules = modules; + newRequire.cache = cache; + newRequire.parent = previousRequire; + newRequire.register = function (id, exports) { + modules[id] = [ + function (require, module) { + module.exports = exports; + }, + {}, + ]; + }; + + Object.defineProperty(newRequire, 'root', { + get: function () { + return globalObject[parcelRequireName]; + }, + }); + + globalObject[parcelRequireName] = newRequire; + + for (var i = 0; i < entry.length; i++) { + newRequire(entry[i]); + } + + if (mainEntry) { + // Expose entry point to Node, AMD or browser globals + // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js + var mainExports = newRequire(mainEntry); + + // CommonJS + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = mainExports; + + // RequireJS + } else if (typeof define === 'function' && define.amd) { + define(function () { + return mainExports; + }); + + //