forked from projects/fipamo
removed service workers, removed a ton of legacy code
This commit is contained in:
parent
3c410eb1b7
commit
3845ca9552
39 changed files with 55 additions and 2303 deletions
|
@ -1,168 +0,0 @@
|
|||
import StringUtils from '../../tools/utilities/StringUtils';
|
||||
import RightsManager, {
|
||||
|
||||
TASK_CREATE,
|
||||
TASK_UPDATE,
|
||||
TASK_READ,
|
||||
TASK_DELETE,
|
||||
OBJECT_CLIENT_ADMIN,
|
||||
OBJECT_CLIENT_USER,
|
||||
OBJECT_PROJECT_CLIENT,
|
||||
OBJECT_PROJECT_FOLIO,
|
||||
OBJECT_BOOKMARK,
|
||||
OBJECT_POST
|
||||
|
||||
} from '../../tools/utilities/RightsManager';
|
||||
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var Models = require('../../models');
|
||||
|
||||
var Models = require('../../models');
|
||||
const scrape = require('scrape-metadata')
|
||||
|
||||
/*
|
||||
|
||||
|
||||
Get Bookmark Listzz
|
||||
|
||||
*/
|
||||
|
||||
router.get('/archive', function (req, res, next) {
|
||||
BMArchive.find()
|
||||
.then((bookmarks) => {
|
||||
console.log(bookmarks[1])
|
||||
res.json(bookmarks)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
|
||||
Get Bookmark List
|
||||
|
||||
*/
|
||||
router.get('/', function (req, res, next) {
|
||||
Bookmark.find().sort({
|
||||
created: -1
|
||||
})
|
||||
.then((bookmarks) => {
|
||||
res.json(bookmarks)
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Get Bookmark by ID
|
||||
|
||||
*/
|
||||
router.get('/:id', function (req, res, next) {
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Create New BookMark
|
||||
|
||||
*/
|
||||
router.post('/add', function (req, res, next) {
|
||||
if (!req.session.user)
|
||||
return res.json({
|
||||
message: "You need to be logged in, champ."
|
||||
});
|
||||
|
||||
var link = req.body.url;
|
||||
Models.User.findById(req.session.user.id).then((user) => {
|
||||
if (rightsManager.check(user.role, OBJECT_BOOKMARK, TASK_CREATE)) {
|
||||
scrape(link, (err, meta) => {
|
||||
var urlPieces = link.split("/");
|
||||
Models.Bookmark.sync().then(f => {
|
||||
Models.Bookmark.create({
|
||||
source: urlPieces[0] + urlPieces[1] + '//' + urlPieces[2],
|
||||
url: link,
|
||||
image: meta.ogImage,
|
||||
title: meta.title,
|
||||
author: user.id,
|
||||
listed: true
|
||||
}).then(saved => {
|
||||
|
||||
res.json({
|
||||
message: "link added"
|
||||
});
|
||||
}).catch(err => {
|
||||
res.json({
|
||||
message: "post error",
|
||||
error: err
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Update Bookmark by ID
|
||||
|
||||
*/
|
||||
router.post('/update/:id', function (req, res, next) {
|
||||
if (!req.session.user)
|
||||
return res.json({
|
||||
message: "You need to be logged in, champ."
|
||||
});
|
||||
console.log("ID: "+req.params.id);
|
||||
let title = req.body.title;
|
||||
let tags = req.body.tags;
|
||||
let image = req.body.image;
|
||||
|
||||
Models.User.findById(req.session.user.id).then((user) => {
|
||||
if (rightsManager.check(user.role, OBJECT_BOOKMARK, TASK_UPDATE)) {
|
||||
Models.Bookmark.findOne({
|
||||
where: {
|
||||
id: req.params.id
|
||||
}
|
||||
}).then(saved => {
|
||||
console.log('SAVED: '+req.body.title);
|
||||
saved.update({
|
||||
title: title,
|
||||
image: image
|
||||
}).then(updated => {
|
||||
res.json({
|
||||
message: "bookmark updated"
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
/*
|
||||
|
||||
Delete Bookmark by ID
|
||||
|
||||
*/
|
||||
router.delete('/:id', function (req, res, next) {
|
||||
|
||||
});
|
||||
module.exports = router;
|
|
@ -1,235 +0,0 @@
|
|||
|
||||
import DateUtils from '../../tools/utilities/DateUtils';
|
||||
import RightsManager, {
|
||||
|
||||
TASK_CREATE,
|
||||
TASK_UPDATE,
|
||||
TASK_READ,
|
||||
TASK_DELETE,
|
||||
OBJECT_CLIENT_ADMIN,
|
||||
OBJECT_CLIENT_USER,
|
||||
OBJECT_PROJECT_CLIENT,
|
||||
OBJECT_PROJECT_FOLIO,
|
||||
OBJECT_BOOKMARK,
|
||||
OBJECT_POST
|
||||
|
||||
} from '../../tools/utilities/RightsManager';
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var multer = require('multer');
|
||||
var fs = require('fs-extra');
|
||||
var Models = require('../../models');
|
||||
var User = require('../../models/User.js');
|
||||
|
||||
const dateUtil = new DateUtils()
|
||||
var uploadPath = "./content/folio-images/" + dateUtil.getDate('year', new Date()) + "/" + dateUtil.getDate('month', new Date());
|
||||
fs.ensureDir(uploadPath, function (err) {
|
||||
//console.log(err) // => null
|
||||
// dir has now been created, including the directory it is to be placed in
|
||||
})
|
||||
var storage = multer.diskStorage({
|
||||
destination: function (req, file, cb) {
|
||||
cb(null, uploadPath)
|
||||
},
|
||||
filename: function (req, file, cb) {
|
||||
var splice = file.originalname.split(':');
|
||||
cb(null, splice[0]);
|
||||
}
|
||||
});
|
||||
var upload = multer({
|
||||
storage: storage
|
||||
}).array('folioImages');
|
||||
/*
|
||||
|
||||
Create New Folio Project
|
||||
|
||||
*/
|
||||
router.post('/add', function (req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({
|
||||
message: "You need to be logged in, champ."
|
||||
})
|
||||
User.findById(req.user._id).then((user) => {
|
||||
upload(req, res, function (err) {
|
||||
if (err) {
|
||||
//console.log('Error in Saving Entry: ' + err);
|
||||
res.json({
|
||||
message: err
|
||||
});
|
||||
throw err;
|
||||
} else {
|
||||
if (RightsManager.check(user.role, [RightsManager.OBJECT_PROJECT_FOLIO], RightsManager.TASK_CREATE)) {
|
||||
var project = new Project(req.body);
|
||||
if (req.files != "") {
|
||||
project.images = req.files;
|
||||
} else {
|
||||
console.log("NOTHING TO SAVE");
|
||||
}
|
||||
project.save().then((project) => {
|
||||
res.json({
|
||||
message: "new client project added"
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
});
|
||||
/*
|
||||
|
||||
Get Folio Project List
|
||||
|
||||
*/
|
||||
router.get('/', function (req, res, next) {
|
||||
Project.find({}).then((projects) => {
|
||||
var folioArray = [];
|
||||
for (var i = 0; i < projects.length; i++) {
|
||||
var imgURL = null;
|
||||
if (projects[i].images.length != 0)
|
||||
imgURL = String(projects[i].images[0].path).substring(8, String(projects[i].images[0].path).length);
|
||||
var folioItem = {
|
||||
id: projects[i]._id,
|
||||
title: projects[i].title,
|
||||
url: projects[i].url,
|
||||
tools: projects[i].tools,
|
||||
description: projects[i].description,
|
||||
type: projects[i].type,
|
||||
img_url: imgURL,
|
||||
img_full_url: "http://formless.local/" + imgURL
|
||||
}
|
||||
folioArray[i] = folioItem;
|
||||
}
|
||||
res.json(folioArray);
|
||||
})
|
||||
});
|
||||
/*
|
||||
|
||||
Get Folio Project by ID
|
||||
|
||||
*/
|
||||
router.get('/:id', function (req, res, next) {
|
||||
Project.findById(req.params.id).then((project) => {
|
||||
res.json(project);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
});
|
||||
/*
|
||||
|
||||
Update Folio Project by ID
|
||||
|
||||
*/
|
||||
router.post('/update/:id', function (req, res, next) {
|
||||
if (!req.session.user)
|
||||
return res.json({
|
||||
message: "You need to be logged in, champ."
|
||||
});
|
||||
Models.User.findById(req.session.user.id).then((user) => {
|
||||
if (RightsManager.check(user.role, [RightsManager.OBJECT_PROJECT_FOLIO], RightsManager.TASK_UPDATE)) {
|
||||
upload(req, res, function (err) {
|
||||
if (err) {
|
||||
//console.log('Error in Saving Entry: ' + err);
|
||||
res.json({
|
||||
message: err
|
||||
});
|
||||
throw err;
|
||||
} else {
|
||||
Models.FolioProject.findOne({where:{id: req.params.id}}).then((project) => {
|
||||
if (req.files != "") {
|
||||
project.images = req.files;
|
||||
} else {
|
||||
console.log("NOTHING TO SAVE");
|
||||
}
|
||||
|
||||
console.log(req.body);
|
||||
|
||||
project.update(req.body).then(updated => {
|
||||
res.json({
|
||||
message: "project updated"
|
||||
});
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
|
||||
/**
|
||||
project.save().then((saved) => {
|
||||
res.json({
|
||||
message: "project updated"
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
**/
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
/*
|
||||
|
||||
Delete Folio Project by ID
|
||||
|
||||
*/
|
||||
router.delete('/:id', function (req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({
|
||||
message: "users only, yo. you're not that"
|
||||
});
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if (RightsManager.check(user.role, [RightsManager.OBJECT_PROJECT_FOLIO], RightsManager.TASK_DELETE)) {
|
||||
Project.findByIdAndRemove(req.params.id).then((project) => {
|
||||
res.json({
|
||||
message: 'project has been removed'
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
router.post('/sort', function (req, res, next) {
|
||||
var sortList = req.body;
|
||||
var self = this;
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if (RightsManager.check(user.role, [RightsManager.OBJECT_PROJECT_FOLIO], RightsManager.TASK_UPDATE)) {
|
||||
var clean = true;
|
||||
for (var i = 0; i < sortList.length; i++) {
|
||||
Project.findByIdAndUpdate(sortList[i].sortID, {
|
||||
sortIndex: sortList[i].sortIndex
|
||||
}).then((project) => {
|
||||
//console.log("SORTED")
|
||||
//res.json({message: "sorted"})
|
||||
}).catch((err) => {
|
||||
//res.json({message: "sorted", error:err})
|
||||
})
|
||||
//res.json({message:'projects updated'})
|
||||
}
|
||||
} else {
|
||||
res.json({
|
||||
message: "Nah. You can't do that. Talk to the admin, sport."
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = router;
|
|
@ -72,7 +72,7 @@ router.post("/sync", (req, res, next) =>
|
|||
{
|
||||
[Op.contains]:
|
||||
{
|
||||
slug: item.post.slug
|
||||
uuid: item.post.uuid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ router.post("/sync", (req, res, next) =>
|
|||
{
|
||||
html: true,
|
||||
xhtmlOut: true,
|
||||
})
|
||||
});
|
||||
if (!_.isEqual(item.post, found.post))
|
||||
{
|
||||
found.update(item).then(updated =>
|
||||
|
@ -111,6 +111,7 @@ router.post("/sync", (req, res, next) =>
|
|||
}
|
||||
}).catch(err =>
|
||||
{
|
||||
//console.log("***ERRRORZ****", err);
|
||||
Models.FreshPost.create(item).then(fresh =>
|
||||
{
|
||||
//console.log(fresh)
|
||||
|
|
|
@ -1,180 +0,0 @@
|
|||
import RightsManager, {
|
||||
|
||||
TASK_CREATE,
|
||||
TASK_UPDATE,
|
||||
TASK_READ,
|
||||
TASK_DELETE,
|
||||
OBJECT_CLIENT_ADMIN,
|
||||
OBJECT_CLIENT_USER,
|
||||
OBJECT_PROJECT_CLIENT,
|
||||
OBJECT_PROJECT_FOLIO,
|
||||
OBJECT_BOOKMARK,
|
||||
OBJECT_POST
|
||||
|
||||
} from '../../tools/utilities/RightsManager';
|
||||
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var multer = require('multer');
|
||||
var fs = require('fs-extra');
|
||||
var Models = require('../../models');
|
||||
var User = require('../../models/User.js');
|
||||
var uploadPath = "./content/client-images/";
|
||||
fs.ensureDir(uploadPath, function(err) {
|
||||
//console.log(err) // => null
|
||||
// dir has now been created, including the directory it is to be placed in
|
||||
})
|
||||
var storage = multer.diskStorage({
|
||||
destination: function(req, file, cb) {
|
||||
cb(null, uploadPath)
|
||||
},
|
||||
filename: function(req, file, cb) {
|
||||
var splice = file.originalname.split(':');
|
||||
cb(null, splice[0]);
|
||||
}
|
||||
});
|
||||
var upload = multer({storage: storage}).array('projectImages');
|
||||
var rightsManager = new RightsManager();
|
||||
/*
|
||||
|
||||
Create New Client Project
|
||||
|
||||
*/
|
||||
router.post('/add', function(req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({message: "You need to be logged in, champ."})
|
||||
User.findById(req.user._id).then((user) => {
|
||||
upload(req, res, function(err) {
|
||||
if (err) {
|
||||
//console.log('Error in Saving Entry: ' + err);
|
||||
res.json({message: err});
|
||||
throw err;
|
||||
} else {
|
||||
if (rightsManager.check(user.role, OBJECT_PROJECT_FOLIO, TASK_CREATE)) {
|
||||
var project = new Project(req.body);
|
||||
project.owner = user._id;
|
||||
project.user = [];
|
||||
project.comments = [];
|
||||
project.tasks = [];
|
||||
project.created = new Date().getTime();
|
||||
project.edited = new Date().getTime();
|
||||
if (req.files != "") {
|
||||
project.images = req.files;
|
||||
} else {
|
||||
console.log("NOTHING TO SAVE");
|
||||
}
|
||||
project.save().then((project) => {
|
||||
res.json({message: "new client project added"});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
} else {
|
||||
res.json({message: "Nah. You can't do that. Talk to the admin, sport."});
|
||||
}
|
||||
}
|
||||
});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
});
|
||||
/*
|
||||
|
||||
Get Client Project List
|
||||
|
||||
*/
|
||||
router.get('/', function(req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({message: "You need to be logged in, champ."})
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if ( rightsManager.check(user.role, OBJECT_POST, TASK_READ )) {
|
||||
Project.find({}).then((projects) => {
|
||||
res.json(projects);
|
||||
}).then((users) => {
|
||||
//res.json({message: "got user list"});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
} else {
|
||||
res.json({message: "Nah. You can't do that. Talk to the admin, sport."});
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
});
|
||||
/*
|
||||
|
||||
Get Client Project by ID
|
||||
|
||||
*/
|
||||
router.get('/:id', function(req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({message: "You need to be logged in, champ."});
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if (RightsManager.check(user.role, [RightsManager.OBJECT_PROJECT_CLIENT], RightsManager.TASK_READ)) {
|
||||
Project.findById(req.params.id).then((project) => {
|
||||
res.json(project);
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
/*
|
||||
|
||||
Update Client Project by ID
|
||||
|
||||
*/
|
||||
router.post('/update/:id', function(req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({message: "You need to be logged in, champ."});
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if ( rightsManager.check(user.role, OBJECT_POST, TASK_UPDATE) ) {
|
||||
upload(req, res, function(err) {
|
||||
if (err) {
|
||||
//console.log('Error in Saving Entry: ' + err);
|
||||
res.json({message: err});
|
||||
throw err;
|
||||
} else {
|
||||
Project.findByIdAndUpdate(req.params.id, req.body).then((project) => {
|
||||
if (req.files != "") {
|
||||
project.images = req.files;
|
||||
} else {
|
||||
console.log("NOTHING TO SAVE");
|
||||
}
|
||||
project.edited = new Date().getTime();
|
||||
project.save().then((saved) => {
|
||||
res.json({message: "project updated"});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
res.json({message: "Nah. You can't do that. Talk to the admin, sport."});
|
||||
}
|
||||
});
|
||||
});
|
||||
/*
|
||||
|
||||
Delete Client Project by ID
|
||||
|
||||
*/
|
||||
router.delete('/:id', function(req, res, next) {
|
||||
if (!req.user)
|
||||
return res.json({message: "users only, yo. you're not that"});
|
||||
User.findById(req.user._id).then((user) => {
|
||||
if ( rightsManager.check(user.role, OBJECT_POST, TASK_DELETE) ) {
|
||||
Project.findByIdAndRemove(req.params.id).then((project) => {
|
||||
res.json({message: 'project has been removed'});
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
})
|
||||
} else {
|
||||
res.json({message: "Nah. You can't do that. Talk to the admin, sport."});
|
||||
}
|
||||
});
|
||||
});
|
||||
module.exports = router;
|
26
brain/app.js
26
brain/app.js
|
@ -16,25 +16,6 @@ app.set('view engine', 'pug');
|
|||
app.use(express.static(__dirname + '../content/folio-images'));
|
||||
app.use(logger('dev'));
|
||||
|
||||
// wherever your db lives
|
||||
var DATABASE_URL = 'http://are0h:pa$$@localhost:5984/forfipamo';
|
||||
|
||||
// middleware itself, preceding any parsers
|
||||
app.use(function(req, res, next){
|
||||
var proxy_path = req.path.match(/^\/forfipamo(.*)$/);
|
||||
if(proxy_path){
|
||||
var db_url = DATABASE_URL + proxy_path[1];
|
||||
console.log("YUP "+db_url);
|
||||
console.log("METH: "+req)
|
||||
req.pipe(request({
|
||||
uri: db_url,
|
||||
method: req.method
|
||||
})).pipe(res);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
app.use(bodyParser.json({limit: '50mb'}));
|
||||
app.use(bodyParser.urlencoded(
|
||||
{
|
||||
|
@ -64,15 +45,10 @@ var front = require('./routes/front/index')(session);
|
|||
var back = require('./routes/back/index');
|
||||
var postDashboard = require('./routes/back/dash_posts');
|
||||
//api
|
||||
var folioLibrary = require('./api/content/folio');
|
||||
var projectLibrary = require('./api/content/project');
|
||||
var bookmarkLibrary = require('./api/content/bookmarks');
|
||||
var postLibrary = require('./api/content/posts');
|
||||
var mailer = require('./api/content/mailer');
|
||||
// API PATHS
|
||||
app.use('/api/folio', folioLibrary);
|
||||
app.use('/api/projects', projectLibrary);
|
||||
app.use('/api/bookmarks', bookmarkLibrary);
|
||||
|
||||
app.use('/api/post', postLibrary);
|
||||
// PAGES
|
||||
app.use('/', front);
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
module.exports = function (sequelize, DataTypes) {
|
||||
var Bookmark = sequelize.define('Bookmark', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
primaryKey: true
|
||||
},
|
||||
url: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
source: {
|
||||
type: DataTypes.STRING(500),
|
||||
allowNull: true
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
image: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
comments: {
|
||||
type: DataTypes.STRING,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
author: {
|
||||
type: DataTypes.STRING,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
tags: {
|
||||
type: DataTypes.ARRAY(DataTypes.TEXT),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
listed: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
}
|
||||
}, {
|
||||
timestamps: true,
|
||||
|
||||
// don't delete database entries but set the newly added attribute deletedAt
|
||||
// to the current date (when deletion was done). paranoid will only work if
|
||||
// timestamps are enabled
|
||||
paranoid: true,
|
||||
|
||||
// don't use camelcase for automatically added attributes but underscore style
|
||||
// so updatedAt will be updated_at
|
||||
underscored: true,
|
||||
|
||||
// disable the modification of table names; By default, sequelize will automatically
|
||||
// transform all passed model names (first parameter of define) into plural.
|
||||
// if you don't want that, set the following
|
||||
freezeTableName: false,
|
||||
|
||||
// define the table's name
|
||||
tableName: 'Bookmarks',
|
||||
|
||||
// Enable optimistic locking. When enabled, sequelize will add a version count attriubte
|
||||
// to the model and throw an OptimisticLockingError error when stale instances are saved.
|
||||
// Set to true or a string with the attribute name you want to use to enable.
|
||||
version: true
|
||||
});
|
||||
|
||||
return Bookmark;
|
||||
};
|
||||
|
||||
/**
|
||||
var mongoose = require('mongoose');
|
||||
mongoose.Promise = require('bluebird');
|
||||
|
||||
var Bookmark = new mongoose.Schema({
|
||||
url: String,
|
||||
source:String,
|
||||
title:String,
|
||||
image: String,
|
||||
comments:Array,
|
||||
created: String,
|
||||
edited: String,
|
||||
author:Object,
|
||||
tags:Array,
|
||||
listed:Boolean
|
||||
}, {
|
||||
collection: 'bookmarks'
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Bookmark', Bookmark);
|
||||
|
||||
|
||||
|
||||
**/
|
|
@ -1,94 +0,0 @@
|
|||
module.exports = function (sequelize, DataTypes) {
|
||||
var FolioProject = sequelize.define('FolioProject', {
|
||||
type: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.STRING(500),
|
||||
allowNull: true
|
||||
},
|
||||
url: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
tools: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.STRING,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
slug: {
|
||||
type: DataTypes.STRING,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
images: {
|
||||
type: DataTypes.STRING(2000),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
sortIndex: {
|
||||
type: DataTypes.INTEGER,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
}
|
||||
}, {
|
||||
timestamps: true,
|
||||
|
||||
// don't delete database entries but set the newly added attribute deletedAt
|
||||
// to the current date (when deletion was done). paranoid will only work if
|
||||
// timestamps are enabled
|
||||
paranoid: true,
|
||||
|
||||
// don't use camelcase for automatically added attributes but underscore style
|
||||
// so updatedAt will be updated_at
|
||||
underscored: true,
|
||||
|
||||
// disable the modification of table names; By default, sequelize will automatically
|
||||
// transform all passed model names (first parameter of define) into plural.
|
||||
// if you don't want that, set the following
|
||||
freezeTableName: false,
|
||||
|
||||
// define the table's name
|
||||
tableName: 'Folio',
|
||||
|
||||
// Enable optimistic locking. When enabled, sequelize will add a version count attriubte
|
||||
// to the model and throw an OptimisticLockingError error when stale instances are saved.
|
||||
// Set to true or a string with the attribute name you want to use to enable.
|
||||
version: true
|
||||
});
|
||||
|
||||
return FolioProject;
|
||||
};
|
||||
|
||||
/**
|
||||
var mongoose = require('mongoose');
|
||||
mongoose.Promise = require('bluebird');
|
||||
|
||||
var Bookmark = new mongoose.Schema({
|
||||
url: String,
|
||||
source:String,
|
||||
title:String,
|
||||
image: String,
|
||||
comments:Array,
|
||||
created: String,
|
||||
edited: String,
|
||||
author:Object,
|
||||
tags:Array,
|
||||
listed:Boolean
|
||||
}, {
|
||||
collection: 'bookmarks'
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Bookmark', Bookmark);
|
||||
|
||||
|
||||
|
||||
**/
|
|
@ -1,92 +0,0 @@
|
|||
module.exports = function (sequelize, DataTypes) {
|
||||
var Post = sequelize.define('Post', {
|
||||
uuid: {
|
||||
type: DataTypes.STRING(50),
|
||||
unique: true,
|
||||
allowNull: false
|
||||
},
|
||||
title: {
|
||||
type: DataTypes.STRING(500),
|
||||
allowNull: true
|
||||
},
|
||||
slug: {
|
||||
type: DataTypes.STRING(500),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
tags: {
|
||||
type: DataTypes.STRING(2000),
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
html: {
|
||||
type: DataTypes.TEXT,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
plaintext: {
|
||||
type: DataTypes.TEXT,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
feature_image: {
|
||||
type: DataTypes.STRING,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
page: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
unique: false,
|
||||
allowNull: true,
|
||||
defaultValue: false
|
||||
},
|
||||
author_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
origin_date: {
|
||||
type: DataTypes.DATE,
|
||||
unique: false,
|
||||
allowNull: true
|
||||
},
|
||||
featured: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
unique: false,
|
||||
allowNull: true,
|
||||
defaultValue: false
|
||||
},
|
||||
published: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
unique: false,
|
||||
allowNull: true,
|
||||
defaultValue: false
|
||||
}
|
||||
}, {
|
||||
timestamps: true,
|
||||
|
||||
// don't delete database entries but set the newly added attribute deletedAt
|
||||
// to the current date (when deletion was done). paranoid will only work if
|
||||
// timestamps are enabled
|
||||
paranoid: true,
|
||||
|
||||
// don't use camelcase for automatically added attributes but underscore style
|
||||
// so updatedAt will be updated_at
|
||||
underscored: true,
|
||||
|
||||
// disable the modification of table names; By default, sequelize will automatically
|
||||
// transform all passed model names (first parameter of define) into plural.
|
||||
// if you don't want that, set the following
|
||||
freezeTableName: false,
|
||||
|
||||
// define the table's name
|
||||
tableName: 'Posts',
|
||||
|
||||
// Enable optimistic locking. When enabled, sequelize will add a version count attriubte
|
||||
// to the model and throw an OptimisticLockingError error when stale instances are saved.
|
||||
// Set to true or a string with the attribute name you want to use to enable.
|
||||
version: true
|
||||
});
|
||||
|
||||
return Post;
|
||||
};
|
|
@ -40,7 +40,6 @@ router.get('/:page?', function(req, res)
|
|||
}
|
||||
|
||||
var count = Math.round(filtered.length / 6);
|
||||
//console.log("COUNT: "+count);
|
||||
var pageItems = [];
|
||||
var itemLimit = 6;
|
||||
var rangeStart = (pageNum * itemLimit) - itemLimit;
|
||||
|
@ -48,14 +47,14 @@ router.get('/:page?', function(req, res)
|
|||
{
|
||||
try
|
||||
{
|
||||
if (posts[i + rangeStart].id != null)
|
||||
if (filtered[i + rangeStart].id != null)
|
||||
{
|
||||
pageItems.push(filtered[i + rangeStart]);
|
||||
}
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
//console.log(e)
|
||||
//console.log("NO POST", e)
|
||||
}
|
||||
}
|
||||
res.render('dash/posts-index',
|
||||
|
@ -76,7 +75,6 @@ router.get('/:page?', function(req, res)
|
|||
}
|
||||
else
|
||||
{
|
||||
console.log("REDIRECT")
|
||||
res.redirect('/@/dashboard');
|
||||
}
|
||||
});
|
||||
|
@ -141,10 +139,10 @@ router.get('/edit/:id', function(req, res)
|
|||
});
|
||||
}).then(function(value)
|
||||
{
|
||||
console.log("VALUE: " + value);
|
||||
//console.log("VALUE: " + value);
|
||||
}).catch(function(err)
|
||||
{
|
||||
console.log(err);
|
||||
//console.log(err);
|
||||
})
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import DateUtils from '../../tools/utilities/DateUtils';
|
||||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var Models = require('../../models');
|
||||
var hljs = require('highlight.js/lib/highlight');
|
||||
var hljs_md = require('highlight.js/lib/languages/markdown');
|
||||
hljs.registerLanguage('markdown', hljs_md);
|
||||
const dateUtils = new DateUtils();
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const Models = require('../../models');
|
||||
const bCrypt = require('bcrypt-nodejs');
|
||||
//--------------------------
|
||||
// Index
|
||||
//--------------------------
|
||||
|
@ -73,199 +69,50 @@ router.get('/settings/', function(req, res)
|
|||
}
|
||||
});
|
||||
//--------------------------
|
||||
// POSTS
|
||||
// Login
|
||||
//--------------------------
|
||||
|
||||
/**
|
||||
//--------------------------
|
||||
// MAIN FIPAMO DISPLAY
|
||||
//--------------------------
|
||||
router.get('/fipamo/', function (req, res) {
|
||||
if (req.session.user) {
|
||||
Models.Bookmark.findAll({
|
||||
order: [['id', 'DESC']]
|
||||
}).then(function (saved) {
|
||||
res.render('admin/admin-fipamo-index', {
|
||||
title: 'Manage Saved',
|
||||
mode: 'admin',
|
||||
saved: saved
|
||||
/* Handle Login POST */
|
||||
router.post('/login', function(req, res, next)
|
||||
{
|
||||
Models.User.findOne(
|
||||
{
|
||||
where:
|
||||
{
|
||||
handle: req.body.handle
|
||||
}
|
||||
}).then(user =>
|
||||
{
|
||||
if (!isValidPassword(user, req.body.password))
|
||||
{
|
||||
return res.json(
|
||||
{
|
||||
message: 'CHECK YOUR PASSWORD'
|
||||
});
|
||||
}
|
||||
let session = req.session;
|
||||
session.user = user;
|
||||
res.redirect('/@/dashboard');
|
||||
}).catch(err =>
|
||||
{
|
||||
return res.json(
|
||||
{
|
||||
message: 'NOT FOUND, HAWS'
|
||||
});
|
||||
}).then(function (value) {
|
||||
//console.log(value);
|
||||
}).catch(function (err) {
|
||||
//next(err);
|
||||
})
|
||||
} else {
|
||||
res.redirect('/admin');
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/fipamo/edit/:id', function (req, res) {
|
||||
if (req.session.user) {
|
||||
Models.Bookmark.findOne({
|
||||
where: {
|
||||
id: req.params.id
|
||||
}
|
||||
}).then(saved => {
|
||||
res.render('admin/admin-fipamo-edit', {
|
||||
title: 'FIPAMO | EDIT ' + saved.title,
|
||||
mode: 'admin',
|
||||
bookmark: saved,
|
||||
edit: true
|
||||
});
|
||||
}).then(function (value) {
|
||||
console.log("VALUE: " + value);
|
||||
}).catch(function (err) {
|
||||
console.log(err);
|
||||
})
|
||||
} else {
|
||||
res.redirect('/admin');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//--------------------------
|
||||
// MAIN FOLIO DISPLAY
|
||||
// Logout
|
||||
//--------------------------
|
||||
router.get('/folio/', function (req, res) {
|
||||
if (req.session.user) {
|
||||
Models.FolioProject.findAll().then(function (projects) {
|
||||
res.render('folio-hub', {
|
||||
title: 'manage folio',
|
||||
mode: 'admin',
|
||||
projects: projects
|
||||
router.post('/logout', function(req, res, next)
|
||||
{
|
||||
req.logout();
|
||||
return res.json(
|
||||
{
|
||||
message: 'LOGGED OUT'
|
||||
});
|
||||
}).then(function (value) {
|
||||
//console.log(value);
|
||||
}).catch(function (err) {
|
||||
//next(err);
|
||||
})
|
||||
} else {
|
||||
res.redirect('/admin');
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------
|
||||
// PROJECT DISPLAY
|
||||
//--------------------------
|
||||
|
||||
router.get('/folio/:id', function (req, res) {
|
||||
if (req.session.user) {
|
||||
console.log(req.params.id)
|
||||
Models.FolioProject.findOne({
|
||||
where: {
|
||||
slug: req.params.id
|
||||
}
|
||||
}).then(function (project) {
|
||||
//var item = project[0]
|
||||
res.render('folio-project-display', {
|
||||
title: project.title,
|
||||
project: project,
|
||||
edit: true,
|
||||
mode: 'admin'
|
||||
});
|
||||
}).then(function (value) {
|
||||
//console.log(value);
|
||||
}).catch(function (err) {
|
||||
//next(err);
|
||||
});
|
||||
} else {
|
||||
res.redirect('/admin');
|
||||
}
|
||||
});
|
||||
|
||||
router.get('/folio/task/add', function (req, res) {
|
||||
if (req.user) {
|
||||
res.render('folio-project-display', {
|
||||
title: 'Add New Project',
|
||||
edit: false,
|
||||
mode: 'admin'
|
||||
});
|
||||
} else {
|
||||
res.redirect('/admin');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//--------------------------
|
||||
// ADMIN PAGE
|
||||
//--------------------------
|
||||
router.get('/admin/:include/:id?', function (req, res) {
|
||||
if (req.user) {
|
||||
if (req.user.role == 2) {
|
||||
switch (req.params.include) {
|
||||
case "edit-project":
|
||||
FolioProject.findById(req.params.id).exec().then(function (project) {
|
||||
res.render('includes/folio-project', {
|
||||
formTitle: "EDIT " + project.title,
|
||||
project: project,
|
||||
mode: req.params.include
|
||||
});
|
||||
}).catch(function (err) {
|
||||
//console.log(err)
|
||||
});
|
||||
break
|
||||
case "add-project":
|
||||
res.render('includes/folio-project', {
|
||||
formTitle: 'Fo r mle ss ADMIN | Add New Project',
|
||||
mode: req.params.include
|
||||
});
|
||||
break
|
||||
case "folio-hub":
|
||||
FolioProject.find().exec().then(function (entries) {
|
||||
//res.json(entries);
|
||||
res.render('content/folio-hub', {
|
||||
title: 'Fo r mle ss ADMIN | Folio Manager',
|
||||
entries: entries
|
||||
});
|
||||
}).then(function (value) {
|
||||
//console.log(value);
|
||||
}).catch(function (err) {
|
||||
next(err);
|
||||
});
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
res.json({
|
||||
message: 'NOT AUTHORIZED'
|
||||
});
|
||||
}
|
||||
});
|
||||
router.get('/includes/admin-menu/', function (req, res) {
|
||||
if (req.user) {
|
||||
if (req.user == 1) {
|
||||
res.render('client-panel')
|
||||
} else {
|
||||
res.render('includes/admin-menu', {
|
||||
title: 'Fo r mle ss | Admin',
|
||||
user_status: "What up, random entity",
|
||||
name: "What up, " + req.user.firstname
|
||||
})
|
||||
}
|
||||
} else {
|
||||
res.render('index', {
|
||||
title: 'Fo r mle ss',
|
||||
user_status: "What up, random entity"
|
||||
});
|
||||
}
|
||||
});
|
||||
router.get('/content/admin/', function (req, res) {
|
||||
if (req.user) {
|
||||
if (req.user == 1) {
|
||||
res.render('client-panel')
|
||||
} else {
|
||||
res.render('content/admin', {
|
||||
title: 'Fo r mle ss | Admin'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
res.render('content/index', {
|
||||
title: 'Fo r mle ss'
|
||||
});
|
||||
}
|
||||
});
|
||||
*/
|
||||
module.exports = router;
|
||||
var isValidPassword = function(user, password)
|
||||
{
|
||||
return bCrypt.compareSync(password, user.password);
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
var express = require('express');
|
||||
var router = express.Router();
|
||||
var Models = require('../../models');
|
||||
var bCrypt = require('bcrypt-nodejs');
|
||||
var config = require('../../../config.json');
|
||||
module.exports = function (session) {
|
||||
//--------------------------
|
||||
|
@ -63,50 +62,5 @@ module.exports = function (session) {
|
|||
|
||||
|
||||
});
|
||||
|
||||
//--------------------------
|
||||
// Login
|
||||
//--------------------------
|
||||
/* Handle Login POST */
|
||||
router.post('/login', function (req, res, next) {
|
||||
|
||||
Models.User.findOne({
|
||||
where: {
|
||||
handle: req.body.handle
|
||||
}
|
||||
}).then(user => {
|
||||
if (!isValidPassword(user, req.body.password)) {
|
||||
console.log('Invalid Password');
|
||||
//return done(null, false, req.flash('message', 'Invalid Password')); // redirect back to login page
|
||||
return res.json({
|
||||
message: 'CHECK YOUR PASSWORD'
|
||||
});
|
||||
}
|
||||
let session = req.session;
|
||||
session.user = user;
|
||||
res.redirect('/@/dashboard');
|
||||
//return done(null, user);
|
||||
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
return res.json({
|
||||
message: 'NOT FOUND BOSS'
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
//--------------------------
|
||||
// Logout
|
||||
//--------------------------
|
||||
router.post('/logout', function (req, res, next) {
|
||||
req.logout();
|
||||
return res.json({
|
||||
message: 'LOGGED OUT'
|
||||
});
|
||||
});
|
||||
return router;
|
||||
}
|
||||
|
||||
var isValidPassword = function (user, password) {
|
||||
return bCrypt.compareSync(password, user.password);
|
||||
}
|
|
@ -145,7 +145,7 @@ export default class RightsManager
|
|||
//--------------------------
|
||||
check(role, object, task)
|
||||
{
|
||||
console.log(role + " *** " + object + " *** " + task);
|
||||
//console.log(role + " *** " + object + " *** " + task);
|
||||
return roles[role][object][task];
|
||||
}
|
||||
//--------------------------
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
extends frame
|
||||
block main-content
|
||||
section#saved-index-content
|
||||
header.columns#header
|
||||
//#float-bg
|
||||
img(src='/base-assets/images/eye-beamz.png')
|
||||
#header-one.column
|
||||
#header-two.column
|
||||
label#the-title
|
||||
a(href="/") thetwelfthhouse
|
||||
#the-intro
|
||||
//| Twelfth House Admin
|
||||
#saved-hub-display.columns
|
||||
#saved-hub-title.column
|
||||
label EDIT BOOKMARK
|
||||
#saved-hub-main.column
|
||||
a(href=bookmark.url target='_blank') SOURCE
|
||||
br
|
||||
input(id='saved_title' type='text', name='saved_title' class='form-control', value=bookmark.title, placeholder='saved title', autofocus)
|
||||
br
|
||||
input(id='saved_tags' type='text', name='saved_tags' class='form-control', value=bookmark.tags, placeholder='tags [comma seperated]', autofocus)
|
||||
br
|
||||
input(id='saved_image' type='text', name='saved_image' class='form-control', value=bookmark.image, placeholder='image url [comma seperated]', autofocus)
|
||||
br
|
||||
br
|
||||
button(id="saved-sumbit-btn", class='saved-sumbit-btn', data-action='saved-edit' data-id=bookmark.id type='submit') UPDATE LINK
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
extends frame
|
||||
block main-content
|
||||
section#saved-index-content
|
||||
header.columns#header
|
||||
//#float-bg
|
||||
img(src='/base-assets/images/eye-beamz.png')
|
||||
#header-one.column
|
||||
#header-two.column
|
||||
label#the-title
|
||||
a(href="/") thetwelfthhouse
|
||||
#the-intro
|
||||
//| Twelfth House Admin
|
||||
#saved-hub-display.columns
|
||||
#saved-hub-title.column
|
||||
label ADD NEW LINK
|
||||
br
|
||||
textarea(id="saved_text" name='saved_text' class='post-edit', placeholder='enter link to save', required, autofocus)
|
||||
button(id="saved-sumbit-btn", class='saved-sumbit-btn', data-action='saved-add' type='submit') SAVE LINK
|
||||
//a(href='/admin/fipamo/add')
|
||||
i.fa.fa-plus SAVE NEW LINK
|
||||
#saved-hub-main.column
|
||||
label SAVED ENTRIES
|
||||
br
|
||||
-var index = 0;
|
||||
-for (index; index<saved.length; index++)
|
||||
-var saved_title = saved[index].title
|
||||
if(saved_title == null || saved_title == '')
|
||||
-saved_title = 'Saved Entry '+saved[index].id
|
||||
a(href='/admin/fipamo/edit/'+saved[index].id)
|
||||
span= saved_title
|
||||
br
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
extends frame
|
||||
block main-content
|
||||
header.header#header
|
||||
//a(href='/')
|
||||
img(src='/base-assets/images/the-logo.svg')
|
||||
br
|
||||
.header-desc
|
||||
span#the-title
|
||||
a(href="/") thetwelfthhouse
|
||||
#the-intro
|
||||
| Work header
|
||||
.folio-hub#folio-hub
|
||||
a.btn-add-project(href="/admin/folio/task/add")
|
||||
i.fa.fa-plus-circle.fa-2x
|
||||
span Add New Project
|
||||
.project-list#project-list
|
||||
each project, index in projects
|
||||
.project-item(data-id=project._id)
|
||||
span.drag-handle
|
||||
i.fa.fa-arrows-v
|
||||
a.project-label#edit-project(href="/admin/folio/"+project.slug)= project.title
|
|
@ -1,39 +0,0 @@
|
|||
extends frame
|
||||
block main-content
|
||||
div.folio-project-form#folio-project-form
|
||||
form(class='folio-project', name="folio-project", enctype="multipart/form-data")
|
||||
//i.fa.fa-minus-circle.fa-spin.icon-loading#icon-loading
|
||||
span= formTitle
|
||||
br
|
||||
if edit
|
||||
-var title = project.title
|
||||
-var tools = project.tools
|
||||
-var url = project.url
|
||||
-var desc = project.description
|
||||
//-document.getElementById('type').selectedIndex = 1;
|
||||
input(type='text', name='title' class='', placeholder='Enter Project Title', value= title, required, autofocus)
|
||||
input(type='text', id="tools" name='tools' class='', placeholder='Tools Used', value= tools, required, autofocus)
|
||||
input(type='text', name='url' class='', placeholder='Project URL', required, value= url, autofocus)
|
||||
select#type(name="type", form="folio-type'")
|
||||
option(value="option00") Select Project Type
|
||||
option(value="option01") Design and Development
|
||||
option(value="option02") Web Design/Front End Development
|
||||
option(value="option03") Web Development
|
||||
option(value="option04") Logo/Branding
|
||||
br
|
||||
textarea(rows="9" cols="52" name='description' class='', placeholder='Description', required, autofocus) #{desc}
|
||||
br
|
||||
.upload-drop#upload-drop
|
||||
| Drag and Drop files to upload
|
||||
label(for="upload-click") or click to select
|
||||
|
||||
br
|
||||
if edit
|
||||
button(id="btn-submit", class='folio-btn-edit', type='submit', data-action='folio-update' data-id=project.id) UPDATE_PROJECT
|
||||
else
|
||||
button(id="btn-submit", class='folio-btn-add', type='submit', data-action='folio-add') ADD_PROJECT
|
||||
|
||||
.upload-list#upload-list
|
||||
span Files to Upload
|
||||
.thumb-list#thumb-list
|
||||
input(id="upload-click" type="file" name="uploaded" multiple)
|
|
@ -3,14 +3,6 @@
|
|||
svg(viewBox="0 0 20 20" class="icons")
|
||||
use(xlink:href='/dash/assets/images/sprite.svg#entypo-book')
|
||||
label Posts
|
||||
a#bookmarks(href="")
|
||||
svg(viewBox="0 0 20 20" class="icons")
|
||||
use(xlink:href='/dash/assets/images/sprite.svg#entypo-bookmarks')
|
||||
label Bookmarks
|
||||
a#folio(href="")
|
||||
svg(viewBox="0 0 20 20" class="icons")
|
||||
use(xlink:href='/dash/assets/images/sprite.svg#entypo-suitcase')
|
||||
label Folio
|
||||
a#settings(href="/@/dashboard/settings")
|
||||
svg(viewBox="0 0 20 20" class="icons")
|
||||
use(xlink:href='/dash/assets/images/sprite.svg#entypo-cog')
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
h1 What up
|
||||
#dash-index-two.column
|
||||
.dash-form#dash-form
|
||||
form(class='login', name="login" action="/login" method="POST")
|
||||
form(class='login', name="login" action="/@/dashboard/login" method="POST")
|
||||
input(type='text', name='handle' class='form-control', placeholder='handle', required, autofocus)
|
||||
input(type='password', name='password' class='form-control', placeholder='password', required)
|
||||
button(id="login-btn", class='login-btn', type='submit') COME ON IN
|
|
@ -1,14 +0,0 @@
|
|||
div.project-display#project-display
|
||||
i.fa.fa-arrow-circle-left.fa-2x#return-home
|
||||
div.project-meta#project-meta
|
||||
p project_details
|
||||
label= project.title
|
||||
label= project.type
|
||||
label= project.tools
|
||||
label=project.url
|
||||
p= project.description
|
||||
ul.image-list#image-list
|
||||
each image, index in project.images
|
||||
-var path = String(project.images[index].path).substring(7, project.images[index].path.length)
|
||||
li.slide-holder(id="slide-holder-"+[index])
|
||||
img.slide(id="slide-"+[index], src=path)
|
|
@ -1,10 +0,0 @@
|
|||
div.user-form#user-form-signup
|
||||
form(class='signup', name="signup" action="/signup" method="POST")
|
||||
label ://apply_for_entry/
|
||||
br
|
||||
input(type='text', name='handle' class='form-control', placeholder='handle', required, autofocus)
|
||||
input(type='text', name='firstname' class='form-control', placeholder='firstname',required, autofocus)
|
||||
input(type='text', name='lastname' class='form-control', placeholder='lastname',required, autofocus)
|
||||
input(type='text', name='email' class='form-control', placeholder='email',required, autofocus)
|
||||
input(type='password', name='password' class='form-control', placeholder='password', required)
|
||||
button(id="signin-btn", class='signin-btn', type='submit') INIT_ACCOUNT
|
|
@ -23,7 +23,6 @@ export default class Base
|
|||
this.dataUtils = new DataUtils();
|
||||
this.dbUtils = new DBUtils();
|
||||
this.settings = [];
|
||||
//this.cacheAssets();
|
||||
this.storeLocalData();
|
||||
}
|
||||
start()
|
||||
|
@ -54,27 +53,6 @@ export default class Base
|
|||
console.log(err);
|
||||
});
|
||||
}
|
||||
|
||||
cacheAssets()
|
||||
{
|
||||
if ('serviceWorker' in navigator)
|
||||
{
|
||||
window.addEventListener('load', function()
|
||||
{
|
||||
navigator.serviceWorker.register('https://fipamo.local/tim-duncan.js?'+Math.round(new Date().getTime()/1000)).then(function(registration)
|
||||
{
|
||||
//console.log('Service worker successfully registered on scope', registration.scope);
|
||||
}).catch(function(error)
|
||||
{
|
||||
//console.log('Service worker failed to register');
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
//console.log("NOPE")
|
||||
}
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
import DataUtils, { REQUEST_TYPE_GET, REQUEST_TYPE_PUT, REQUEST_TYPE_POST, REQUEST_TYPE_DELETE, CONTENT_TYPE_JSON, CONTENT_TYPE_FORM } from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import StringUtils from '../tools/utilities/StringUtils.jsx';
|
||||
class ProjectFolio {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
var folio = [];
|
||||
this.dataUtils = new DataUtils();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {}
|
||||
|
||||
submitProject(edit, uploadFiles) {
|
||||
let self = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
//collect form data
|
||||
//if(!this.validateForm())
|
||||
var projectData = new FormData();
|
||||
//let projectImages = document.getElementById('projectImages');
|
||||
//var fileSelect = projectImages;
|
||||
var files = uploadFiles;
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var file = files[i];
|
||||
// Check the file type.
|
||||
if (!file.type.match('image.*')) {
|
||||
continue;
|
||||
}
|
||||
// Add the file to the request.
|
||||
projectData.append('folioImages', file, file.name);
|
||||
}
|
||||
var category = document.getElementById("content_category");
|
||||
let project_form = document.forms.namedItem("folio-project");
|
||||
projectData.append("title", project_form.title.value);
|
||||
projectData.append('slug', new StringUtils().cleanString(project_form.title.value));
|
||||
projectData.append("tools", project_form.tools.value);
|
||||
projectData.append("url", project_form.url.value);
|
||||
projectData.append("description", project_form.description.value);
|
||||
projectData.append("type", type.options[type.selectedIndex].text);
|
||||
|
||||
let postURL
|
||||
let postEventType
|
||||
|
||||
if (edit) {
|
||||
let postID = document.getElementById('btn-submit').getAttribute('data-id');
|
||||
postURL = "/api/folio/update/" + postID;
|
||||
postEventType = DataEvent.PROJECT_UPDATED;
|
||||
} else {
|
||||
postURL = "/api/folio/add";
|
||||
postEventType = DataEvent.PROJECT_ADDED;
|
||||
}
|
||||
|
||||
self.dataUtils.request(postURL, postEventType, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, projectData)
|
||||
.then((response) => {
|
||||
resolve({
|
||||
response
|
||||
})
|
||||
}).catch((err) => {
|
||||
reject({
|
||||
err
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
addNewProject(uploadFiles) {
|
||||
|
||||
var request = new XMLHttpRequest();
|
||||
request.open("POST", "/folio", true);
|
||||
request.onload = function(oEvent) {
|
||||
if (request.status == 200) {
|
||||
let response = JSON.parse(request.response);
|
||||
if (response.message == "New Content Entered") {
|
||||
console.log("SET");
|
||||
project_form.reset();
|
||||
} else {
|
||||
console.log(response.message);
|
||||
}
|
||||
} else {
|
||||
//console.log(request);
|
||||
}
|
||||
};
|
||||
request.send(projectData);
|
||||
}
|
||||
validateForm() {
|
||||
let valid = false;
|
||||
if (this.entry_form.title.value == "" || this.entry_form.price.value == "" || this.entry_form.description == "") {
|
||||
return valid;
|
||||
} else {
|
||||
valid = true;
|
||||
return valid;
|
||||
}
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
||||
export { ProjectFolio as default }
|
|
@ -1,72 +0,0 @@
|
|||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import StringUtils from '../tools/utilities/StringUtils.jsx';
|
||||
class TaskFipamo {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
var folio = [];
|
||||
this.dataUtils = new DataUtils();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {}
|
||||
|
||||
submitLink(edit) {
|
||||
let self = this;
|
||||
return new Promise(function (resolve, reject) {
|
||||
let link_data = '';
|
||||
let postURL;
|
||||
let postEventType;
|
||||
console.log('EDIT: '+edit);
|
||||
if (edit) {
|
||||
|
||||
//TODO: FIX TAGS,NEEDS TO BE SUBMITTED AS AN ARRAY
|
||||
|
||||
link_data = {
|
||||
"title": document.getElementById('saved_title').value,
|
||||
"tags": document.getElementById('saved_tags').value,
|
||||
"image": document.getElementById('saved_image').value
|
||||
};
|
||||
let savedID = document.getElementById('saved-sumbit-btn').getAttribute('data-id');
|
||||
postURL = "/api/bookmarks/update/" + savedID;
|
||||
postEventType = DataEvent.LINK_UPDATED;
|
||||
console.log('url'+postURL);
|
||||
} else {
|
||||
link_data = {
|
||||
"url": document.getElementById('saved_text').value
|
||||
};
|
||||
|
||||
postURL = "/api/bookmarks/add";
|
||||
postEventType = DataEvent.LINK_ADDED;
|
||||
}
|
||||
console.log('POSTING');
|
||||
self.dataUtils.request(postURL, postEventType, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, link_data)
|
||||
.then((response) => {
|
||||
resolve({
|
||||
response
|
||||
})
|
||||
}).catch((err) => {
|
||||
reject({
|
||||
err
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
||||
export {
|
||||
TaskFipamo as
|
||||
default
|
||||
}
|
|
@ -1,137 +0,0 @@
|
|||
class UserAuthentication {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
var self = this;
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
handleUserSignUp(userSignupForm)
|
||||
{
|
||||
//e.preventDefault();
|
||||
let signup_form = document.forms.namedItem(userSignupForm);
|
||||
|
||||
let social_preferences = {"social":[
|
||||
{"service":"twitter", "url":""},
|
||||
{"service":"fb", "url":""},
|
||||
{"service":"instagram", "url":""},
|
||||
{"service":"pinterest", "url":""}
|
||||
]};
|
||||
|
||||
let mail_preferences = {"mail":[
|
||||
{"category":"video", "enabled":"false"},
|
||||
{"category":"books", "enabled":"false"},
|
||||
{"category":"graphic_novels", "enabled":"false"},
|
||||
{"category":"comics", "enabled":"false"}
|
||||
]};
|
||||
|
||||
//var oOutput = document.querySelector("div"),
|
||||
let signup_handle = signup_form.handle.value;
|
||||
let signup_firstname = signup_form.firstname.value;
|
||||
let signup_lastname = signup_form.lastname.value;
|
||||
let signup_email = signup_form.email.value;
|
||||
let signup_password = signup_form.password.value;
|
||||
let social = JSON.stringify(social_preferences);
|
||||
let mail = JSON.stringify(mail_preferences);
|
||||
|
||||
//oData.append("CustomField", "This is some extra data");
|
||||
var request = new XMLHttpRequest();
|
||||
request.open("POST", "/signup", true);
|
||||
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
request.setRequestHeader('Cache-Control', 'max-age=0');
|
||||
request.setRequestHeader('Upgrade-Insecure-Requests', '1');
|
||||
request.onload = function(oEvent) {
|
||||
if (request.status == 200) {
|
||||
let response = JSON.parse(request.response);
|
||||
if(response.message == "USER ADDED")
|
||||
{
|
||||
document.body.dispatchEvent( new CustomEvent(USER_STATUS,
|
||||
{
|
||||
'detail':
|
||||
{
|
||||
type:"USER_ADDED",
|
||||
data:response.message
|
||||
}
|
||||
}) );
|
||||
}else{
|
||||
document.body.dispatchEvent( new CustomEvent(USER_STATUS,
|
||||
{
|
||||
'detail':
|
||||
{
|
||||
type:"USER_NOT_ADDED",
|
||||
data:response.message
|
||||
}
|
||||
}) );
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log(request);
|
||||
}
|
||||
};
|
||||
|
||||
request.send('handle='+signup_handle+'&firstname='+signup_firstname+'&lastname='+signup_lastname+'&email='+signup_email+'&password='+signup_password+"&social="+social+"&preferences="+mail);
|
||||
}
|
||||
|
||||
handleUserLogin(userLoginForm)
|
||||
{
|
||||
//e.preventDefault();
|
||||
let login_form = document.forms.namedItem(userLoginForm);
|
||||
|
||||
//var oOutput = document.querySelector("div"),
|
||||
let login_handle = login_form.handle.value;
|
||||
let login_password = login_form.password.value;
|
||||
|
||||
//oData.append("CustomField", "This is some extra data");
|
||||
var request = new XMLHttpRequest();
|
||||
request.open("POST", "/login", true);
|
||||
request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
request.setRequestHeader('Cache-Control', 'max-age=0');
|
||||
request.setRequestHeader('Upgrade-Insecure-Requests', '1');
|
||||
request.onload = function(oEvent) {
|
||||
if (request.status == 200) {
|
||||
let response = JSON.parse(request.response);
|
||||
if(response.message == "USER FOUND")
|
||||
{
|
||||
document.body.dispatchEvent( new CustomEvent(USER_STATUS,
|
||||
{
|
||||
'detail':
|
||||
{
|
||||
type:"USER_LOGIN_GOOD",
|
||||
data:login_handle
|
||||
}
|
||||
}) );
|
||||
}else{
|
||||
document.body.dispatchEvent( new CustomEvent(USER_STATUS,
|
||||
{
|
||||
'detail':
|
||||
{
|
||||
type:"USER_LOGIN_BAD",
|
||||
data:response.message
|
||||
}
|
||||
}) );
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log(request);
|
||||
}
|
||||
};
|
||||
|
||||
request.send('handle='+login_handle+'&password='+login_password);
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
|
||||
}
|
||||
export {UserAuthentication as default}
|
||||
export const USER_STATUS = "userStatus"
|
|
@ -1,5 +1,3 @@
|
|||
import PostEditor from './PostEditor';
|
||||
import Animate from '../../../../../brain/tools/effects/Animate';
|
||||
import PostIndex from './PostIndex';
|
||||
|
||||
export default class DashManager {
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
class DisplayAdminFipamo {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
||||
|
||||
export {
|
||||
DisplayAdminFipamo as
|
||||
default
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import ProjectFolio from '../tasks/ProjectFolio.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
class DisplayAdminFolio {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
var self = this;
|
||||
this.uploadFiles;
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
let self = this;
|
||||
new Animate().object({
|
||||
targets: document.getElementById('loader'),
|
||||
duration: 300,
|
||||
opacity: 0,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
document.getElementById('loader').style.display = 'none';
|
||||
document.getElementById('loader').style.visibility = 'hidden';
|
||||
if (document.getElementById('project-list')) {
|
||||
sortable('.project-list', {
|
||||
handle: '.drag-handle'
|
||||
})[0].addEventListener('sortupdate', function (e) {
|
||||
let sortList = [];
|
||||
let sortItems = document.getElementById('project-list').children;
|
||||
for (var i = 0; i < sortItems.length; i++) {
|
||||
sortList.push({
|
||||
'sortIndex': i,
|
||||
'sortID': sortItems[i].getAttribute('data-id')
|
||||
});
|
||||
}
|
||||
new DataUtils().request('/api/folio/sort', DataEvent.PROJECTS_SORTED, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, sortList)
|
||||
.then((response) => {
|
||||
console.log(JSON.parse(response.request))
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
});
|
||||
}
|
||||
new Animate().object({
|
||||
targets: document.getElementById('header'),
|
||||
duration: 10,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
}
|
||||
DisplayAdminFolio.uploadFiles = [];
|
||||
export {
|
||||
DisplayAdminFolio as
|
||||
default
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
//TOOLS
|
||||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
import TextEffects from '../tools/effects/TextEffects.jsx';
|
||||
class DisplayBlog {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
reframe('iframe');
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
console.log("START BLOG");
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
}
|
||||
export {
|
||||
DisplayBlog as
|
||||
default
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
//TOOLS
|
||||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
import TextEffects from '../tools/effects/TextEffects.jsx';
|
||||
//Client-side Pages
|
||||
import DisplayIndex from './DisplayIndex.jsx';
|
||||
import DisplayWork from './DisplayWork.jsx';
|
||||
import DisplayBlog from './DisplayBlog.jsx';
|
||||
import DisplayFi from './DisplayFi.jsx';
|
||||
|
||||
class DisplayClient {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor(section, page) {
|
||||
this.section = section;
|
||||
this.page = page;
|
||||
this.current = null;
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
let self = this;
|
||||
new Animate().object({
|
||||
targets: document.getElementById('loader'),
|
||||
duration: 300,
|
||||
opacity: 0,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
document.getElementById('loader').style.display = 'none';
|
||||
document.getElementById('loader').style.visibility = 'hidden';
|
||||
new Animate().object({
|
||||
targets: document.getElementById('header'),
|
||||
duration: 10,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
new TextEffects().scramble(document.getElementById('the-title'), 50, function () {
|
||||
switch(self.section){
|
||||
case "blog":
|
||||
self.current = new DisplayBlog();
|
||||
break
|
||||
case "work":
|
||||
self.current = new DisplayWork();
|
||||
break
|
||||
case "fipamo":
|
||||
self.current = new DisplayFi();
|
||||
break
|
||||
default:
|
||||
self.current = new DisplayIndex();
|
||||
break
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
}
|
||||
export {
|
||||
DisplayClient as
|
||||
default
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
export const DisplayID = "Display-Fi";
|
||||
import DataUtils, { REQUEST_TYPE_GET, REQUEST_TYPE_PUT, REQUEST_TYPE_POST, REQUEST_TYPE_DELETE, CONTENT_TYPE_JSON, CONTENT_TYPE_FORM } from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
import TextEffects from '../tools/effects/TextEffects.jsx';
|
||||
class DisplayFi {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
this.dataUtils = new DataUtils();
|
||||
//this.mailer = new Mailer();
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
let self = this;
|
||||
console.log("START BOOKMARKS");
|
||||
|
||||
}
|
||||
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
export { DisplayFi as default }
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
//TOOLS
|
||||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
import TextEffects from '../tools/effects/TextEffects.jsx';
|
||||
class DisplayIndex {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
document.getElementById('the-intro').style.opacity = 1;
|
||||
|
||||
new Animate().object({
|
||||
targets: document.getElementById('recent-work'),
|
||||
duration: 200,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
new Animate().object({
|
||||
targets: document.getElementById('recent-blog'),
|
||||
duration: 500,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
new Animate().object({
|
||||
targets: document.getElementById('float-bg'),
|
||||
duration: 2000,
|
||||
opacity: 1,
|
||||
easing: 'easeInQuad',
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
|
||||
}
|
||||
export {
|
||||
DisplayIndex as
|
||||
default
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
export const DisplayID = "Display-Work";
|
||||
import DataUtils, {
|
||||
REQUEST_TYPE_GET,
|
||||
REQUEST_TYPE_PUT,
|
||||
REQUEST_TYPE_POST,
|
||||
REQUEST_TYPE_DELETE,
|
||||
CONTENT_TYPE_JSON,
|
||||
CONTENT_TYPE_FORM
|
||||
} from '../tools/utilities/DataUtils.jsx';
|
||||
import * as DataEvent from '../tools/events/DataEvent.jsx';
|
||||
import Animate from '../tools/effects/Animate.jsx';
|
||||
import * as Ease from '../tools/effects/Animate.jsx';
|
||||
import TextEffects from '../tools/effects/TextEffects.jsx';
|
||||
import Mailer from '../tasks/Mailer.jsx'
|
||||
class DisplayWork {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {
|
||||
this.dataUtils = new DataUtils();
|
||||
this.mailer = new Mailer();
|
||||
this.start();
|
||||
}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
start() {
|
||||
let self = this;
|
||||
if (document.getElementById('work-display')) {
|
||||
new Animate().object({
|
||||
targets: document.getElementById('work-display'),
|
||||
duration: 500,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
self.sortItemList();
|
||||
new Animate().object({
|
||||
targets: document.getElementById('float-bg'),
|
||||
duration: 2000,
|
||||
opacity: 1,
|
||||
easing: 'easeInQuad',
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
new Animate().object({
|
||||
targets: document.getElementById('work-header'),
|
||||
duration: 500,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
new Animate().object({
|
||||
targets: document.getElementById('folio-header'),
|
||||
duration: 500,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
self.showFolioImages();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
sortItemList() {
|
||||
let workItems = document.getElementById('work-list').children;
|
||||
let trans = 300;
|
||||
let self = this;
|
||||
for (var i = 0; i < workItems.length; i++) {
|
||||
//item.addEventListener('click', f => this.handleWorkList(f))
|
||||
|
||||
new Animate().object({
|
||||
targets: workItems[i],
|
||||
duration: trans,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
//self.showFolioImages();
|
||||
}
|
||||
});
|
||||
|
||||
trans = trans + 200;
|
||||
if (i == workItems.length - 1) {
|
||||
|
||||
new Animate().object({
|
||||
targets: document.getElementById('contact'),
|
||||
duration: 300,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
//self.showFolioImages();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
showFolioImages() {
|
||||
let images = document.getElementById('project-images').children;
|
||||
let trans = 300;
|
||||
let self = this;
|
||||
for (var i = 0; i < images.length; i++) {
|
||||
//item.addEventListener('click', f => this.handleWorkList(f))
|
||||
|
||||
new Animate().object({
|
||||
targets: images[i],
|
||||
duration: trans,
|
||||
opacity: 1,
|
||||
easing: 'easeInOutQuad',
|
||||
complete: function () {
|
||||
//self.showFolioImages();
|
||||
}
|
||||
});
|
||||
trans = trans + 200
|
||||
}
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
||||
export {
|
||||
DisplayWork as
|
||||
default
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
import Animate from '../../../../../brain/tools/effects/Animate';
|
||||
import PostEditor from './PostEditor';
|
||||
export default class PostIndex
|
||||
{
|
||||
|
|
|
@ -63,22 +63,6 @@
|
|||
|
||||
@import "main/_settings"
|
||||
|
||||
/**
|
||||
-------------------------------
|
||||
-- Fipamo
|
||||
-------------------------------
|
||||
**/
|
||||
|
||||
@import "main/_fipamo"
|
||||
|
||||
/**
|
||||
-------------------------------
|
||||
-- Folio
|
||||
-------------------------------
|
||||
**/
|
||||
|
||||
@import 'main/_folio'
|
||||
|
||||
/**
|
||||
-------------------------------
|
||||
-- Forms
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
#bm-content
|
||||
width 100%
|
||||
max-width 1024px
|
||||
margin 0 auto
|
||||
#header-one, #header-two
|
||||
label#the-title
|
||||
a(href="/") thetwelfthhouse
|
||||
#header-two
|
||||
font 400 1.5em $bodyType
|
||||
#bookmark-display
|
||||
padding 0
|
||||
.bookmark-list
|
||||
.bookmark-entry
|
||||
background lightness($primary, 15%)
|
||||
width 50%
|
||||
height 500px
|
||||
background-size cover
|
||||
overflow hidden
|
||||
display inline-block
|
||||
vertical-align top
|
||||
//border-radius 3px
|
||||
padding 10px
|
||||
.bookmark-info
|
||||
display flex
|
||||
align-items center
|
||||
justify-content center
|
||||
width 100%
|
||||
height 100%
|
||||
label
|
||||
display block
|
||||
font-size .5em
|
||||
padding 10px
|
||||
background $primary
|
||||
border-radius 5px
|
||||
#paginate-control
|
||||
width 100%
|
||||
height 300px
|
||||
background lightness($primary, 30%)
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
#paginate
|
||||
|
||||
margin 0 auto
|
||||
a, label
|
||||
display inline-block
|
||||
vertical-align top
|
||||
label
|
||||
padding 5px
|
||||
color $tertiary
|
||||
font-size 2.2em
|
||||
a
|
||||
padding 20px
|
||||
margin-top 4px
|
||||
|
||||
|
||||
/**
|
||||
-------------------------------
|
||||
-- Responsive
|
||||
-------------------------------
|
||||
**/
|
||||
|
||||
@media only screen and (max-width: 768px)
|
||||
#bm-content
|
||||
#bookmark-display
|
||||
.bookmark-list
|
||||
.bookmark-entry
|
||||
width 100%
|
||||
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
#work-content
|
||||
width 100%
|
||||
max-width 1024px
|
||||
margin 0 auto
|
||||
#header
|
||||
#header-two
|
||||
p
|
||||
font 400 1.5em $bodyType
|
||||
span
|
||||
color $secondary
|
||||
#work-display
|
||||
padding 0
|
||||
margin 0 0 40px 0
|
||||
opacity 0
|
||||
|
||||
|
||||
#work-list
|
||||
|
||||
.work-item
|
||||
width 50%
|
||||
height 300px
|
||||
display inline-block
|
||||
vertical-align top
|
||||
background-size cover
|
||||
background-color $tertiary
|
||||
color $tertiary
|
||||
span
|
||||
font 600 .7em $titleType
|
||||
|
||||
#work-contact
|
||||
#contact-form
|
||||
opacity 1
|
||||
label
|
||||
font 600 .8em $titleType
|
||||
color $highlight
|
||||
margin 0 0 15px 0
|
||||
display block
|
||||
#request-form
|
||||
input[type=email], input[type=password], input[type=text]
|
||||
width 100%
|
||||
margin 0 10px 10px 0
|
||||
|
||||
select
|
||||
width 100%
|
||||
margin-bottom: 10px;
|
||||
|
||||
textarea
|
||||
width: 100%
|
||||
#contact-info
|
||||
label#request-status
|
||||
font 600 .8em $titleType
|
||||
color $highlight
|
||||
margin 0 0 15px 0
|
||||
display block
|
||||
text-transform uppercase
|
||||
p
|
||||
font 400 1em $bodyType
|
||||
color $tertiary
|
||||
i
|
||||
color $highlight
|
||||
|
||||
|
||||
#project-content
|
||||
width 100%
|
||||
max-width 1024px
|
||||
margin 0 auto
|
||||
#project-display
|
||||
padding: 0 20px 20px 20px
|
||||
|
||||
#project-info
|
||||
span
|
||||
font 400 2em $titleType
|
||||
color $white
|
||||
#project-desc
|
||||
font 300 1.2em $bodyType
|
||||
color $tertiary
|
||||
#project-images
|
||||
margin 10px 0 0 0
|
||||
opacity 1
|
||||
.folio-image
|
||||
width 100%
|
||||
margin 0 0 50px 0
|
||||
opacity 0
|
||||
|
||||
/**
|
||||
-------------------------------
|
||||
-- Responsive
|
||||
-------------------------------
|
||||
**/
|
||||
|
||||
@media screen and (max-width: 768px)
|
||||
#work-content
|
||||
#work-list
|
||||
.work-item
|
||||
width 100%
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
importScripts('./workbox-sw.js');
|
||||
|
||||
if (workbox) {
|
||||
//console.log(`Yay! Workbox is loaded 🎉`);
|
||||
} else {
|
||||
//console.log(`Boo! Workbox didn't load 😬`);
|
||||
}
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('.*\.js'),
|
||||
workbox.strategies.networkFirst({
|
||||
cacheName: 'script'
|
||||
})
|
||||
);
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('.*\.css'),
|
||||
workbox.strategies.networkFirst({
|
||||
cacheName: 'style'
|
||||
})
|
||||
);
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('.*\.(?:png|jpg|jpeg|svg|gif)'),
|
||||
workbox.strategies.networkFirst({
|
||||
cacheName: 'images'
|
||||
})
|
||||
);
|
||||
|
||||
workbox.routing.registerRoute(
|
||||
new RegExp('/@/dashboard'),
|
||||
workbox.strategies.networkFirst({
|
||||
cacheName: 'pages'
|
||||
}));
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
var workbox=function(){"use strict";try{self.workbox.v["workbox:sw:3.6.3"]=1}catch(t){}const t="https://storage.googleapis.com/workbox-cdn/releases/3.6.3",e={backgroundSync:"background-sync",broadcastUpdate:"broadcast-cache-update",cacheableResponse:"cacheable-response",core:"core",expiration:"cache-expiration",googleAnalytics:"google-analytics",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};return new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?"dev":"prod",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.e=this.t.debug?"dev":"prod"}skipWaiting(){self.addEventListener("install",()=>self.skipWaiting())}clientsClaim(){self.addEventListener("activate",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&""===(s=r.split("/"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join("/")}}}();
|
||||
|
||||
//# sourceMappingURL=workbox-sw.js.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"names":[],"mappings":"","sources":["packages/workbox-sw/browser.mjs"],"sourcesContent":["var workbox=function(){\"use strict\";try{self.workbox.v[\"workbox:sw:3.6.3\"]=1}catch(t){}const t=\"https://storage.googleapis.com/workbox-cdn/releases/3.6.3\",e={backgroundSync:\"background-sync\",broadcastUpdate:\"broadcast-cache-update\",cacheableResponse:\"cacheable-response\",core:\"core\",expiration:\"cache-expiration\",googleAnalytics:\"google-analytics\",navigationPreload:\"navigation-preload\",precaching:\"precaching\",rangeRequests:\"range-requests\",routing:\"routing\",strategies:\"strategies\",streams:\"streams\"};return new class{constructor(){return this.v={},this.t={debug:\"localhost\"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.e=this.t.debug?\"dev\":\"prod\",this.s=!1,new Proxy(this,{get(t,s){if(t[s])return t[s];const o=e[s];return o&&t.loadModule(`workbox-${o}`),t[s]}})}setConfig(t={}){if(this.s)throw new Error(\"Config must be set before accessing workbox.* modules\");Object.assign(this.t,t),this.e=this.t.debug?\"dev\":\"prod\"}skipWaiting(){self.addEventListener(\"install\",()=>self.skipWaiting())}clientsClaim(){self.addEventListener(\"activate\",()=>self.clients.claim())}loadModule(t){const e=this.o(t);try{importScripts(e),this.s=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}o(e){if(this.t.modulePathCb)return this.t.modulePathCb(e,this.t.debug);let s=[t];const o=`${e}.${this.e}.js`,r=this.t.modulePathPrefix;return r&&\"\"===(s=r.split(\"/\"))[s.length-1]&&s.splice(s.length-1,1),s.push(o),s.join(\"/\")}}}();\n"],"file":"workbox-sw.js"}
|
Loading…
Reference in a new issue