From ee5770b7fe335d980279bc91cb679ea68e365e6e Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Fri, 27 Jan 2017 18:32:25 -0500 Subject: [PATCH] Moved panel to API, removed minifying scripts, tidied up Makefile --- Makefile | 34 +++++++--------------------- dist.json | 6 ++--- includes/panel.swig | 3 +++ templates/upload.swig => includes/upload.php | 0 package.json | 9 ++------ templates/panel/index.swig | 13 ----------- 6 files changed, 16 insertions(+), 49 deletions(-) create mode 100644 includes/panel.swig rename templates/upload.swig => includes/upload.php (100%) delete mode 100644 templates/panel/index.swig diff --git a/Makefile b/Makefile index 78e5ae3..1cafe11 100644 --- a/Makefile +++ b/Makefile @@ -6,16 +6,16 @@ NPM="npm" DESTDIR="./dist" TMPDIR := $(shell mktemp -d) -all: builddirs npm-dependencies swig min-html min-css min-js copy-assets copy-includes +all: builddirs npm-dependencies swig copy-assets copy-includes builddirs: mkdir -p $(CURDIR)/build - mkdir -p $(CURDIR)/build/{assets,classes,includes,login,panel,register} + mkdir -p $(CURDIR)/build/{assets,classes,includes,login,register} mkdir -p $(CURDIR)/build/assets/{css,js,fonts,img,tools} installdirs: mkdir -p $(DESTDIR)/ - mkdir -p $(DESTDIR)/{assets,classes,includes,login,panel,register} + mkdir -p $(DESTDIR)/{assets,classes,includes,login,register} mkdir -p $(CURDIR)/build/assets/{css,js,fonts,img,tools} npm-dependencies: @@ -25,40 +25,22 @@ swig: $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/index.swig > $(CURDIR)/build/index.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/faq.swig > $(CURDIR)/build/faq.html $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/tools.swig > $(CURDIR)/build/tools.html + $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/panel.swig > $(CURDIR)/build/includes/panel.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/invite.swig > $(CURDIR)/build/includes/invite.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/report.swig > $(CURDIR)/build/includes/report.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/reports.swig > $(CURDIR)/build/includes/reports.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/search.swig > $(CURDIR)/build/includes/search.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/shimapan.swig > $(CURDIR)/build/includes/shimapan.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json includes/footer.swig > $(CURDIR)/build/includes/footer.php - $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/upload.swig > $(CURDIR)/build/upload.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/login/index.swig > $(CURDIR)/build/login/index.html - $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/panel/index.swig > $(CURDIR)/build/panel/index.php $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/register/index.swig > $(CURDIR)/build/register/index.html -min-html: - $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/index.php -o $(CURDIR)/build/index.php - $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/faq.html -o $(CURDIR)/build/faq.html - $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/tools.html -o $(CURDIR)/build/tools.html - $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/login/index.html -o $(CURDIR)/build/login/index.html - $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/register/index.html -o $(CURDIR)/build/register/index.html - -min-css: - $(NODE) $(CURDIR)/node_modules/.bin/cleancss --s0 $(CURDIR)/assets/css/shimapan.css > $(CURDIR)/build/assets/css/shimapan.min.css - $(NODE) $(CURDIR)/node_modules/.bin/cleancss --s0 $(CURDIR)/assets/css/shimapan-panel.css > $(CURDIR)/build/assets/css/shimapan-panel.min.css - $(NODE) $(CURDIR)/node_modules/.bin/cleancss --s0 $(CURDIR)/assets/css/bootstrap.css > $(CURDIR)/build/assets/css/bootstrap.min.css - -min-js: - $(NODE) $(CURDIR)/node_modules/.bin/uglifyjs --screw-ie8 ./assets/js/shimapan.js >> $(CURDIR)/build/assets/js/shimapan.min.js - $(NODE) $(CURDIR)/node_modules/.bin/uglifyjs --screw-ie8 ./assets/js/config.js >> $(CURDIR)/build/assets/js/config.min.js - copy-assets: - cp -vT $(CURDIR)/assets/js/bootstrap.min.js $(CURDIR)/build/assets/js/bootstrap.min.js - cp -vT $(CURDIR)/assets/js/skel.min.js $(CURDIR)/build/assets/js/skel.min.js - cp -vT $(CURDIR)/assets/js/jquery.min.js $(CURDIR)/build/assets/js/jquery.min.js + cp -rv $(CURDIR)/assets/js/* $(CURDIR)/build/assets/js/ + cp -rv $(CURDIR)/assets/css/* $(CURDIR)/build/assets/css/ cp -rv $(CURDIR)/assets/fonts/* $(CURDIR)/build/assets/fonts/ cp -rv $(CURDIR)/assets/img/* $(CURDIR)/build/assets/img/ - cp -rv $(CURDIR)/assets/tools/* $(CURDIR)/build/assets/tools + cp -rv $(CURDIR)/assets/tools/* $(CURDIR)/build/assets/tools/ copy-includes: cp -v $(CURDIR)/includes/*.php $(CURDIR)/build/includes/ @@ -79,4 +61,4 @@ install: installdirs cp -rv $(CURDIR)/build/* $(DESTDIR)/ uninstall: - rm -rvf $(DESTDIR)/ \ No newline at end of file + rm -rvf $(DESTDIR)/ diff --git a/dist.json b/dist.json index 7eb7a2c..20a3967 100644 --- a/dist.json +++ b/dist.json @@ -3,7 +3,7 @@ "allowErrors": false }, "dest": "dist", - "pkgVersion": "2.0.0", + "pkgVersion": "3.0.0", "src": [ "templates/faq.swig", "templates/footer.swig", @@ -31,8 +31,8 @@ "max_upload_size": 128, "production": false, "siteName": "Shimapan", - "siteUrl": "http://www.shimapan.rocks/", - "imgUrl": "http://i.shimapan.rocks/", + "siteUrl": "https://www.shimapan.rocks/", + "imgUrl": "https://i.shimapan.rocks/", "abuseContact": "abuse@shimapan.rocks", "infoContact": "info@shimapan.rocks", "paypalUrl": "", diff --git a/includes/panel.swig b/includes/panel.swig new file mode 100644 index 0000000..876b340 --- /dev/null +++ b/includes/panel.swig @@ -0,0 +1,3 @@ +{% include "header.swig" %} +

Welcome,

+{% include "footer.swig" %} diff --git a/templates/upload.swig b/includes/upload.php similarity index 100% rename from templates/upload.swig rename to includes/upload.php diff --git a/package.json b/package.json index fc7a31a..59483c1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shimapan", - "version": "2.0.0", - "description": "File Host", + "version": "3.0.0", + "description": "Shimapan Sharing Service", "homepage": "http://www.shimapan.rocks", "repository": { "type": "git", @@ -13,11 +13,6 @@ "url": "https://github.com/Foltik/shimapan/issues" }, "devDependencies": { - "clean-css": "^3.4.18", - "uglify-js": "^2.6.2", "swig": "^1.4.2" - }, - "dependencies": { - "htmlmin": "0.0.6" } } diff --git a/templates/panel/index.swig b/templates/panel/index.swig deleted file mode 100644 index 7b61f5f..0000000 --- a/templates/panel/index.swig +++ /dev/null @@ -1,13 +0,0 @@ -{% include "../../includes/locked.swig" %} -{% include "../../includes/header.swig" %} -

Welcome,

-prepare("SELECT apikey FROM accounts WHERE user = (:user)"); - $q->bindValue(':user', $_SESSION['user']); - $q->execute(); - $result = $q->fetch(); - echo 'Your API key is '.$result['apikey']; -?> -{% include "../../includes/footer.swig" %}