From c2de21b9b1dad9c98944eba228fc9ad31c072e0c Mon Sep 17 00:00:00 2001 From: Ro Date: Fri, 9 Nov 2018 12:44:13 -0500 Subject: [PATCH] added db migration functionality, added published and featured to post data model --- .gitignore | 3 + .sequelizerc | 8 + brain/models/Post.js | 59 +- brain/models/User.js | 25 - brain/models/index.js | 40 +- brain/routes/back/index.js | 55 +- config/config.json.example | 30 + .../20181109165352-clip-featured-to-post.js | 21 + .../20181109173027-clip-published-to-post.js | 21 + package-lock.json | 594 +++++++++++++++++- package.json | 1 + themes/dash/assets/css/dash.css | 4 +- themes/dash/assets/js/dash.min.js | 4 +- themes/dash/assets/js/dash.min.map | 2 +- themes/dash/partials/front.pug | 2 +- themes/dash/src/com/controllers/DashEntry.jsx | 6 +- .../src/com/tools/utilities/TextEditor.jsx | 2 +- themes/dash/src/styles/main/_entries.styl | 2 +- themes/dash/src/styles/main/_structure.styl | 2 +- 19 files changed, 745 insertions(+), 136 deletions(-) create mode 100644 .sequelizerc create mode 100644 config/config.json.example create mode 100644 config/migrations/20181109165352-clip-featured-to-post.js create mode 100644 config/migrations/20181109173027-clip-published-to-post.js diff --git a/.gitignore b/.gitignore index 4ea2b14..56a26b7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,8 @@ config.development.json *.swp /_migrations/ /config.json +config/config.json +brain/models/_backup/ /_maintenance/ +/migrations *.DS_Store diff --git a/.sequelizerc b/.sequelizerc new file mode 100644 index 0000000..c04bc18 --- /dev/null +++ b/.sequelizerc @@ -0,0 +1,8 @@ +const path = require('path'); + +module.exports = { + 'config': path.resolve('config', 'config.json'), + 'models-path': path.resolve('brain', 'models'), + 'seeders-path': path.resolve('config', 'seeders'), + 'migrations-path': path.resolve('config', 'migrations') +} \ No newline at end of file diff --git a/brain/models/Post.js b/brain/models/Post.js index a43421b..6a37088 100644 --- a/brain/models/Post.js +++ b/brain/models/Post.js @@ -37,7 +37,8 @@ module.exports = function (sequelize, DataTypes) { page: { type: DataTypes.BOOLEAN, unique: false, - allowNull: true + allowNull: true, + defaultValue: false }, author_id: { type: DataTypes.INTEGER, @@ -45,9 +46,21 @@ module.exports = function (sequelize, DataTypes) { allowNull: true }, origin_date: { - type: DataTypes.INTEGER, + 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, @@ -77,45 +90,3 @@ module.exports = function (sequelize, DataTypes) { return Post; }; - -/** - - -post: { - "id": "59711abc12d3ab0bd61c3abc", - "uuid": "ec630e45-3342-4d7f-a24c-e448263c975b", - "title": "Welcome to Ghost", - "slug": "welcome-to-ghost", - "mobiledoc": "{\"version\":\"0.3.1\",\"markups\":[],\"atoms\":[],\"cards\":[[\"card-markdown\",{\"cardName\":\"card-markdown\",\"markdown\":\"You're live nice!\"}]],\"sections\":[[10,0]]}", - "html": "

You're live! Nice.

", - "plaintext": "You're live! Nice.", - "amp": "Not what you think!", - "feature_image": "/content/images/2014/12/my-image.png", - "featured": false, - "page": false, - "status": "published", - "locale": null, - "visibility": "public", - "meta_title": null, - "meta_description": null, - "author_id": "59711abc78f1ab0bd61c3efg", - "created_at": "2014-04-15T12:36:28.353Z", - "created_by": "59711abc78f1ab0bd61c3efg", - "updated_at": "2014-04-15T12:36:28.353Z", - "updated_by": "59711abc78f1ab0bd61c3efg", - "published_at": "2014-04-15T12:36:28.363Z", - "published_by": "59711abc78f1ab0bd61c3efg", - "custom_excerpt": null, - "codeinjection_head": null, - "codeinjection_foot": null, - "og_image": null, - "og_title": null, - "og_description": null, - "twitter_image": null, - "twitter_title": null, - "twitter_description": null -} - - - -**/ diff --git a/brain/models/User.js b/brain/models/User.js index 45656af..7ce96b1 100644 --- a/brain/models/User.js +++ b/brain/models/User.js @@ -53,28 +53,3 @@ module.exports = function (sequelize, DataTypes) { return User; }; - -/** -var User = new mongoose.Schema({ - avatar: String, - handle: String, - firstname: String, - lastname: String, - email: String, - password: String, - bio: { - type: String, - default: 'I\'m actually really interesting, but, alas, I am kind of lazy.' - }, - role: { - type: String, - default: 'client' - }, - created_at: Date, - last_login: Date -}, { - collection: 'users' -}); - -module.exports = mongoose.model('User', User); -**/ diff --git a/brain/models/index.js b/brain/models/index.js index 14905e6..802761f 100644 --- a/brain/models/index.js +++ b/brain/models/index.js @@ -1,33 +1,19 @@ 'use strict'; -var fs = require('fs'); -var path = require('path'); -var Sequelize = require('sequelize'); -var basename = path.basename(__filename); -var env = process.env.NODE_ENV || 'development'; -var config = require('../../config.json')[env]; -var db = {}; +const fs = require('fs'); +const path = require('path'); +const Sequelize = require('sequelize'); +const basename = path.basename(__filename); +const env = process.env.NODE_ENV || 'development'; +const config = require(__dirname + '/../../config/config.json')[env]; +const db = {}; - -//console.log(config.database); - -/** +let sequelize; if (config.use_env_variable) { - var sequelize = new Sequelize(process.env[config.use_env_variable], config); + sequelize = new Sequelize(process.env[config.use_env_variable], config); } else { - var sequelize = new Sequelize(config.local.database, config.local.user, config.local.password, config.local.options); + sequelize = new Sequelize(config.database, config.username, config.password, config); } -**/ -var sequelize = new Sequelize(config.database, config.user, config.password, config.options); - -/** -sequelize.authenticate().then(() => { - console.log("Success!"); -}).catch((err) => { - console.log(""+err); -}); -**/ - fs .readdirSync(__dirname) @@ -35,7 +21,7 @@ fs return (file.indexOf('.') !== 0) && (file !== basename) && (file.slice(-3) === '.js'); }) .forEach(file => { - var model = sequelize['import'](path.join(__dirname, file)); + const model = sequelize['import'](path.join(__dirname, file)); db[model.name] = model; }); @@ -46,6 +32,6 @@ Object.keys(db).forEach(modelName => { }); db.sequelize = sequelize; -//db.Sequelize = Sequelize; +db.Sequelize = Sequelize; -module.exports = db; \ No newline at end of file +module.exports = db; diff --git a/brain/routes/back/index.js b/brain/routes/back/index.js index 747827c..e0a9a56 100644 --- a/brain/routes/back/index.js +++ b/brain/routes/back/index.js @@ -14,22 +14,29 @@ router.get('/', function (req, res) { if (req.session.user) loggedIn = true; - Models.Post.findAll({ - order: [ - ['id', 'DESC'] - ], - limit: 10 - }).then(function (posts) { - res.render('dash/index', { - title: 'Dashboard', - user_status: loggedIn, - items: posts - }); - }).then(function (value) { - //console.log(value); - }).catch(function (err) { - //next(err); - }) + console.log('SYNCING'); + Models.Post.sync().then(f => { + Models.Post.findAll({ + order: [ + ['id', 'DESC'] + ], + limit: 10 + }).then(function (posts) { + res.render('dash/index', { + title: 'Dashboard', + user_status: loggedIn, + items: posts + }); + }).then(function (value) { + //console.log(value); + }).catch(function (err) { + //next(err); + }) + }).catch(err => { + console.log("ERR: " + err); + }) + + }); //-------------------------- @@ -52,8 +59,8 @@ router.get('/settings/', function (req, res) { //-------------------------- router.get('/entries/:page?', function (req, res) { var pageNum = req.params.page; - if(pageNum == "" || pageNum == null) pageNum = 1; - var offset = ((pageNum*5) -5); + if (pageNum == "" || pageNum == null) pageNum = 1; + var offset = ((pageNum * 5) - 5); if (req.session.user) { Models.Post.findAll({ order: [ @@ -100,7 +107,7 @@ router.get('/entries/add/new', function (req, res) { res.render('dash/entry-edit', { title: 'Add New Entry', mode: 'admin', - date: DateUtils.getDate('year', new Date())+"-"+DateUtils.getDate('month', new Date())+"-"+DateUtils.getDate('day', new Date()), + date: DateUtils.getDate('year', new Date()) + "-" + DateUtils.getDate('month', new Date()) + "-" + DateUtils.getDate('day', new Date()), edit: false }); } else { @@ -123,14 +130,16 @@ router.get('/entries/edit/:id', function (req, res) { featured = featured_img[0].substr(7, featured_img[0].length); let pretty = hljs.highlight('markdown', entry.entry_plaintext).value; - //let newdate = new Date(entry.created_at); - //let formattedDate = newdate.getFullYear()+"-"+newdate.getMonth()+"-"+newdate.getDate(); - let sexydate = DateUtils.getDate('stamp', entry.origin_date) + let sexydate + if (entry.origin_date == "" || entry.origin_date == null) + sexydate = DateUtils.getDate('year', entry.created_at) + "-" + DateUtils.getDate('month', entry.created_at) + "-" + DateUtils.getDate('day', entry.created_at) + else + sexydate = entry.origin_date res.render('dash/entry-edit', { title: 'Edit Entry', mode: 'admin', post: entry, - date:entry.origin_date, + date: sexydate, colored: pretty, html: entry.entry_plaintext, feature: featured, diff --git a/config/config.json.example b/config/config.json.example new file mode 100644 index 0000000..5f6b2d8 --- /dev/null +++ b/config/config.json.example @@ -0,0 +1,30 @@ +{ + "url": "DOMAIN_URL", + "theme": "default", + "development": { + "database": "DATABASE", + "user": "DATABASE_USER", + "password": "DATABASE_PASS", + "dialect": "postgres", + "host": "localhost", + "operatorsAliases": false, + "pool": { + "max": 9, + "min": 0, + "idle": 10000 + } + }, + "production": { + "database": "DATABASE", + "user": "DATABASE_USER", + "password": "DATABASE_PASS", + "operatorsAliases": false, + "host": "localhost", + "dialect": "postgres", + "pool": { + "max": 9, + "min": 0, + "idle": 10000 + } + } +} \ No newline at end of file diff --git a/config/migrations/20181109165352-clip-featured-to-post.js b/config/migrations/20181109165352-clip-featured-to-post.js new file mode 100644 index 0000000..c896c88 --- /dev/null +++ b/config/migrations/20181109165352-clip-featured-to-post.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.addColumn('Posts', 'featured', { + type: Sequelize.BOOLEAN, + unique: false, + allowNull: true, + defaultValue: false + }); + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.removeColumn('Posts', 'featured', { + type: Sequelize.BOOLEAN, + unique: false, + allowNull: true, + defaultValue: false + }); + } +}; \ No newline at end of file diff --git a/config/migrations/20181109173027-clip-published-to-post.js b/config/migrations/20181109173027-clip-published-to-post.js new file mode 100644 index 0000000..8e92bb6 --- /dev/null +++ b/config/migrations/20181109173027-clip-published-to-post.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + up: (queryInterface, Sequelize) => { + return queryInterface.addColumn('Posts', 'published', { + type: Sequelize.BOOLEAN, + unique: false, + allowNull: true, + defaultValue: false + }); + }, + + down: (queryInterface, Sequelize) => { + return queryInterface.removeColumn('Posts', 'published', { + type: Sequelize.BOOLEAN, + unique: false, + allowNull: true, + defaultValue: false + }); + } +}; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e4994ca..0823f0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -832,11 +832,21 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.1.tgz", "integrity": "sha512-i1sl+WCX2OCHeUi9oi7PiCNUtYFrpWhpcx878vpeq/tlZTKzcFdHePlyFHVbWqeuKN0SRPl/9ZFDSTsfv9h7VQ==" }, + "@types/semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ==" + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==" }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, "accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", @@ -910,8 +920,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "ansi-styles": { "version": "3.2.1", @@ -2088,6 +2097,19 @@ "source-map": "~0.6.0" } }, + "cli-color": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-1.4.0.tgz", + "integrity": "sha512-xu6RvQqqrWEo6MPR1eixqGPywhYBHRs653F9jfXB2Hx4jdM/3WxiNE1vppRmxtMIfl16SFYTpYlrnqH/HsK/2w==", + "requires": { + "ansi-regex": "^2.1.1", + "d": "1", + "es5-ext": "^0.10.46", + "es6-iterator": "^2.0.3", + "memoizee": "^0.4.14", + "timers-ext": "^0.1.5" + } + }, "clipboard": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.1.tgz", @@ -2130,6 +2152,11 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, "collection-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", @@ -2164,8 +2191,7 @@ "commander": { "version": "2.19.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", - "dev": true + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" }, "component-emitter": { "version": "1.2.1", @@ -2190,6 +2216,15 @@ "typedarray": "^0.0.6" } }, + "config-chain": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz", + "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==", + "requires": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, "connect-flash": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/connect-flash/-/connect-flash-0.1.1.tgz", @@ -2264,6 +2299,25 @@ "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz", "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } + } + }, "cryptiles": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", @@ -2285,6 +2339,14 @@ "cssom": "0.3.x" } }, + "d": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "requires": { + "es5-ext": "^0.10.9" + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -2522,6 +2584,26 @@ "safer-buffer": "^2.1.0" } }, + "editorconfig": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.2.tgz", + "integrity": "sha512-GWjSI19PVJAM9IZRGOS+YKI8LN+/sjkSjNyvxL5ucqP9/IqtYNXBaQ/6c/hkPNYQHyOHra2KoXZI/JVpuqwmcQ==", + "requires": { + "@types/node": "^10.11.7", + "@types/semver": "^5.5.0", + "commander": "^2.19.0", + "lru-cache": "^4.1.3", + "semver": "^5.6.0", + "sigmund": "^1.0.1" + }, + "dependencies": { + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + } + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2551,6 +2633,26 @@ "brfs": "^1.4.3" } }, + "es5-ext": { + "version": "0.10.46", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.46.tgz", + "integrity": "sha512-24XxRvJXNFwEMpJb3nOkiRJKRoupmjYmOPVlI65Qy2SrtxwOTB+g6ODjBKOtwEHbYrhWRty9xxOWLNdClT2djw==", + "requires": { + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "requires": { + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" + } + }, "es6-promise": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", @@ -2564,6 +2666,26 @@ "es6-promise": "^4.0.3" } }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "requires": { + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2606,6 +2728,29 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "requires": { + "d": "1", + "es5-ext": "~0.10.14" + } + }, + "execa": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", + "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, "expand-brackets": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", @@ -2930,6 +3075,14 @@ } } }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3568,6 +3721,16 @@ "resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.4.2.tgz", "integrity": "sha512-H7cUpwCQSiJmAHM4c/aFu6fUfrhWXW1ncyh8ftxEPMu6AiYkHw9K8br720TGPZJbk5eOH2bynjZD1yPvdDAmag==" }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, "get-uri": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-2.0.2.tgz", @@ -3876,6 +4039,11 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", @@ -3885,6 +4053,11 @@ "loose-envify": "^1.0.0" } }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", @@ -3980,6 +4153,11 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, "is-glob": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", @@ -4048,6 +4226,11 @@ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, "isobject": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", @@ -4059,6 +4242,17 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, + "js-beautify": { + "version": "1.8.8", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.8.8.tgz", + "integrity": "sha512-qVNq7ZZ7ZbLdzorvSlRDadS0Rh5oyItaE95v6I4wbbuSiijxn7SnnsV6dvKlcXuO2jX7lK8tn9fBulx34K/Ejg==", + "requires": { + "config-chain": "~1.1.5", + "editorconfig": "^0.15.0", + "mkdirp": "~0.5.0", + "nopt": "~4.0.1" + } + }, "js-levenshtein": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.4.tgz", @@ -4213,6 +4407,14 @@ "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "^2.0.0" + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -4230,6 +4432,15 @@ "uc.micro": "^1.0.1" } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -4295,6 +4506,14 @@ "yallist": "^2.1.2" } }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "requires": { + "es5-ext": "~0.10.2" + } + }, "magic-string": { "version": "0.22.5", "resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", @@ -4329,6 +4548,14 @@ } } }, + "map-age-cleaner": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", + "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", + "requires": { + "p-defer": "^1.0.0" + } + }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -4366,6 +4593,31 @@ "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, + "mem": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", + "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^1.1.0" + } + }, + "memoizee": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.14.tgz", + "integrity": "sha512-/SWFvWegAIYAO4NQMpcX+gcra0yEZu4OntmUdrBaWrJncxOqAziGFlHxc7yjKVK2uu3lpPW27P27wkR82wA8mg==", + "requires": { + "d": "1", + "es5-ext": "^0.10.45", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.5" + } + }, "memorystore": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/memorystore/-/memorystore-1.6.0.tgz", @@ -4457,6 +4709,11 @@ "mime-db": "~1.37.0" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -4606,6 +4863,16 @@ "resolved": "https://registry.npmjs.org/netmask/-/netmask-1.0.6.tgz", "integrity": "sha1-ICl+idhvb2QA8lDZ9Pa0wZRfzTU=" }, + "next-tick": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, "node-releases": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.0.2.tgz", @@ -4628,6 +4895,15 @@ "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.6.8.tgz", "integrity": "sha512-A3s7EM/426OBIZbLHXq2KkgvmKbn2Xga4m4G+ZUA4IaZvG8PcZXrFh+2E4VaS2o+emhuUVRnzKN2YmpkXQ9qwA==" }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -4637,6 +4913,14 @@ "remove-trailing-separator": "^1.0.1" } }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", @@ -4742,6 +5026,35 @@ "wordwrap": "~1.0.0" } }, + "os-homedir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-locale": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", + "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", + "requires": { + "execa": "^0.10.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, "output-file-sync": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", @@ -4753,6 +5066,42 @@ "mkdirp": "^0.5.1" } }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-is-promise": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + }, "pac-proxy-agent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-3.0.0.tgz", @@ -4823,12 +5172,22 @@ "dev": true, "optional": true }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", @@ -4994,6 +5353,11 @@ "with-callback": "^1.0.2" } }, + "proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=" + }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -5372,6 +5736,16 @@ "tough-cookie": ">=2.3.3" } }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", @@ -5693,6 +6067,78 @@ } } }, + "sequelize-cli": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/sequelize-cli/-/sequelize-cli-5.3.0.tgz", + "integrity": "sha512-XJhpdlDDots1aWAmGurDJr3UFF8BSaRZnAI+qePb0Z83w7m0lrpDEWWtf07qjyjMO5fHzhiENPVKkbzhxmK9cg==", + "requires": { + "bluebird": "^3.5.1", + "cli-color": "^1.2.0", + "fs-extra": "^7.0.0", + "js-beautify": "^1.7.4", + "lodash": "^4.17.5", + "resolve": "^1.5.0", + "umzug": "^2.1.0", + "yargs": "^12.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "decamelize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", + "integrity": "sha512-Ikpp5scV3MSYxY39ymh45ZLEecsTdv/Xj2CaQfI8RLMuwi7XvjX9H/fhraiSuU+C5w5NTDu4ZU72xNiZnurBPg==", + "requires": { + "xregexp": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "xregexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", + "integrity": "sha512-PHyM+sQouu7xspQQwELlGwwd05mXUFqwFYfqPO0cC7x4fxyHnnuetmQr6CjJiafIDoH4MogHb9dOoJzR/Y4rFg==" + }, + "yargs": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.2.tgz", + "integrity": "sha512-e7SkEx6N6SIZ5c5H22RTZae61qtn3PYUE8JYbBFlK9sYmh3DMQ6E5ygtaG/2BW0JZi4WGgTR2IV5ChqlqrDGVQ==", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^2.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^10.1.0" + } + } + } + }, "serve-favicon": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.5.0.tgz", @@ -5728,6 +6174,11 @@ "send": "0.16.2" } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", @@ -5761,11 +6212,34 @@ "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", "integrity": "sha1-QV9CcC1z2BAzApLMXuhurhoRoXA=" }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, "shimmer": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shimmer/-/shimmer-1.2.0.tgz", "integrity": "sha512-xTCx2vohXC2EWWDqY/zb4+5Mu28D+HYNSOuFzsyRDRvI/e1ICb69afwaUwfjr+25ZXldbOLyp+iDUZHq8UnTag==" }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, "slash": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", @@ -6056,6 +6530,30 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + } + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -6073,11 +6571,15 @@ "version": "3.0.1", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, + "strip-eof": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6127,6 +6629,15 @@ "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", "integrity": "sha1-+qDp0jDFGsyVyhOjYawFyn4EVT0=" }, + "timers-ext": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", + "integrity": "sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ==", + "requires": { + "es5-ext": "~0.10.46", + "next-tick": "1" + } + }, "tiny-date-picker": { "version": "3.2.6", "resolved": "https://registry.npmjs.org/tiny-date-picker/-/tiny-date-picker-3.2.6.tgz", @@ -6290,6 +6801,17 @@ "random-bytes": "~1.0.0" } }, + "umzug": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/umzug/-/umzug-2.1.0.tgz", + "integrity": "sha512-BgT+ekpItEWaG+3JjLLj6yVTxw2wIH8Cr6JyKYIzukWAx9nzGhC6BGHb/IRMjpobMM1qtIrReATwLUjKpU2iOQ==", + "requires": { + "babel-runtime": "^6.23.0", + "bluebird": "^3.4.1", + "lodash": "^4.17.0", + "resolve": "^1.0.0" + } + }, "underscore": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", @@ -6518,6 +7040,19 @@ "webidl-conversions": "^4.0.2" } }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, "window-size": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", @@ -6572,6 +7107,35 @@ "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -6606,6 +7170,11 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, "yallist": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", @@ -6621,6 +7190,21 @@ "decamelize": "^1.0.0", "window-size": "0.1.0" } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "requires": { + "camelcase": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + } + } } } } diff --git a/package.json b/package.json index d4f4ccd..83c21a6 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "sanitize-html": "^1.19.1", "scrape-metadata": "^2.0.0", "sequelize": "^4.37.6", + "sequelize-cli": "^5.3.0", "serve-favicon": "latest", "tiny-date-picker": "^3.2.6", "uuid": "^3.2.1" diff --git a/themes/dash/assets/css/dash.css b/themes/dash/assets/css/dash.css index ce83f63..377f082 100644 --- a/themes/dash/assets/css/dash.css +++ b/themes/dash/assets/css/dash.css @@ -1617,7 +1617,7 @@ svg.icons { .main-container section header #header-wrapper #header-two label#the-title { font-family: 'Apercu-Mono'; font-size: 2em; - color: #374857; + color: #f5ab35; text-decoration: none; display: block; } @@ -2174,7 +2174,7 @@ select { background: #344453; } #entries-index #entries-index-wrapper #entries-list { - color: #32302f; + color: #f2f1ef; } #entries-index #entries-index-wrapper #entries-list a.entry-list-link { display: inline-block; diff --git a/themes/dash/assets/js/dash.min.js b/themes/dash/assets/js/dash.min.js index 56cfe0e..7c373de 100644 --- a/themes/dash/assets/js/dash.min.js +++ b/themes/dash/assets/js/dash.min.js @@ -1459,7 +1459,7 @@ function (_EventEmitter) { break; case DataEvent.POST_ADDED: - window.location = "/@/dashboard/entries/edit/" + data; + // do nothing break; case EditorEvent.EDITOR_UPLOAD_POST_IMAGE: @@ -2900,6 +2900,8 @@ function () { var note = JSON.parse(response['response']['request'].response); _this2.editor.notify(note.message, note.postID); + + if (note.message == DataEvent.POST_ADDED) window.location = "/@/dashboard/entries/edit/" + note.postID; }).catch(function (err) { console.log(err); }); diff --git a/themes/dash/assets/js/dash.min.map b/themes/dash/assets/js/dash.min.map index 2f152a6..26f5a1f 100644 --- a/themes/dash/assets/js/dash.min.map +++ b/themes/dash/assets/js/dash.min.map @@ -1 +1 @@ -{"version":3,"sources":["tools/events/EventEmitter.jsx","tools/events/DataEvent.jsx","tools/utilities/DataUtils.jsx","tools/effects/Animate.jsx","tools/utilities/StringUtils.jsx","tasks/EntryTasks.jsx","tools/events/EditorEvent.jsx","tools/utilities/DateUtils.jsx","../../src/mirror.js","../../src/utils.js","../../src/input.js","../../src/editable.js","../../src/main.js","tools/utilities/TextEditor.jsx","../../../../node_modules/tiny-date-picker/dist/tiny-date-picker.js","controllers/DashEntry.jsx","controllers/DisplayManager.jsx","Base.jsx","Start.jsx"],"names":["EventEmitter","listeners","Map","label","callback","has","set","get","push","isFunction","obj","index","length","reduce","i","listener","splice","args","forEach","REQUEST_GOOD","REQUEST_LAME","IMG_REQUEST_GOOD","IMG_REQUEST_LAME","SETTINGS_LOADED","HTML_LOADED","ARCHIVES_JSON_LOADED","ARCHIVES_PAGE_LOADED","ARCHIVES_ENTRY_LOADED","PROJECT_UPDATED","PROJECT_ADDED","PROJECTS_SORTED","POST_IMAGE_ADDED","POST_ERROR","POST_ADDED","POST_UPDATED","POST_DELETED","DataEvent","REQUEST_TYPE_POST","REQUEST_TYPE_GET","REQUEST_TYPE_PUT","REQUEST_TYPE_DELETE","CONTENT_TYPE_JSON","CONTENT_TYPE_FORM","DataUtils","self","requestURL","eventType","requestType","contentType","requestData","Promise","resolve","reject","request","XMLHttpRequest","upload","onprogress","handleLoadProgress","open","onload","e","status","setRequestHeader","send","JSON","stringify","url","responseType","response","Error","statusText","onerror","src","body","document","querySelector","myImage","Image","crossOrigin","imgLoad","then","imageURL","window","URL","createObjectURL","percentComplete","Math","ceil","loaded","total","Animate","properties","animation","anime","StringUtils","string","clean","replace","toLowerCase","quote_style","optTemp","noquotes","toString","OPTS","concat","ENT_HTML_QUOTE_SINGLE","EntryTasks","folio","dataUtils","edit","uploadFiles","postData","FormData","files","file","type","match","append","name","txt","createElement","innerHTML","getElementById","value","cleanString","postURL","postEventType","postID","getAttribute","catch","err","re","valid","entry_form","title","price","description","EDITOR_DELETE","EDITOR_UPLOAD_POST_IMAGE","EDITOR_SAVE","EDITOR_UPDATE","EditorEvent","DateUtils","time","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getTime","seconds","date","rawdate","day","String","getUTCDate","month","getUTCMonth","year","getUTCFullYear","hour","getUTCHours","minute","getUTCMinutes","getUTCSeconds","millisecond","getUTCMilliseconds","offset","getTimezoneOffset","attributes","createMirror","element","html","mirror","mirrorCss","css","tagName","attr","getComputedStyle","initialize","styles","keys","style","key","parentNode","insertBefore","nextSibling","rect","marker","ownerDocument","boundingRect","offsetLeft","offsetTop","offsetHeight","removeChild","isContentEditable","contentEditable","getContext","settings","customPos","iframe","noShadowCaret","contentWindow","contentDocument","getOffset","ctx","win","doc","getBoundingClientRect","docEl","documentElement","scrollLeft","pageXOffset","scrollTop","pageYOffset","top","left","isObject","createInputCaret","getPos","selectionStart","setPos","pos","setSelectionRange","elementOffset","position","getPosition","height","format","val","undefined","startRange","slice","endRange","createEditableCaret","sel","getSelection","found","find","parent","childNodes","node","nodeType","range","createRange","setStart","removeAllRanges","addRange","getRange","hasCustomPos","endOffset","endContainer","clonedRange","cloneRange","fixedPosition","setEnd","width","detach","shadowCaret","createTextNode","insertNode","selectNode","clientTop","clientLeft","inputOffset","rangeCount","getRangeAt","selectNodeContents","createCaret","options","caret","TextEditor","textEditor","scrollLimit","hljs","initHighlightingOnLoad","dateUtils","fixLimit","caretPos","setInputs","addEventListener","f","refresh","editorButtons","querySelectorAll","handleEditorOption","spiffed","highlight","innerText","temp","data","classList","add","remove","setTimeout","location","pulled","deleteContents","preventDefault","target","id","emitEvent","Entry","reframe","editor","addListener","handleEditorOptions","handlePostImageAdd","mode","start","object","targets","duration","opacity","easing","complete","display","visibility","handleDragOver","handleDrop","handleClicked","click","submitPost","note","parse","notify","message","console","log","confirm","deletePost","stopPropagation","dataTransfer","dropEffect","reader","FileReader","theFile","span","result","escape","join","appendChild","readAsDataURL","DisplayManager","currentDisplay","urlPieces","split","chooseDisplay","section","page","Base","admin","displayManager","base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAMA;;;AAGF;AACA;AACA;AACA,0BACA;AAAA;;AACI,SAAKC,SAAL,GAAiB,IAAIC,GAAJ,EAAjB;AACH,IACD;AACA;AACA;;;;;gCACYC,OAAOC,UAAU;AACzB,WAAKH,SAAL,CAAe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qK,SAAL,CAAelK,WAAW,CAACF,WAA3B;AACA;;AACJ,eAAK,eAAL;AACA,eAAK,eAAL;AACI,iBAAKoK,SAAL,CAAelK,WAAW,CAACD,aAA3B;AACJ;;AACA,eAAK,aAAL;AACIyG,YAAAA,KAAK,CAACiB,UAAN,CAAiB5L,QAAQ,CAAC2L,cAAT,CAAwB,MAAMqC,MAAN,GAAe,mBAAvC,CAAjB;AACA;;AACJ,eAAK,eAAL;AACI,iBAAKK,SAAL,CAAelK,WAAW,CAACJ,aAA3B;AACA;;AACJ;AACI;AACA;AAvCR;AAyCH;;AACD,WAAKmJ,OAAL;AACH;;;;EA3IoB5R;;eA6IViR;;;;;ACvJf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AAG,IAAIH,aAAJ,EAAX;AACH,CAHD,EAGG,KAHH","file":"dash.min.map","sourceRoot":"../../src/com","sourcesContent":["class EventEmitter\n{\n\n //--------------------------\n // constructor\n //--------------------------\n constructor()\n {\n this.listeners = new Map();\n }\n //--------------------------\n // methods\n //--------------------------\n addListener(label, callback) {\n this.listeners.has(label) || this.listeners.set(label, []);\n this.listeners.get(label).push(callback);\n }\n\n removeListener(label, callback) {\n var isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n\n var listeners = this.listeners.get(label),\n index;\n\n if (listeners && listeners.length) {\n index = listeners.reduce((i, listener, index) => {\n return (isFunction(listener) && listener === callback)\n ? i = index\n : i;\n }, -1);\n\n if (index > -1) {\n listeners.splice(index, 1);\n this.listeners.set(label, listeners);\n return true;\n }\n }\n return false;\n }\n\n emitEvent(label, ...args) {\n var listeners = this.listeners.get(label);\n if (listeners && listeners.length) {\n listeners.forEach((listener) => {\n listener(...args);\n });\n return true;\n }\n return false;\n }\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default EventEmitter\n","export const REQUEST_GOOD = 'requestGood';\nexport const REQUEST_LAME = 'requestLame';\nexport const IMG_REQUEST_GOOD = 'imgRequestGood';\nexport const IMG_REQUEST_LAME = 'imgRequestLame';\nexport const SETTINGS_LOADED = 'dataLoaded';\nexport const HTML_LOADED = 'htmlLoaded';\nexport const ARCHIVES_JSON_LOADED = 'archivesJSONLoaded';\nexport const ARCHIVES_PAGE_LOADED = 'archivesPAGELoaded';\nexport const ARCHIVES_ENTRY_LOADED = 'archivesEntryLoaded';\nexport const PROJECT_UPDATED = 'projectUpdated';\nexport const PROJECT_ADDED = 'projectAdded';\nexport const PROJECTS_SORTED = 'projectsSorted';\nexport const POST_IMAGE_ADDED = 'postImageAdded';\nexport const POST_ERROR = 'postError';\nexport const POST_ADDED = 'postAdded';\nexport const POST_UPDATED = 'postUpdated';\nexport const POST_DELETED = 'postImageAdded';\n\nclass DataEvent\n{\n\n //--------------------------\n // methods\n //--------------------------\n\n\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default new DataEvent\n","export const REQUEST_TYPE_POST = \"POST\";\nexport const REQUEST_TYPE_GET = \"GET\";\nexport const REQUEST_TYPE_PUT = \"PUT\";\nexport const REQUEST_TYPE_DELETE = \"DELETE\";\nexport const CONTENT_TYPE_JSON = 'json';\nexport const CONTENT_TYPE_FORM = 'x-www-form-urlencoded';\nimport EventEmitter from '../events/EventEmitter.jsx';\nimport * as DataEvent from '../events/DataEvent.jsx';\nclass DataUtils extends EventEmitter {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n super();\n var self = this;\n }\n //--------------------------\n // methods\n //--------------------------\n request(requestURL, eventType, requestType = REQUEST_TYPE_GET, contentType = CONTENT_TYPE_JSON, requestData = null) {\n var self = this;\n return new Promise(function(resolve, reject) {\n var request = new XMLHttpRequest();\n request.upload.onprogress = self.handleLoadProgress;\n request.open(requestType, requestURL, true);\n request.onload = function(e) {\n if (request.status == 200) {\n resolve({\n request,\n eventType\n });\n } else {\n reject({\n request,\n eventType\n });\n }\n ;\n };\n if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {\n switch (contentType) {\n case CONTENT_TYPE_JSON:\n request.setRequestHeader(\"Content-type\", \"application/\" + contentType);\n request.send(JSON.stringify(requestData));\n break;\n case CONTENT_TYPE_FORM:\n request.send(requestData);\n break;\n }\n } else {\n request.send();\n }\n })\n }\n imgLoad(url) {\n 'use strict';\n // Create new promise with the Promise() constructor;\n // This has as its argument a function with two parameters, resolve and reject\n return new Promise(function(resolve, reject) {\n // Standard XHR to load an image\n var request = new XMLHttpRequest();\n request.open('GET', url);\n request.responseType = 'blob';\n // When the request loads, check whether it was successful\n request.onload = function() {\n if (request.status === 200) {\n // If successful, resolve the promise by passing back the request response\n resolve(request.response);\n } else {\n // If it fails, reject the promise with a error message\n reject(new Error('Image didn\\'t load successfully; error code:' + request.statusText));\n }\n };\n request.onerror = function() {\n // Also deal with the case when the entire request fails to begin with\n // This is probably a network error, so reject the promise with an appropriate message\n reject(new Error('There was a network error.'));\n };\n // Send the request\n request.send();\n });\n }\n loadImage(src) {\n 'use strict';\n let self = this;\n return new Promise(function(resolve, reject) {\n // Get a reference to the body element, and create a new image object\n var body = document.querySelector('body'),\n myImage = new Image();\n myImage.crossOrigin = \"\"; // or \"anonymous\"\n // Call the function with the URL we want to load, but then chain the\n // promise then() method on to the end of it. This contains two callbacks\n self.imgLoad(src).then(function(response) {\n // The first runs when the promise resolves, with the request.reponse specified within the resolve() method.\n var imageURL = window.URL.createObjectURL(response);\n resolve(imageURL);\n //$('background-content').setStyle('background-image', 'url('+imageURL+')') //myImage.src = imageURL;\n //console.log(imageURL);\n //body.appendChild(myImage);\n // The second runs when the promise is rejected, and logs the Error specified with the reject() method.\n }, function(Error) {\n reject(Error)\n });\n });\n }\n //--------------------------\n // event handlers\n //--------------------------\n handleLoadProgress(e) {\n var percentComplete = Math.ceil((e.loaded / e.total) * 100);\n //console.log(percentComplete);\n }\n}\nexport default DataUtils;\n","import EventEmitter from '../events/EventEmitter.jsx';;\n\nclass Animate extends EventEmitter {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n super();\n }\n //--------------------------\n // methods\n //--------------------------\n object(properties) {\n var animation = anime(\n properties\n );\n //animation.start(properties);\n }\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default Animate\n","class StringUtils\n{\n\n //--------------------------\n // constructor\n //--------------------------\n constructor()\n {}\n //--------------------------\n // methods\n //--------------------------\n cleanString(string)\n {\n var clean = string.replace(/(^\\-+|[^a-zA-Z0-9\\/_| -]+|\\-+$)/g, '').toLowerCase().replace(/[\\/_| -]+/g, '-');\n return clean;\n }\n\n decodeHTML(string, quote_style) {\n var optTemp = 0,\n i = 0,\n noquotes = false;\n if (typeof quote_style === 'undefined') {\n quote_style = 2;\n }\n string = string.toString().replace(/</g, '<').replace(/>/g, '>');\n var OPTS = {\n 'ENT_NOQUOTES': 0,\n 'ENT_HTML_QUOTE_SINGLE': 1,\n 'ENT_HTML_QUOTE_DOUBLE': 2,\n 'ENT_COMPAT': 2,\n 'ENT_QUOTES': 3,\n 'ENT_IGNORE': 4\n };\n if (quote_style === 0) {\n noquotes = true;\n }\n if (typeof quote_style !== 'number') { // Allow for a single string or an array of string flags\n quote_style = [].concat(quote_style);\n for (i = 0; i < quote_style.length; i++) {\n // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4\n if (OPTS[quote_style[i]] === 0) {\n noquotes = true;\n } else if (OPTS[quote_style[i]]) {\n optTemp = optTemp | OPTS[quote_style[i]];\n }\n }\n quote_style = optTemp;\n }\n if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) {\n string = string.replace(/�*39;/g, \"'\"); // PHP doesn't currently escape if more than one 0, but it should\n // string = string.replace(/'|�*27;/g, \"'\"); // This would also be useful here, but not a part of PHP\n }\n if (!noquotes) {\n string = string.replace(/"/g, '\"');\n }\n // Put this in last place to avoid escape being double-decoded\n string = string.replace(/&/g, '&');\n return string;\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default StringUtils\n","import DataUtils, { REQUEST_TYPE_GET, REQUEST_TYPE_PUT, REQUEST_TYPE_POST, REQUEST_TYPE_DELETE, CONTENT_TYPE_JSON, CONTENT_TYPE_FORM } from '../tools/utilities/DataUtils';\nimport * as DataEvent from '../tools/events/DataEvent';\nimport StringUtils from '../tools/utilities/StringUtils';\nclass EntryTasks {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n var folio = [];\n this.dataUtils = new DataUtils();\n }\n //--------------------------\n // methods\n //--------------------------\n start() {}\n\n submitPost(edit, uploadFiles) {\n let self = this;\n return new Promise(function(resolve, reject) {\n //collect form data\n //if(!this.validateForm())\n var postData = new FormData();\n //let projectImages = document.getElementById('projectImages');\n //var fileSelect = projectImages;\n var files = uploadFiles;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n // Check the file type.\n if (!file.type.match('image.*')) {\n continue;\n }\n // Add the file to the request.\n postData.append('feature_image', file, file.name);\n }\n //var category = document.getElementById(\"content_category\");\n //let project_form = document.forms.namedItem(\"folio-project\");\n var txt = document.createElement(\"textarea\");\n txt.innerHTML = document.getElementById('edit-text-code').innerHTML;\n postData.append(\"title\", document.getElementById('entry_title').value);\n postData.append('slug', new StringUtils().cleanString(document.getElementById('entry_title').value));\n postData.append(\"entry_plaintext\", txt.value);\n postData.append(\"origin_date\", document.getElementById('entry-date').value);\n postData.append(\"tags\", document.getElementById('entry_tags').value);\n let postURL;\n let postEventType;\n if (edit) {\n let postID = document.getElementById('option-update').getAttribute('data-id');\n postURL = \"/api/blog/update/\" + postID;\n postEventType = DataEvent.POST_UPDATED;\n \n } else {\n postURL = \"/api/blog/add\";\n postEventType = DataEvent.POST_ADDED;\n }\n self.dataUtils.request(postURL, postEventType, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, postData)\n .then((response) => {\n resolve({\n response\n })\n }).catch((err) => {\n reject({\n err\n });\n })\n });\n }\n\n deletePost(){\n let self = this;\n let postID = document.getElementById('option-update').getAttribute('data-id');\n return new Promise(function(resolve, reject){\n self.dataUtils.request(\"/api/blog/delete/\" + postID, DataEvent.POST_DELETED, REQUEST_TYPE_POST, CONTENT_TYPE_FORM)\n .then((response) => {\n resolve({\n response\n })\n }).catch((err) => {\n reject({\n err\n });\n })\n })\n this.dataUtils.re\n }\n\n validateForm() {\n let valid = false;\n if (this.entry_form.title.value == \"\" || this.entry_form.price.value == \"\" || this.entry_form.description == \"\") {\n return valid;\n } else {\n valid = true;\n return valid;\n }\n }\n//--------------------------\n// event handlers\n//--------------------------\n}\nexport { EntryTasks as default }\n","export const EDITOR_DELETE = 'editorDelete';\nexport const EDITOR_UPLOAD_POST_IMAGE = 'editorUploadImage';\nexport const EDITOR_SAVE = 'editorSave';\nexport const EDITOR_UPDATE = 'editorUpdate';\n\nclass EditorEvent\n{\n\n //--------------------------\n // methods\n //--------------------------\n\n\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default new EditorEvent\n","class DateUtils {\n\n //--------------------------\n // constructor\n //--------------------------\n constructor() {}\n\n //--------------------------\n // methods\n //--------------------------\n getMKtime() {\n var time = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), new Date().getMinutes(), new Date().getSeconds(), 0).getTime() / 1000;\n return time;\n }\n\n convertMKtime(seconds) {\n var date = new Date(seconds * 1000);\n return date;\n }\n\n getDate(type, rawdate) {\n var day = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCDate()) : String(new Date().getUTCDate()));\n var month = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMonth() + 1) : String(new Date().getUTCMonth() + 1));\n var year = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCFullYear()) : String(new Date().getUTCFullYear()));\n var hour = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCHours()) : String(new Date().getUTCHours()));\n var minute = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMinutes()) : String(new Date().getUTCMinutes()));\n var seconds = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCSeconds()) : String(new Date().getUTCSeconds()));\n var millisecond = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMilliseconds()) : String(new Date().getUTCMilliseconds()));\n var offset = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getTimezoneOffset()) : String(new Date().getTimezoneOffset()));\n if (day.length == 1)\n day = String(\"0\" + day);\n if (month.length == 1)\n month = String(\"0\" + month);\n offset = String(offset / 60);\n if (offset.length == 1)\n offset = String(\"0\" + offset);\n switch (type) {\n case \"day\":\n return day;\n break;\n case \"month\":\n return month;\n break;\n case \"year\":\n return year;\n break;\n case \"stamp\":\n return String(year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + minute + \":\" + seconds + \".\" + millisecond + \"-\" + (offset));\n break\n default:\n return String(year + \"-\" + month + \"-\" + day);\n break;\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n}\n\nexport default DateUtils","const attributes = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'borderTopWidth',\n 'boxSizing',\n 'fontFamily',\n 'fontSize',\n 'fontWeight',\n 'height',\n 'letterSpacing',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'outlineWidth',\n 'overflow',\n 'overflowX',\n 'overflowY',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'textAlign',\n 'textOverflow',\n 'textTransform',\n 'whiteSpace',\n 'wordBreak',\n 'wordWrap',\n];\n\n/**\n * Create a mirror\n *\n * @param {Element} element The element\n * @param {string} html The html\n *\n * @return {object} The mirror object\n */\nconst createMirror = (element, html) => {\n\n /**\n * The mirror element\n */\n const mirror = document.createElement('div');\n\n /**\n * Create the CSS for the mirror object\n *\n * @return {object} The style object\n */\n const mirrorCss = () => {\n const css = {\n position: 'absolute',\n left: -9999,\n top: 0,\n zIndex: -2000\n };\n\n if (element.tagName === 'TEXTAREA') {\n attributes.push('width');\n }\n\n attributes.forEach((attr) => {\n css[attr] = getComputedStyle(element)[attr];\n });\n\n return css;\n };\n\n /**\n * Initialize the mirror\n *\n * @param {string} html The html\n *\n * @return {void}\n */\n const initialize = (html) => {\n const styles = mirrorCss();\n Object.keys(styles).forEach(key => {\n mirror.style[key] = styles[key];\n });\n mirror.innerHTML = html;\n element.parentNode.insertBefore(mirror, element.nextSibling);\n };\n\n /**\n * Get the rect\n *\n * @return {Rect} The bounding rect\n */\n const rect = () => {\n const marker = mirror.ownerDocument.getElementById('caret-position-marker');\n const boundingRect = {\n left: marker.offsetLeft,\n top: marker.offsetTop,\n height: marker.offsetHeight\n };\n mirror.parentNode.removeChild(mirror);\n\n return boundingRect;\n };\n\n initialize(html);\n\n return {\n rect,\n };\n};\n\nexport default createMirror;\n","/**\n * Check if a DOM Element is content editable\n *\n * @param {Element} element The DOM element\n *\n * @return {bool} If it is content editable\n */\nexport const isContentEditable = (element) => !!(\n element.contentEditable &&\n element.contentEditable === 'true'\n);\n\n/**\n * Get the context from settings passed in\n *\n * @param {object} settings The settings object\n *\n * @return {object} window and document\n */\nexport const getContext = (settings = {}) => {\n const { customPos, iframe, noShadowCaret } = settings;\n if (iframe) {\n return {\n iframe,\n window: iframe.contentWindow,\n document: iframe.contentDocument || iframe.contentWindow.document,\n noShadowCaret,\n customPos,\n };\n }\n\n return {\n window,\n document,\n noShadowCaret,\n customPos,\n };\n};\n\n/**\n * Get the offset of an element\n *\n * @param {Element} element The DOM element\n * @param {object} ctx The context\n *\n * @return {object} top and left\n */\nexport const getOffset = (element, ctx) => {\n const win = ctx && ctx.window || window;\n const doc = ctx && ctx.document || document;\n const rect = element.getBoundingClientRect();\n const docEl = doc.documentElement;\n const scrollLeft = win.pageXOffset || docEl.scrollLeft;\n const scrollTop = win.pageYOffset || docEl.scrollTop;\n\n return {\n top: rect.top + scrollTop,\n left: rect.left + scrollLeft\n };\n};\n\n/**\n * Check if a value is an object\n *\n * @param {any} value The value to check\n *\n * @return {bool} If it is an object\n */\nexport const isObject = (value) => typeof value === 'object' && value !== null;\n","import createMirror from './mirror';\nimport { getOffset as elementOffset } from './utils';\n\n/**\n * Create a Input caret object.\n *\n * @param {Element} element The element\n * @param {Object} ctx The context\n */\nconst createInputCaret = (element, ctx) => {\n\n /**\n * Get the current position\n *\n * @returns {int} The caret position\n */\n const getPos = () => {\n return element.selectionStart;\n };\n\n /**\n * Set the position\n *\n * @param {int} pos The position\n *\n * @return {Element} The element\n */\n const setPos = (pos) => {\n element.setSelectionRange(pos, pos);\n\n return element;\n };\n\n /**\n * The offset\n *\n * @param {int} pos The position\n *\n * @return {object} The offset\n */\n const getOffset = (pos) => {\n const rect = elementOffset(element);\n const position = getPosition(pos);\n\n return {\n top: rect.top + position.top + ctx.document.body.scrollTop,\n left: rect.left + position.left + ctx.document.body.scrollLeft,\n height: position.height,\n };\n };\n\n /**\n * Get the current position\n *\n * @param {int} pos The position\n *\n * @return {object} The position\n */\n const getPosition = (pos) => {\n const format = (val) => {\n let value = val.replace(/<|>|`|\"|&/g, '?')\n .replace(/\\r\\n|\\r|\\n/g,'
');\n return value;\n };\n\n if (ctx.customPos || ctx.customPos === 0) {\n pos = ctx.customPos;\n }\n\n const position = pos === undefined ? getPos() : pos;\n const startRange = element.value.slice(0, position);\n const endRange = element.value.slice(position);\n let html = `${format(startRange)}`;\n html += '|';\n html += `${format(endRange)}`;\n\n const mirror = createMirror(element, html);\n const rect = mirror.rect();\n rect.pos = getPos();\n\n return rect;\n };\n\n return {\n getPos,\n setPos,\n getOffset,\n getPosition,\n };\n};\n\nexport default createInputCaret;\n","/**\n * Create an Editable Caret\n * @param {Element} element The editable element\n * @param {object|null} ctx The context\n *\n * @return {EditableCaret}\n */\nconst createEditableCaret = (element, ctx) => {\n\n /**\n * Set the caret position\n *\n * @param {int} pos The position to se\n *\n * @return {Element} The element\n */\n const setPos = (pos) => {\n const sel = ctx.window.getSelection();\n if (sel) {\n let offset = 0;\n let found = false;\n const find = (position, parent) => {\n for (let i = 0; i < parent.childNodes.length; i++) {\n const node = parent.childNodes[i];\n if (found) {\n break;\n }\n if (node.nodeType === 3) {\n if (offset + node.length >= position) {\n found = true;\n const range = ctx.document.createRange();\n range.setStart(node, position - offset);\n sel.removeAllRanges();\n sel.addRange(range);\n break;\n } else {\n offset += node.length;\n }\n } else {\n find(pos, node);\n }\n }\n };\n find(pos, element);\n }\n\n return element;\n };\n\n /**\n * Get the offset\n *\n * @return {object} The offset\n */\n const getOffset = () => {\n const range = getRange();\n let offset = {\n height: 0,\n left: 0,\n right: 0,\n };\n\n if (!range) {\n return offset;\n }\n\n const hasCustomPos = ctx.customPos || ctx.customPos === 0;\n\n // endContainer in Firefox would be the element at the start of\n // the line\n if ((range.endOffset - 1 > 0 && range.endContainer !== element) || hasCustomPos) {\n const clonedRange = range.cloneRange();\n const fixedPosition = hasCustomPos ? ctx.customPos : range.endOffset;\n clonedRange.setStart(range.endContainer, fixedPosition - 1 < 0 ? 0 : fixedPosition - 1);\n clonedRange.setEnd(range.endContainer, fixedPosition);\n const rect = clonedRange.getBoundingClientRect();\n offset = {\n height: rect.height,\n left: rect.left + rect.width,\n top: rect.top,\n };\n clonedRange.detach();\n }\n\n if ((!offset || (offset && offset.height === 0)) && !ctx.noShadowCaret) {\n const clonedRange = range.cloneRange();\n const shadowCaret = ctx.document.createTextNode('|');\n clonedRange.insertNode(shadowCaret);\n clonedRange.selectNode(shadowCaret);\n const rect = clonedRange.getBoundingClientRect();\n offset = {\n height: rect.height,\n left: rect.left,\n top: rect.top,\n };\n shadowCaret.parentNode.removeChild(shadowCaret);\n clonedRange.detach();\n }\n\n if (offset) {\n const doc = ctx.document.documentElement;\n offset.top += ctx.window.pageYOffset - (doc.clientTop || 0);\n offset.left += ctx.window.pageXOffset - (doc.clientLeft || 0);\n }\n\n return offset;\n };\n\n /**\n * Get the position\n *\n * @return {object} The position\n */\n const getPosition = () => {\n const offset = getOffset();\n const pos = getPos();\n const rect = element.getBoundingClientRect();\n const inputOffset = {\n top: rect.top + ctx.document.body.scrollTop,\n left: rect.left + ctx.document.body.scrollLeft\n };\n offset.left -= inputOffset.left;\n offset.top -= inputOffset.top;\n offset.pos = pos;\n\n return offset;\n };\n\n /**\n * Get the range\n *\n * @return {Range|null}\n */\n const getRange = () => {\n if (!ctx.window.getSelection) {\n return;\n }\n const sel = ctx.window.getSelection();\n\n return sel.rangeCount > 0 ? sel.getRangeAt(0) : null;\n };\n\n /**\n * Get the caret position\n *\n * @return {int} The position\n */\n const getPos = () => {\n const range = getRange();\n const clonedRange = range.cloneRange();\n clonedRange.selectNodeContents(element);\n clonedRange.setEnd(range.endContainer, range.endOffset);\n const pos = clonedRange.toString().length;\n clonedRange.detach();\n\n return pos;\n };\n\n return {\n getPos,\n setPos,\n getPosition,\n getOffset,\n getRange,\n };\n};\n\nexport default createEditableCaret;\n","import createInputCaret from './input';\nimport createEditableCaret from './editable';\nimport {\n isContentEditable,\n getContext,\n isObject,\n} from './utils';\n\nexport { getOffset } from './utils';\n\nconst createCaret = (element, ctx) => {\n if (isContentEditable(element)) {\n return createEditableCaret(element, ctx);\n }\n\n return createInputCaret(element, ctx);\n};\n\nexport const position = (element, value, settings = {}) => {\n let options = settings;\n if (isObject(value)) {\n options = value;\n value = null;\n }\n const ctx = getContext(options);\n const caret = createCaret(element, ctx);\n\n if (value || value === 0) {\n return caret.setPos(value);\n }\n\n return caret.getPosition();\n};\n\n/**\n *\n * @param {Element} element The DOM element\n * @param {number|undefined} value The value to set\n * @param {object} settings Any settings for context\n */\nexport const offset = (element, value, settings = {}) => {\n let options = settings;\n if (isObject(value)) {\n options = value;\n value = null;\n }\n\n const ctx = getContext(options);\n const caret = createCaret(element, ctx);\n return caret.getOffset(value);\n};\n","import * as DataEvent from '../events/DataEvent';\nimport DateUtils from './DateUtils';\nimport {\n position,\n offset\n} from 'caret-pos';\n\nimport EventEmitter from '../events/EventEmitter';\nimport * as EditorEvent from '../events/EditorEvent';\n\nclass TextEditor extends EventEmitter {\n\n //--------------------------\n // constructor\n //--------------------------\n constructor(textEditor, scrollLimit) {\n super();\n hljs.initHighlightingOnLoad();\n //this.dataUtils = new DataUtils();\n this.dateUtils = new DateUtils();\n this.textEditor = textEditor;\n this.fixLimit = scrollLimit;\n this.caretPos = null;\n this.url = '';\n let self = this;\n this.setInputs();\n\n window.addEventListener(\"scroll\", f => {\n var fixLimit = this.fixLimit;\n if (window.pageYOffset >= fixLimit) {\n document.getElementById('edit-control').style.position = \"fixed\"\n } else {\n document.getElementById('edit-control').style.position = \"relative\"\n }\n });\n this.refresh();\n }\n //--------------------------\n // methods\n //--------------------------\n setInputs() {\n let self = this;\n var editorButtons = document.querySelectorAll('.editor-button');\n for (var i = 0, length = editorButtons.length; i < length; i++) {\n editorButtons[i].addEventListener('click', e => this.handleEditorOption(e), false);\n }\n this.textEditor.addEventListener('input', f => {\n self.refresh();\n })\n }\n\n refresh() {\n var caret = position(this.textEditor).pos;\n var spiffed = hljs.highlight('markdown', this.textEditor.innerText).value;\n var temp = document.createElement(\"div\");\n temp.innerText = spiffed;\n this.textEditor.innerHTML = temp.innerText;\n position(this.textEditor, caret)\n }\n\n notify(type, data) {\n switch (type) {\n case DataEvent.POST_UPDATED:\n document.getElementById('submit-update').classList.add('icon-hide');\n document.getElementById('submit-good').classList.remove('icon-hide');\n document.getElementById('option-update').classList.remove('submit-start');\n document.getElementById('option-update').classList.add('submit-cool');\n setTimeout(f => {\n document.getElementById('submit-update').classList.remove('icon-hide');\n document.getElementById('submit-good').classList.add('icon-hide');\n document.getElementById('option-update').classList.add('submit-start');\n document.getElementById('option-update').classList.remove('submit-cool');\n }, 2000);\n\n break;\n case DataEvent.POST_ADDED:\n window.location = \"/@/dashboard/entries/edit/\" + data;\n break;\n case EditorEvent.EDITOR_UPLOAD_POST_IMAGE:\n position(this.textEditor, this.caretPos);\n var sel, range, pulled;\n sel = window.getSelection(); //console.log(sel)\n //console.log(note.message)\n if (sel.rangeCount) {\n range = sel.getRangeAt(0);\n pulled = sel.getRangeAt(0).toString();\n range.deleteContents();\n range.insertNode(document.createTextNode(\"![image alt text](\" + data + \" 'image title')\"));\n }\n this.refresh();\n break;\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n handleEditorOption(e) {\n e.preventDefault();\n var self = this;\n var sel, range, pulled;\n sel = window.getSelection(); //console.log(sel)\n if (sel.rangeCount) {\n range = sel.getRangeAt(0);\n pulled = sel.getRangeAt(0).toString();\n range.deleteContents();\n switch (e.target.id) {\n case \"option-bold\":\n range.insertNode(document.createTextNode(\"**\" + pulled + \"**\"));\n break;\n case \"option-italic\":\n range.insertNode(document.createTextNode(\"*\" + pulled + \"*\"));\n break;\n case \"option-strikethrough\":\n range.insertNode(document.createTextNode(\"\" + pulled + \"\"));\n break;\n case \"option-header1\":\n range.insertNode(document.createTextNode(\"# \" + pulled));\n break;\n case \"option-header2\":\n range.insertNode(document.createTextNode(\"## \" + pulled));\n break;\n case \"option-header3\":\n range.insertNode(document.createTextNode(\"### \" + pulled));\n break;\n case \"option-image\":\n this.caretPos = position(this.textEditor).pos;\n this.emitEvent(EditorEvent.EDITOR_UPLOAD_POST_IMAGE);\n break;\n case \"submit-save\":\n case \"option-save\":\n this.emitEvent(EditorEvent.EDITOR_SAVE);\n break;\n case \"submit-update\":\n case \"option-update\":\n this.emitEvent(EditorEvent.EDITOR_UPDATE);\n break\n case \"option-link\":\n range.insertNode(document.createTextNode(\"[\" + pulled + \"](PASTE URL HERE)\"));\n break;\n case \"option-delete\":\n this.emitEvent(EditorEvent.EDITOR_DELETE);\n break\n default:\n //range.insertNode(document.createTextNode(\"[\" + self.url + \"](PASTE URL HERE)\"));\n break;\n }\n }\n this.refresh()\n }\n}\nexport default TextEditor","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.TinyDatePicker = factory());\n}(this, (function () { 'use strict';\n\n /**\n * @file A generic set of mutation-free date functions.\n */\n\n /**\n * now returns the current date without any time values\n *\n * @returns {Date}\n */\n function now() {\n var dt = new Date();\n dt.setHours(0, 0, 0, 0);\n return dt;\n }\n\n /**\n * dateEq compares two dates\n *\n * @param {Date} date1 the first date\n * @param {Date} date2 the second date\n * @returns {boolean}\n */\n function datesEq(date1, date2) {\n return (date1 && date1.toDateString()) === (date2 && date2.toDateString());\n }\n\n /**\n * shiftDay shifts the specified date by n days\n *\n * @param {Date} dt\n * @param {number} n\n * @returns {Date}\n */\n function shiftDay(dt, n) {\n dt = new Date(dt);\n dt.setDate(dt.getDate() + n);\n return dt;\n }\n\n /**\n * shiftMonth shifts the specified date by a specified number of months\n *\n * @param {Date} dt\n * @param {number} n\n * @param {boolean} wrap optional, if true, does not change year\n * value, defaults to false\n * @returns {Date}\n */\n function shiftMonth(dt, n, wrap) {\n dt = new Date(dt);\n\n var dayOfMonth = dt.getDate();\n var month = dt.getMonth() + n;\n\n dt.setDate(1);\n dt.setMonth(wrap ? (12 + month) % 12 : month);\n dt.setDate(dayOfMonth);\n\n // If dayOfMonth = 31, but the target month only has 30 or 29 or whatever...\n // head back to the max of the target month\n if (dt.getDate() < dayOfMonth) {\n dt.setDate(0);\n }\n\n return dt;\n }\n\n /**\n * shiftYear shifts the specified date by n years\n *\n * @param {Date} dt\n * @param {number} n\n * @returns {Date}\n */\n function shiftYear(dt, n) {\n dt = new Date(dt);\n dt.setFullYear(dt.getFullYear() + n);\n return dt;\n }\n\n /**\n * setYear changes the specified date to the specified year\n *\n * @param {Date} dt\n * @param {number} year\n */\n function setYear(dt, year) {\n dt = new Date(dt);\n dt.setFullYear(year);\n return dt;\n }\n\n /**\n * setMonth changes the specified date to the specified month\n *\n * @param {Date} dt\n * @param {number} month\n */\n function setMonth(dt, month) {\n return shiftMonth(dt, month - dt.getMonth());\n }\n\n /**\n * dateOrParse creates a function which, given a date or string, returns a date\n *\n * @param {function} parse the function used to parse strings\n * @returns {function}\n */\n function dateOrParse(parse) {\n return function (dt) {\n return dropTime(typeof dt === 'string' ? parse(dt) : dt);\n };\n }\n\n /**\n * constrainDate returns dt or min/max depending on whether dt is out of bounds (inclusive)\n *\n * @export\n * @param {Date} dt\n * @param {Date} min\n * @param {Date} max\n * @returns {Date}\n */\n function constrainDate(dt, min, max) {\n return (dt < min) ? min :\n (dt > max) ? max :\n dt;\n }\n\n function dropTime(dt) {\n dt = new Date(dt);\n dt.setHours(0, 0, 0, 0);\n return dt;\n }\n\n /**\n * @file Utility functions for function manipulation.\n */\n\n /**\n * bufferFn buffers calls to fn so they only happen every ms milliseconds\n *\n * @param {number} ms number of milliseconds\n * @param {function} fn the function to be buffered\n * @returns {function}\n */\n function bufferFn(ms, fn) {\n var timeout = undefined;\n return function () {\n clearTimeout(timeout);\n timeout = setTimeout(fn, ms);\n };\n }\n\n /**\n * noop is a function which does nothing at all.\n */\n function noop() { }\n\n /**\n * copy properties from object o2 to object o1.\n *\n * @params {Object} o1\n * @params {Object} o2\n * @returns {Object}\n */\n function cp() {\n var args = arguments;\n var o1 = args[0];\n for (var i = 1; i < args.length; ++i) {\n var o2 = args[i] || {};\n for (var key in o2) {\n o1[key] = o2[key];\n }\n }\n return o1;\n }\n\n /**\n * @file Responsible for sanitizing and creating date picker options.\n */\n\n var english = {\n days: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n today: 'Today',\n clear: 'Clear',\n close: 'Close',\n };\n\n /**\n * DatePickerOptions constructs a new date picker options object, overriding\n * default values with any values specified in opts.\n *\n * @param {DatePickerOptions} opts\n * @returns {DatePickerOptions}\n */\n function DatePickerOptions(opts) {\n opts = opts || {};\n opts = cp(defaults(), opts);\n var parse = dateOrParse(opts.parse);\n opts.lang = cp(english, opts.lang);\n opts.parse = parse;\n opts.inRange = makeInRangeFn(opts);\n opts.min = parse(opts.min || shiftYear(now(), -100));\n opts.max = parse(opts.max || shiftYear(now(), 100));\n opts.hilightedDate = opts.parse(opts.hilightedDate);\n\n return opts;\n }\n\n function defaults() {\n return {\n lang: english,\n\n // Possible values: dp-modal, dp-below, dp-permanent\n mode: 'dp-modal',\n\n // The date to hilight initially if the date picker has no\n // initial value.\n hilightedDate: now(),\n\n format: function (dt) {\n return (dt.getMonth() + 1) + '/' + dt.getDate() + '/' + dt.getFullYear();\n },\n\n parse: function (str) {\n var date = new Date(str);\n return isNaN(date) ? now() : date;\n },\n\n dateClass: function () { },\n\n inRange: function () {\n return true;\n }\n };\n }\n\n function makeInRangeFn(opts) {\n var inRange = opts.inRange; // Cache this version, and return a variant\n\n return function (dt, dp) {\n return inRange(dt, dp) && opts.min <= dt && opts.max >= dt;\n };\n }\n\n /**\n * @file Helper functions for dealing with dom elements.\n */\n\n var Key = {\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n enter: 13,\n esc: 27,\n };\n\n /**\n * on attaches an event handler to the specified element, and returns an\n * off function which can be used to remove the handler.\n *\n * @param {string} evt the name of the event to handle\n * @param {HTMLElement} el the element to attach to\n * @param {function} handler the event handler\n * @returns {function} the off function\n */\n function on(evt, el, handler) {\n el.addEventListener(evt, handler, true);\n\n return function () {\n el.removeEventListener(evt, handler, true);\n };\n }\n\n var CustomEvent = shimCustomEvent();\n\n function shimCustomEvent() {\n var CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function (event, params) {\n params = params || {bubbles: false, cancelable: false, detail: undefined};\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n }\n\n return CustomEvent;\n }\n\n /**\n * @file Manages the calendar / day-picker view.\n */\n\n var dayPicker = {\n onKeyDown: keyDown,\n onClick: {\n 'dp-day': selectDay,\n 'dp-next': gotoNextMonth,\n 'dp-prev': gotoPrevMonth,\n 'dp-today': selectToday,\n 'dp-clear': clear,\n 'dp-close': close,\n 'dp-cal-month': showMonthPicker,\n 'dp-cal-year': showYearPicker,\n },\n render: render\n };\n\n /**\n * view renders the calendar (day picker) as an HTML string.\n *\n * @param {DatePickerContext} context the date picker being rendered\n * @returns {string}\n */\n function render(dp) {\n var opts = dp.opts;\n var lang = opts.lang;\n var state = dp.state;\n var dayNames = lang.days;\n var dayOffset = opts.dayOffset || 0;\n var selectedDate = state.selectedDate;\n var hilightedDate = state.hilightedDate;\n var hilightedMonth = hilightedDate.getMonth();\n var today = now().getTime();\n\n return (\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '' +\n '
' +\n '
' +\n dayNames.map(function (name, i) {\n return (\n '' + dayNames[(i + dayOffset) % dayNames.length] + ''\n );\n }).join('') +\n mapDays(hilightedDate, dayOffset, function (date) {\n var isNotInMonth = date.getMonth() !== hilightedMonth;\n var isDisabled = !opts.inRange(date);\n var isToday = date.getTime() === today;\n var className = 'dp-day';\n className += (isNotInMonth ? ' dp-edge-day' : '');\n className += (datesEq(date, hilightedDate) ? ' dp-current' : '');\n className += (datesEq(date, selectedDate) ? ' dp-selected' : '');\n className += (isDisabled ? ' dp-day-disabled' : '');\n className += (isToday ? ' dp-day-today' : '');\n className += ' ' + opts.dateClass(date, dp);\n\n return (\n ''\n );\n }) +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
'\n );\n }\n\n /**\n * keyDown handles the key down event for the day-picker\n *\n * @param {Event} e\n * @param {DatePickerContext} dp\n */\n function keyDown(e, dp) {\n var key = e.keyCode;\n var shiftBy =\n (key === Key.left) ? -1 :\n (key === Key.right) ? 1 :\n (key === Key.up) ? -7 :\n (key === Key.down) ? 7 :\n 0;\n\n if (key === Key.esc) {\n dp.close();\n } else if (shiftBy) {\n e.preventDefault();\n dp.setState({\n hilightedDate: shiftDay(dp.state.hilightedDate, shiftBy)\n });\n }\n }\n\n function selectToday(e, dp) {\n dp.setState({\n selectedDate: now(),\n });\n }\n\n function clear(e, dp) {\n dp.setState({\n selectedDate: null,\n });\n }\n\n function close(e, dp) {\n dp.close();\n }\n\n function showMonthPicker(e, dp) {\n dp.setState({\n view: 'month'\n });\n }\n\n function showYearPicker(e, dp) {\n dp.setState({\n view: 'year'\n });\n }\n\n function gotoNextMonth(e, dp) {\n var hilightedDate = dp.state.hilightedDate;\n dp.setState({\n hilightedDate: shiftMonth(hilightedDate, 1)\n });\n }\n\n function gotoPrevMonth(e, dp) {\n var hilightedDate = dp.state.hilightedDate;\n dp.setState({\n hilightedDate: shiftMonth(hilightedDate, -1)\n });\n }\n\n function selectDay(e, dp) {\n dp.setState({\n selectedDate: new Date(parseInt(e.target.getAttribute('data-date'))),\n });\n }\n\n function mapDays(currentDate, dayOffset, fn) {\n var result = '';\n var iter = new Date(currentDate);\n iter.setDate(1);\n iter.setDate(1 - iter.getDay() + dayOffset);\n\n // If we are showing monday as the 1st of the week,\n // and the monday is the 2nd of the month, the sunday won't\n // show, so we need to shift backwards\n if (dayOffset && iter.getDate() === dayOffset + 1) {\n iter.setDate(dayOffset - 6);\n }\n\n // We are going to have 6 weeks always displayed to keep a consistent\n // calendar size\n for (var day = 0; day < (6 * 7); ++day) {\n result += fn(iter);\n iter.setDate(iter.getDate() + 1);\n }\n\n return result;\n }\n\n /**\n * @file Manages the month-picker view.\n */\n\n var monthPicker = {\n onKeyDown: keyDown$1,\n onClick: {\n 'dp-month': onChooseMonth\n },\n render: render$1\n };\n\n function onChooseMonth(e, dp) {\n dp.setState({\n hilightedDate: setMonth(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-month'))),\n view: 'day',\n });\n }\n\n /**\n * render renders the month picker as an HTML string\n *\n * @param {DatePickerContext} dp the date picker context\n * @returns {string}\n */\n function render$1(dp) {\n var opts = dp.opts;\n var lang = opts.lang;\n var months = lang.months;\n var currentDate = dp.state.hilightedDate;\n var currentMonth = currentDate.getMonth();\n\n return (\n '
' +\n months.map(function (month, i) {\n var className = 'dp-month';\n className += (currentMonth === i ? ' dp-current' : '');\n\n return (\n ''\n );\n }).join('') +\n '
'\n );\n }\n\n /**\n * keyDown handles keydown events that occur in the month picker\n *\n * @param {Event} e\n * @param {DatePickerContext} dp\n */\n function keyDown$1(e, dp) {\n var key = e.keyCode;\n var shiftBy =\n (key === Key.left) ? -1 :\n (key === Key.right) ? 1 :\n (key === Key.up) ? -3 :\n (key === Key.down) ? 3 :\n 0;\n\n if (key === Key.esc) {\n dp.setState({\n view: 'day',\n });\n } else if (shiftBy) {\n e.preventDefault();\n dp.setState({\n hilightedDate: shiftMonth(dp.state.hilightedDate, shiftBy, true)\n });\n }\n }\n\n /**\n * @file Manages the year-picker view.\n */\n\n var yearPicker = {\n render: render$2,\n onKeyDown: keyDown$2,\n onClick: {\n 'dp-year': onChooseYear\n },\n };\n\n /**\n * view renders the year picker as an HTML string.\n *\n * @param {DatePickerContext} dp the date picker context\n * @returns {string}\n */\n function render$2(dp) {\n var state = dp.state;\n var currentYear = state.hilightedDate.getFullYear();\n var selectedYear = state.selectedDate.getFullYear();\n\n return (\n '
' +\n mapYears(dp, function (year) {\n var className = 'dp-year';\n className += (year === currentYear ? ' dp-current' : '');\n className += (year === selectedYear ? ' dp-selected' : '');\n\n return (\n ''\n );\n }) +\n '
'\n );\n }\n\n function onChooseYear(e, dp) {\n dp.setState({\n hilightedDate: setYear(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-year'))),\n view: 'day',\n });\n }\n\n function keyDown$2(e, dp) {\n var key = e.keyCode;\n var opts = dp.opts;\n var shiftBy =\n (key === Key.left || key === Key.up) ? 1 :\n (key === Key.right || key === Key.down) ? -1 :\n 0;\n\n if (key === Key.esc) {\n dp.setState({\n view: 'day',\n });\n } else if (shiftBy) {\n e.preventDefault();\n var shiftedYear = shiftYear(dp.state.hilightedDate, shiftBy);\n\n dp.setState({\n hilightedDate: constrainDate(shiftedYear, opts.min, opts.max),\n });\n }\n }\n\n function mapYears(dp, fn) {\n var result = '';\n var max = dp.opts.max.getFullYear();\n\n for (var i = max; i >= dp.opts.min.getFullYear(); --i) {\n result += fn(i);\n }\n\n return result;\n }\n\n /**\n * @file Defines the base date picker behavior, overridden by various modes.\n */\n\n var views = {\n day: dayPicker,\n year: yearPicker,\n month: monthPicker\n };\n\n function BaseMode(input, emit, opts) {\n var detatchInputEvents; // A function that detaches all events from the input\n var closing = false; // A hack to prevent calendar from re-opening when closing.\n var selectedDate; // The currently selected date\n var dp = {\n // The root DOM element for the date picker, initialized on first open.\n el: undefined,\n opts: opts,\n shouldFocusOnBlur: true,\n shouldFocusOnRender: true,\n state: initialState(),\n adjustPosition: noop,\n containerHTML: '
',\n\n attachToDom: function () {\n document.body.appendChild(dp.el);\n },\n\n updateInput: function (selectedDate) {\n var e = new CustomEvent('change', {bubbles: true});\n e.simulated = true;\n input.value = selectedDate ? opts.format(selectedDate) : '';\n input.dispatchEvent(e);\n },\n\n computeSelectedDate: function () {\n return opts.parse(input.value);\n },\n\n currentView: function() {\n return views[dp.state.view];\n },\n\n open: function () {\n if (closing) {\n return;\n }\n\n if (!dp.el) {\n dp.el = createContainerElement(opts, dp.containerHTML);\n attachContainerEvents(dp);\n }\n\n selectedDate = constrainDate(dp.computeSelectedDate(), opts.min, opts.max);\n dp.state.hilightedDate = selectedDate || opts.hilightedDate;\n dp.state.view = 'day';\n\n dp.attachToDom();\n dp.render();\n\n emit('open');\n },\n\n isVisible: function () {\n return !!dp.el && !!dp.el.parentNode;\n },\n\n hasFocus: function () {\n var focused = document.activeElement;\n return dp.el &&\n dp.el.contains(focused) &&\n focused.className.indexOf('dp-focuser') < 0;\n },\n\n shouldHide: function () {\n return dp.isVisible();\n },\n\n close: function (becauseOfBlur) {\n var el = dp.el;\n\n if (!dp.isVisible()) {\n return;\n }\n\n if (el) {\n var parent = el.parentNode;\n parent && parent.removeChild(el);\n }\n\n closing = true;\n\n if (becauseOfBlur && dp.shouldFocusOnBlur) {\n focusInput(input);\n }\n\n // When we close, the input often gains refocus, which\n // can then launch the date picker again, so we buffer\n // a bit and don't show the date picker within N ms of closing\n setTimeout(function() {\n closing = false;\n }, 100);\n\n emit('close');\n },\n\n destroy: function () {\n dp.close();\n detatchInputEvents();\n },\n\n render: function () {\n if (!dp.el) {\n return;\n }\n\n var hadFocus = dp.hasFocus();\n var html = dp.currentView().render(dp);\n html && (dp.el.firstChild.innerHTML = html);\n\n dp.adjustPosition();\n\n if (hadFocus || dp.shouldFocusOnRender) {\n focusCurrent(dp);\n }\n },\n\n // Conceptually similar to setState in React, updates\n // the view state and re-renders.\n setState: function (state) {\n for (var key in state) {\n dp.state[key] = state[key];\n }\n\n emit('statechange');\n dp.render();\n },\n };\n\n detatchInputEvents = attachInputEvents(input, dp);\n\n // Builds the initial view state\n // selectedDate is a special case and causes changes to hilightedDate\n // hilightedDate is set on open, so remains undefined initially\n // view is the current view (day, month, year)\n function initialState() {\n return {\n get selectedDate() {\n return selectedDate;\n },\n set selectedDate(dt) {\n if (dt && !opts.inRange(dt)) {\n return;\n }\n\n if (dt) {\n selectedDate = new Date(dt);\n dp.state.hilightedDate = selectedDate;\n } else {\n selectedDate = dt;\n }\n\n dp.updateInput(selectedDate);\n emit('select');\n dp.close();\n },\n view: 'day',\n };\n }\n\n return dp;\n }\n\n function createContainerElement(opts, containerHTML) {\n var el = document.createElement('div');\n\n el.className = opts.mode;\n el.innerHTML = containerHTML;\n\n return el;\n }\n\n function attachInputEvents(input, dp) {\n var bufferShow = bufferFn(5, function () {\n if (dp.shouldHide()) {\n dp.close();\n } else {\n dp.open();\n }\n });\n\n var off = [\n on('blur', input, bufferFn(150, function () {\n if (!dp.hasFocus()) {\n dp.close(true);\n }\n })),\n\n on('mousedown', input, function () {\n if (input === document.activeElement) {\n bufferShow();\n }\n }),\n\n on('focus', input, bufferShow),\n\n on('input', input, function (e) {\n var date = dp.opts.parse(e.target.value);\n isNaN(date) || dp.setState({\n hilightedDate: date\n });\n }),\n ];\n\n // Unregister all events that were registered above.\n return function() {\n off.forEach(function (f) {\n f();\n });\n };\n }\n\n function focusCurrent(dp) {\n var current = dp.el.querySelector('.dp-current');\n return current && current.focus();\n }\n\n function attachContainerEvents(dp) {\n var el = dp.el;\n var calEl = el.querySelector('.dp');\n\n // Hack to get iOS to show active CSS states\n el.ontouchstart = noop;\n\n function onClick(e) {\n e.target.className.split(' ').forEach(function(evt) {\n var handler = dp.currentView().onClick[evt];\n handler && handler(e, dp);\n });\n }\n\n // The calender fires a blur event *every* time we redraw\n // this means we need to buffer the blur event to see if\n // it still has no focus after redrawing, and only then\n // do we return focus to the input. A possible other approach\n // would be to set context.redrawing = true on redraw and\n // set it to false in the blur event.\n on('blur', calEl, bufferFn(150, function () {\n if (!dp.hasFocus()) {\n dp.close(true);\n }\n }));\n\n on('keydown', el, function (e) {\n if (e.keyCode === Key.enter) {\n onClick(e);\n } else {\n dp.currentView().onKeyDown(e, dp);\n }\n });\n\n // If the user clicks in non-focusable space, but\n // still within the date picker, we don't want to\n // hide, so we need to hack some things...\n on('mousedown', calEl, function (e) {\n e.target.focus && e.target.focus(); // IE hack\n if (document.activeElement !== e.target) {\n e.preventDefault();\n focusCurrent(dp);\n }\n });\n\n on('click', el, onClick);\n }\n\n function focusInput(input) {\n // When the modal closes, we need to focus the original input so the\n // user can continue tabbing from where they left off.\n input.focus();\n\n // iOS zonks out if we don't blur the input, so...\n if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {\n input.blur();\n }\n }\n\n /**\n * @file Defines the modal date picker behavior.\n */\n\n function ModalMode(input, emit, opts) {\n var dp = BaseMode(input, emit, opts);\n\n // In modal mode, users really shouldn't be able to type in\n // the input, as all input is done via the calendar.\n input.readonly = true;\n\n // In modal mode, we need to know when the user has tabbed\n // off the end of the calendar, and set focus to the original\n // input. To do this, we add a special element to the DOM.\n // When the user tabs off the bottom of the calendar, they\n // will tab onto this element.\n dp.containerHTML += '.';\n\n return dp;\n }\n\n /**\n * @file Defines the dropdown date picker behavior.\n */\n\n function DropdownMode(input, emit, opts) {\n var dp = BaseMode(input, emit, opts);\n\n dp.shouldFocusOnBlur = false;\n\n Object.defineProperty(dp, 'shouldFocusOnRender', {\n get: function() {\n return input !== document.activeElement;\n }\n });\n\n dp.adjustPosition = function () {\n autoPosition(input, dp);\n };\n\n return dp;\n }\n\n function autoPosition(input, dp) {\n var inputPos = input.getBoundingClientRect();\n var win = window;\n\n adjustCalY(dp, inputPos, win);\n adjustCalX(dp, inputPos, win);\n\n dp.el.style.visibility = '';\n }\n\n function adjustCalX(dp, inputPos, win) {\n var cal = dp.el;\n var scrollLeft = win.pageXOffset;\n var inputLeft = inputPos.left + scrollLeft;\n var maxRight = win.innerWidth + scrollLeft;\n var offsetWidth = cal.offsetWidth;\n var calRight = inputLeft + offsetWidth;\n var shiftedLeft = maxRight - offsetWidth;\n var left = calRight > maxRight && shiftedLeft > 0 ? shiftedLeft : inputLeft;\n\n cal.style.left = left + 'px';\n }\n\n function adjustCalY(dp, inputPos, win) {\n var cal = dp.el;\n var scrollTop = win.pageYOffset;\n var inputTop = scrollTop + inputPos.top;\n var calHeight = cal.offsetHeight;\n var belowTop = inputTop + inputPos.height + 8;\n var aboveTop = inputTop - calHeight - 8;\n var isAbove = (aboveTop > 0 && belowTop + calHeight > scrollTop + win.innerHeight);\n var top = isAbove ? aboveTop : belowTop;\n\n if (cal.classList) {\n cal.classList.toggle('dp-is-above', isAbove);\n cal.classList.toggle('dp-is-below', !isAbove);\n }\n cal.style.top = top + 'px';\n }\n\n /**\n * @file Defines the permanent date picker behavior.\n */\n\n function PermanentMode(root, emit, opts) {\n var dp = BaseMode(root, emit, opts);\n\n dp.close = noop;\n dp.destroy = noop;\n dp.updateInput = noop;\n dp.shouldFocusOnRender = opts.shouldFocusOnRender;\n\n dp.computeSelectedDate = function () {\n return opts.hilightedDate;\n };\n\n dp.attachToDom = function () {\n root.appendChild(dp.el);\n };\n\n dp.open();\n\n return dp;\n }\n\n /**\n * @file Defines the various date picker modes (modal, dropdown, permanent)\n */\n\n function Mode(input, emit, opts) {\n input = input && input.tagName ? input : document.querySelector(input);\n\n if (opts.mode === 'dp-modal') {\n return ModalMode(input, emit, opts);\n }\n\n if (opts.mode === 'dp-below') {\n return DropdownMode(input, emit, opts);\n }\n\n if (opts.mode === 'dp-permanent') {\n return PermanentMode(input, emit, opts);\n }\n }\n\n /**\n * @file Defines simple event emitter behavior.\n */\n\n /**\n * Emitter constructs a new emitter object which has on/off methods.\n *\n * @returns {EventEmitter}\n */\n function Emitter() {\n var handlers = {};\n\n function onOne(name, handler) {\n (handlers[name] = (handlers[name] || [])).push(handler);\n }\n\n function onMany(fns) {\n for (var name in fns) {\n onOne(name, fns[name]);\n }\n }\n\n return {\n on: function (name, handler) {\n if (handler) {\n onOne(name, handler);\n } else {\n onMany(name);\n }\n\n return this;\n },\n\n emit: function (name, arg) {\n (handlers[name] || []).forEach(function (handler) {\n handler(name, arg);\n });\n },\n\n off: function (name, handler) {\n if (!name) {\n handlers = {};\n } else if (!handler) {\n handlers[name] = [];\n } else {\n handlers[name] = (handlers[name] || []).filter(function (h) {\n return h !== handler;\n });\n }\n\n return this;\n }\n };\n }\n\n /**\n * @file The root date picker file, defines public exports for the library.\n */\n\n /**\n * The date picker language configuration\n * @typedef {Object} LangOptions\n * @property {Array.} [days] - Days of the week\n * @property {Array.} [months] - Months of the year\n * @property {string} today - The label for the 'today' button\n * @property {string} close - The label for the 'close' button\n * @property {string} clear - The label for the 'clear' button\n */\n\n /**\n * The configuration options for a date picker.\n *\n * @typedef {Object} DatePickerOptions\n * @property {LangOptions} [lang] - Configures the label text, defaults to English\n * @property {('dp-modal'|'dp-below'|'dp-permanent')} [mode] - The date picker mode, defaults to 'dp-modal'\n * @property {(string|Date)} [hilightedDate] - The date to hilight if no date is selected\n * @property {function(string|Date):Date} [parse] - Parses a date, the complement of the \"format\" function\n * @property {function(Date):string} [format] - Formats a date for displaying to user\n * @property {function(Date):string} [dateClass] - Associates a custom CSS class with a date\n * @property {function(Date):boolean} [inRange] - Indicates whether or not a date is selectable\n * @property {(string|Date)} [min] - The minimum selectable date (inclusive, default 100 years ago)\n * @property {(string|Date)} [max] - The maximum selectable date (inclusive, default 100 years from now)\n */\n\n /**\n * The state values for the date picker\n *\n * @typedef {Object} DatePickerState\n * @property {string} view - The current view 'day' | 'month' | 'year'\n * @property {Date} selectedDate - The date which has been selected by the user\n * @property {Date} hilightedDate - The date which is currently hilighted / active\n */\n\n /**\n * An instance of TinyDatePicker\n *\n * @typedef {Object} DatePicker\n * @property {DatePickerState} state - The values currently displayed.\n * @property {function} on - Adds an event handler\n * @property {function} off - Removes an event handler\n * @property {function} setState - Changes the current state of the date picker\n * @property {function} open - Opens the date picker\n * @property {function} close - Closes the date picker\n * @property {function} destroy - Destroys the date picker (removing all handlers from the input, too)\n */\n\n /**\n * TinyDatePicker constructs a new date picker for the specified input\n *\n * @param {HTMLElement | string} input The input or CSS selector associated with the datepicker\n * @param {DatePickerOptions} opts The options for initializing the date picker\n * @returns {DatePicker}\n */\n function TinyDatePicker(input, opts) {\n var emitter = Emitter();\n var options = DatePickerOptions(opts);\n var mode = Mode(input, emit, options);\n var me = {\n get state() {\n return mode.state;\n },\n on: emitter.on,\n off: emitter.off,\n setState: mode.setState,\n open: mode.open,\n close: mode.close,\n destroy: mode.destroy,\n };\n\n function emit(evt) {\n emitter.emit(evt, me);\n }\n\n return me;\n }\n\n return TinyDatePicker;\n\n})));\n","//TOOLS\nimport DataUtils, {\n REQUEST_TYPE_GET,\n REQUEST_TYPE_PUT,\n REQUEST_TYPE_POST,\n REQUEST_TYPE_DELETE,\n CONTENT_TYPE_JSON,\n CONTENT_TYPE_FORM\n} from '../tools/utilities/DataUtils';\nimport * as DataEvent from '../tools/events/DataEvent';\nimport Animate from '../tools/effects/Animate';\nimport * as Ease from '../tools/effects/Animate';\nimport EntryTasks from '../tasks/EntryTasks';\nimport * as EditorEvent from '../tools/events/EditorEvent';\nimport TextEditor from '../tools/utilities/TextEditor';\nimport TinyDatePicker from 'tiny-date-picker';\nimport DateUtils from '../tools/utilities/DateUtils';\n\n\nclass Entry {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n reframe('iframe');\n let self = this;\n this.uploadFiles;\n this.dataUtils = new DataUtils();\n this.dateUtils = new DateUtils();\n\n if (document.getElementById('edit-text-code')) {\n this.editor = new TextEditor(document.getElementById('edit-text-code'),\n document.getElementById('header').offsetHeight +\n document.getElementById('entry-header').offsetHeight +\n document.getElementById('entry-feature').offsetHeight\n );\n\n this.editor.addListener(EditorEvent.EDITOR_DELETE, f => this.handleEditorOptions(EditorEvent.EDITOR_DELETE), false)\n this.editor.addListener(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, f => this.handleEditorOptions(EditorEvent.EDITOR_UPLOAD_POST_IMAGE), false)\n this.editor.addListener(EditorEvent.EDITOR_UPDATE, f => this.handleEditorOptions(EditorEvent.EDITOR_UPDATE), false)\n this.editor.addListener(EditorEvent.EDITOR_SAVE, f => this.handleEditorOptions(EditorEvent.EDITOR_SAVE), false)\n document.getElementById('post-image').addEventListener('change', e => this.handlePostImageAdd(e), false);\n\n TinyDatePicker(document.getElementById('entry-date'), {\n mode: 'dp-below',\n format(date) {\n //return date;\n return self.dateUtils.getDate('origin', date);\n }\n });\n }\n this.start();\n }\n //--------------------------\n // methods\n //--------------------------\n start() {\n let self = this;\n new Animate().object({\n targets: document.getElementById('loader'),\n duration: 300,\n opacity: 0,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n new Animate().object({\n targets: document.getElementById('header'),\n duration: 10,\n opacity: 1,\n easing: 'easeInOutQuad',\n complete: function () {\n if (document.getElementById('the-intro'))\n document.getElementById('the-intro').style.opacity = 1;\n if (document.getElementById('blog-entry'))\n document.getElementById('blog-entry').style.opacity = 1;\n }\n });\n }\n });\n\n if (document.getElementById('featured-image-drop')) {\n document.getElementById('featured-image-drop').addEventListener('dragover', this.handleDragOver, false);\n document.getElementById('featured-image-drop').addEventListener('drop', this.handleDrop, false);\n document.getElementById('featured-click').addEventListener('change', this.handleClicked, false);\n\n if (document.getElementById('new-upload-link')) {\n document.getElementById('new-upload-link').addEventListener('click', e => {\n document.getElementById('featured-click').click();\n })\n }\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n handleEditorOptions(e) {\n switch (e) {\n case EditorEvent.EDITOR_SAVE:\n case EditorEvent.EDITOR_UPDATE:\n let edit = false;\n if (e == EditorEvent.EDITOR_UPDATE)\n edit = true;\n new EntryTasks().submitPost(edit, Entry.uploadFiles).then((response) => {\n let note = JSON.parse(response['response']['request'].response);\n this.editor.notify(note.message, note.postID);\n }).catch((err) => {\n console.log(err)\n });\n break;\n\n case EditorEvent.EDITOR_DELETE:\n\n if (confirm('Aye! You know you\\'re deleting this post, right?')) {\n new EntryTasks().deletePost().then((response) => {\n let note = JSON.parse(response['response']['request'].response);\n window.location = \"/@/dashboard/entries/\";\n //console.log(note);\n }).catch((err) => {\n console.log(err)\n });\n } else {\n // Do nothing!\n }\n\n\n break;\n\n case EditorEvent.EDITOR_UPLOAD_POST_IMAGE:\n document.getElementById('post-image').click();\n break;\n }\n }\n\n handleDragOver(e) {\n e.stopPropagation();\n e.preventDefault();\n e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.\n }\n handleClicked(e) {\n e.stopPropagation();\n e.preventDefault();\n //console.log(\"IMAGES \" + e.target.files);\n Entry.uploadFiles = e.target.files;\n for (var i = 0, f; f = Entry.uploadFiles[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function (theFile) {\n return function (f) {\n // Render thumbnail.\n var span = document.createElement('span');\n span.innerHTML = [\n ''\n ].join('');\n //document.getElementById('featured-image-drop').insertBefore(span, null);\n document.getElementById('featured-image-drop').innerHTML = '';\n document.getElementById('featured-image-drop').appendChild(span);\n };\n })(f);\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n\n }\n\n handleDrop(e) {\n e.stopPropagation();\n e.preventDefault();\n Entry.uploadFiles = e.dataTransfer.files;\n //console.log(MemberArea.uploadFiles.length);\n for (var i = 0, f; f = Entry.uploadFiles[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function (theFile) {\n return function (f) {\n // Render thumbnail.\n var span = document.createElement('span');\n span.innerHTML = [\n ''\n ].join('');\n //document.getElementById('featured-image-drop').insertBefore(span, null);\n document.getElementById('featured-image-drop').innerHTML = '';\n document.getElementById('featured-image-drop').appendChild(span);\n };\n })(f);\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }\n\n handlePostImageAdd(e) {\n e.stopPropagation();\n e.preventDefault();\n let self = this;\n\n var postData = new FormData();\n var files = e.target.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n // Check the file type.\n if (!file.type.match('image.*')) {\n continue;\n }\n postData.append('post_image', file, file.name);\n }\n this.dataUtils.request(\"/api/blog/add-post-image\", DataEvent.POST_IMAGE_ADDED, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, postData)\n .then((response) => {\n self.editor.notify(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, JSON.parse(response.request['response']).url);\n }).catch((err) => {\n console.log(err)\n })\n\n }\n\n}\nEntry.uploadFiles = [];\nexport {\n Entry as\n default\n}","//TOOLS\nimport DataUtils, {\n REQUEST_TYPE_GET,\n REQUEST_TYPE_PUT,\n REQUEST_TYPE_POST,\n REQUEST_TYPE_DELETE,\n CONTENT_TYPE_JSON,\n CONTENT_TYPE_FORM\n} from '../tools/utilities/DataUtils.jsx';\nimport Entry from './DashEntry';\nimport Animate from '../tools/effects/Animate.jsx';\nclass DisplayManager {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n this.dataUtils = new DataUtils();\n this.currentDisplay = '';\n this.urlPieces = document.URL.split(\"/\");\n //grab url so system knows what to display \n this.chooseDisplay(this.urlPieces[5], this.urlPieces[6]);\n\n }\n //--------------------------\n // methods\n //--------------------------\n start() {\n let self = this;\n new Animate().object({\n targets: document.getElementById('loader'),\n duration: 300,\n opacity: 0,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n new Animate().object({\n targets: document.getElementById('header'),\n duration: 10,\n opacity: 1,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n }\n });\n }\n });\n }\n\n chooseDisplay(section, page) {\n this.currentDisplay = '';\n //console.log(section+\" \"+page)\n switch (section) {\n case 'entries':\n this\n this.currentDisplay = new Entry();\n break;\n \n default:\n // just chill\n break;\n }\n this.start();\n\n }\n //--------------------------\n // event handlers\n //--------------------------\n\n}\nexport {\n DisplayManager as\n default\n}","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';\nimport * as DataEvent from './tools/events/DataEvent.jsx';\nimport DisplayManager from './controllers/DisplayManager.jsx';\n\nexport default class Base {\n //--------------------------\n // constructor\n //--------------------------\n \n //TODO: Flip to unified structure defined in BMG, brah\n constructor() {\n var self = this;\n var admin = [];\n var folio = [];\n var displayManager = [];\n this.dataUtils = new DataUtils();\n this.settings = [];\n this.start(); \n }\n start() {\n this.displayManager = new DisplayManager();\n }\n //--------------------------\n // methods\n //--------------------------\n loadSettings() {\n var self = this;\n this.dataUtils.request('/base-assets/data/settings.json', DataEvent.SETTINGS_LOADED)\n .then((response) => {\n this.settings = JSON.parse(response['request'].response);\n this.start();\n //transfer \n \n })\n .catch((err) => {\n //console.log(err);\n });\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n\n}\n","import Base from './Base.jsx'\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n var base = new Base();\n}, false);\n"]} \ No newline at end of file +{"version":3,"sources":["tools/events/EventEmitter.jsx","tools/events/DataEvent.jsx","tools/utilities/DataUtils.jsx","tools/effects/Animate.jsx","tools/utilities/StringUtils.jsx","tasks/EntryTasks.jsx","tools/events/EditorEvent.jsx","tools/utilities/DateUtils.jsx","../../src/mirror.js","../../src/utils.js","../../src/input.js","../../src/editable.js","../../src/main.js","tools/utilities/TextEditor.jsx","../../../../node_modules/tiny-date-picker/dist/tiny-date-picker.js","controllers/DashEntry.jsx","controllers/DisplayManager.jsx","Base.jsx","Start.jsx"],"names":["EventEmitter","listeners","Map","label","callback","has","set","get","push","isFunction","obj","index","length","reduce","i","listener","splice","args","forEach","REQUEST_GOOD","REQUEST_LAME","IMG_REQUEST_GOOD","IMG_REQUEST_LAME","SETTINGS_LOADED","HTML_LOADED","ARCHIVES_JSON_LOADED","ARCHIVES_PAGE_LOADED","ARCHIVES_ENTRY_LOADED","PROJECT_UPDATED","PROJECT_ADDED","PROJECTS_SORTED","POST_IMAGE_ADDED","POST_ERROR","POST_ADDED","POST_UPDATED","POST_DELETED","DataEvent","REQUEST_TYPE_POST","REQUEST_TYPE_GET","REQUEST_TYPE_PUT","REQUEST_TYPE_DELETE","CONTENT_TYPE_JSON","CONTENT_TYPE_FORM","DataUtils","self","requestURL","eventType","requestType","contentType","requestData","Promise","resolve","reject","request","XMLHttpRequest","upload","onprogress","handleLoadProgress","open","onload","e","status","setRequestHeader","send","JSON","stringify","url","responseType","response","Error","statusText","onerror","src","body","document","querySelector","myImage","Image","crossOrigin","imgLoad","then","imageURL","window","URL","createObjectURL","percentComplete","Math","ceil","loaded","total","Animate","properties","animation","anime","StringUtils","string","clean","replace","toLowerCase","quote_style","optTemp","noquotes","toString","OPTS","concat","ENT_HTML_QUOTE_SINGLE","EntryTasks","folio","dataUtils","edit","uploadFiles","postData","FormData","files","file","type","match","append","name","txt","createElement","innerHTML","getElementById","value","cleanString","postURL","postEventType","postID","getAttribute","catch","err","re","valid","entry_form","title","price","description","EDITOR_DELETE","EDITOR_UPLOAD_POST_IMAGE","EDITOR_SAVE","EDITOR_UPDATE","EditorEvent","DateUtils","time","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getTime","seconds","date","rawdate","day","String","getUTCDate","month","getUTCMonth","year","getUTCFullYear","hour","getUTCHours","minute","getUTCMinutes","getUTCSeconds","millisecond","getUTCMilliseconds","offset","getTimezoneOffset","attributes","createMirror","element","html","mirror","mirrorCss","css","tagName","attr","getComputedStyle","initialize","styles","keys","style","key","parentNode","insertBefore","nextSibling","rect","marker","ownerDocument","boundingRect","offsetLeft","offsetTop","offsetHeight","removeChild","isContentEditable","contentEditable","getContext","settings","customPos","iframe","noShadowCaret","contentWindow","contentDocument","getOffset","ctx","win","doc","getBoundingClientRect","docEl","documentElement","scrollLeft","pageXOffset","scrollTop","pageYOffset","top","left","isObject","createInputCaret","getPos","selectionStart","setPos","pos","setSelectionRange","elementOffset","position","getPosition","height","format","val","undefined","startRange","slice","endRange","createEditableCaret","sel","getSelection","found","find","parent","childNodes","node","nodeType","range","createRange","setStart","removeAllRanges","addRange","getRange","hasCustomPos","endOffset","endContainer","clonedRange","cloneRange","fixedPosition","setEnd","width","detach","shadowCaret","createTextNode","insertNode","selectNode","clientTop","clientLeft","inputOffset","rangeCount","getRangeAt","selectNodeContents","createCaret","options","caret","TextEditor","textEditor","scrollLimit","hljs","initHighlightingOnLoad","dateUtils","fixLimit","caretPos","setInputs","addEventListener","f","refresh","editorButtons","querySelectorAll","handleEditorOption","spiffed","highlight","innerText","temp","data","classList","add","remove","setTimeout","pulled","deleteContents","preventDefault","target","id","emitEvent","Entry","reframe","editor","addListener","handleEditorOptions","handlePostImageAdd","mode","start","object","targets","duration","opacity","easing","complete","display","visibility","handleDragOver","handleDrop","handleClicked","click","submitPost","note","parse","notify","message","location","console","log","confirm","deletePost","stopPropagation","dataTransfer","dropEffect","reader","FileReader","theFile","span","result","escape","join","appendChild","readAsDataURL","DisplayManager","currentDisplay","urlPieces","split","chooseDisplay","section","page","Base","admin","displayManager","base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAMA;;;AAGF;AACA;AACA;AACA,0BACA;AAAA;;AACI,SAAKC,SAAL,GAAiB,IAAIC,GAAJ,EAAjB;AACH,IACD;AACA;AACA;;;;;gCACYC,OAAOC,UAAU;AACzB,WAAKH,SAAL,CAAeI,GAAf,CAAmBF,KAAnB,KAA6B,KAAKF,SAAL,CAAeK,GAAf,CAAmBH,KAAnB,EAA0B,EAA1B,CAA7B;AACA,WAAKF,SAAL,CAAeM,GAAf,CAAmBJ,KAAnB,EAA0BK,IAA1B,CAA+BJ,QAA/B;AACH;;;mCAEcD,OAAOC,UAAU;AAC5B,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,eAAK,eAAL;AACI,iBAAKK,SAAL,CAAejK,WAAW,CAACJ,aAA3B;AACA;;AACJ;AACI;AACA;AAvCR;AAyCH;;AACD,WAAKmJ,OAAL;AACH;;;;EA3IoB5R;;eA6IViR;;;;;ACvJf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChrCA;;AAQA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;IAGM8B;;;AACF;AACA;AACA;AACA,mBAAc;AAAA;;AAAA;;AACVC,IAAAA,OAAO,CAAC,QAAD,CAAP;AACA,QAAIpQ,IAAI,GAAG,IAAX;AACA,SAAKkE,WAAL;AACA,S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;AACA,cAAQI,OAAR;AACI,aAAK,SAAL;AACI;AACA,eAAKJ,cAAL,GAAsB,IAAI3C,kBAAJ,EAAtB;AACA;;AAEJ;AACI;AACA;AARR;;AAUA,WAAKO,KAAL;AAEH,MACD;AACA;AACA;;;;;;;;;;;;;;;;ACpEJ;;AACA;;AACA;;;;;;;;;;;;IAEqB0C;;;AACjB;AACA;AACA;AAEA;AACA,kBAAc;AAAA;;AACV,QAAIpT,IAAI,GAAG,IAAX;AACA,QAAIqT,KAAK,GAAG,EAAZ;AACA,QAAItP,KAAK,GAAG,EAAZ;AACA,QAAIuP,cAAc,GAAG,EAArB;AACA,SAAKtP,SAAL,GAAiB,IAAIjE,kBAAJ,EAAjB;AACA,SAAK6J,QAAL,GAAgB,EAAhB;AACA,SAAK8G,KAAL;AACH;;;;4BACO;AACJ,WAAK4C,cAAL,GAAsB,IAAIT,uBAAJ,EAAtB;AACH,MACD;AACA;AACA;;;;mCACe;AAAA;;AACX,UAAI7S,IAAI,GAAG,IAAX;AACA,WAAKgE,SAAL,CAAevD,OAAf,CAAuB,iCAAvB,EAA0DjB,SAAS,CAACb,eAApE,EACKyD,IADL,CACU,UAACZ,QAAD,EAAc;AAChB,QAAA,KAAI,CAACoI,QAAL,GAAgBxI,IAAI,CAACqQ,KAAL,CAAWjQ,QAAQ,CAAC,SAAD,CAAR,CAAoBA,QAA/B,CAAhB;;AACA,QAAA,KAAI,CAACkP,KAAL,GAFgB,CAGhB;;AAEH,OANL,EAOKrL,KAPL,CAOW,UAACC,GAAD,EAAS,CACZ;AACH,OATL;AAUH,MAED;AACA;AACA;;;;;;;;;;;ACzCJ;;;;AAEAxD,QAAQ,CAACgN,gBAAT,CAA0B,kBAA1B,EAA8C,YAAW;AAErD,MAAIyE,IAAI,GAAG,IAAIH,aAAJ,EAAX;AACH,CAHD,EAGG,KAHH","file":"dash.min.map","sourceRoot":"../../src/com","sourcesContent":["class EventEmitter\n{\n\n //--------------------------\n // constructor\n //--------------------------\n constructor()\n {\n this.listeners = new Map();\n }\n //--------------------------\n // methods\n //--------------------------\n addListener(label, callback) {\n this.listeners.has(label) || this.listeners.set(label, []);\n this.listeners.get(label).push(callback);\n }\n\n removeListener(label, callback) {\n var isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n\n var listeners = this.listeners.get(label),\n index;\n\n if (listeners && listeners.length) {\n index = listeners.reduce((i, listener, index) => {\n return (isFunction(listener) && listener === callback)\n ? i = index\n : i;\n }, -1);\n\n if (index > -1) {\n listeners.splice(index, 1);\n this.listeners.set(label, listeners);\n return true;\n }\n }\n return false;\n }\n\n emitEvent(label, ...args) {\n var listeners = this.listeners.get(label);\n if (listeners && listeners.length) {\n listeners.forEach((listener) => {\n listener(...args);\n });\n return true;\n }\n return false;\n }\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default EventEmitter\n","export const REQUEST_GOOD = 'requestGood';\nexport const REQUEST_LAME = 'requestLame';\nexport const IMG_REQUEST_GOOD = 'imgRequestGood';\nexport const IMG_REQUEST_LAME = 'imgRequestLame';\nexport const SETTINGS_LOADED = 'dataLoaded';\nexport const HTML_LOADED = 'htmlLoaded';\nexport const ARCHIVES_JSON_LOADED = 'archivesJSONLoaded';\nexport const ARCHIVES_PAGE_LOADED = 'archivesPAGELoaded';\nexport const ARCHIVES_ENTRY_LOADED = 'archivesEntryLoaded';\nexport const PROJECT_UPDATED = 'projectUpdated';\nexport const PROJECT_ADDED = 'projectAdded';\nexport const PROJECTS_SORTED = 'projectsSorted';\nexport const POST_IMAGE_ADDED = 'postImageAdded';\nexport const POST_ERROR = 'postError';\nexport const POST_ADDED = 'postAdded';\nexport const POST_UPDATED = 'postUpdated';\nexport const POST_DELETED = 'postImageAdded';\n\nclass DataEvent\n{\n\n //--------------------------\n // methods\n //--------------------------\n\n\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default new DataEvent\n","export const REQUEST_TYPE_POST = \"POST\";\nexport const REQUEST_TYPE_GET = \"GET\";\nexport const REQUEST_TYPE_PUT = \"PUT\";\nexport const REQUEST_TYPE_DELETE = \"DELETE\";\nexport const CONTENT_TYPE_JSON = 'json';\nexport const CONTENT_TYPE_FORM = 'x-www-form-urlencoded';\nimport EventEmitter from '../events/EventEmitter.jsx';\nimport * as DataEvent from '../events/DataEvent.jsx';\nclass DataUtils extends EventEmitter {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n super();\n var self = this;\n }\n //--------------------------\n // methods\n //--------------------------\n request(requestURL, eventType, requestType = REQUEST_TYPE_GET, contentType = CONTENT_TYPE_JSON, requestData = null) {\n var self = this;\n return new Promise(function(resolve, reject) {\n var request = new XMLHttpRequest();\n request.upload.onprogress = self.handleLoadProgress;\n request.open(requestType, requestURL, true);\n request.onload = function(e) {\n if (request.status == 200) {\n resolve({\n request,\n eventType\n });\n } else {\n reject({\n request,\n eventType\n });\n }\n ;\n };\n if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {\n switch (contentType) {\n case CONTENT_TYPE_JSON:\n request.setRequestHeader(\"Content-type\", \"application/\" + contentType);\n request.send(JSON.stringify(requestData));\n break;\n case CONTENT_TYPE_FORM:\n request.send(requestData);\n break;\n }\n } else {\n request.send();\n }\n })\n }\n imgLoad(url) {\n 'use strict';\n // Create new promise with the Promise() constructor;\n // This has as its argument a function with two parameters, resolve and reject\n return new Promise(function(resolve, reject) {\n // Standard XHR to load an image\n var request = new XMLHttpRequest();\n request.open('GET', url);\n request.responseType = 'blob';\n // When the request loads, check whether it was successful\n request.onload = function() {\n if (request.status === 200) {\n // If successful, resolve the promise by passing back the request response\n resolve(request.response);\n } else {\n // If it fails, reject the promise with a error message\n reject(new Error('Image didn\\'t load successfully; error code:' + request.statusText));\n }\n };\n request.onerror = function() {\n // Also deal with the case when the entire request fails to begin with\n // This is probably a network error, so reject the promise with an appropriate message\n reject(new Error('There was a network error.'));\n };\n // Send the request\n request.send();\n });\n }\n loadImage(src) {\n 'use strict';\n let self = this;\n return new Promise(function(resolve, reject) {\n // Get a reference to the body element, and create a new image object\n var body = document.querySelector('body'),\n myImage = new Image();\n myImage.crossOrigin = \"\"; // or \"anonymous\"\n // Call the function with the URL we want to load, but then chain the\n // promise then() method on to the end of it. This contains two callbacks\n self.imgLoad(src).then(function(response) {\n // The first runs when the promise resolves, with the request.reponse specified within the resolve() method.\n var imageURL = window.URL.createObjectURL(response);\n resolve(imageURL);\n //$('background-content').setStyle('background-image', 'url('+imageURL+')') //myImage.src = imageURL;\n //console.log(imageURL);\n //body.appendChild(myImage);\n // The second runs when the promise is rejected, and logs the Error specified with the reject() method.\n }, function(Error) {\n reject(Error)\n });\n });\n }\n //--------------------------\n // event handlers\n //--------------------------\n handleLoadProgress(e) {\n var percentComplete = Math.ceil((e.loaded / e.total) * 100);\n //console.log(percentComplete);\n }\n}\nexport default DataUtils;\n","import EventEmitter from '../events/EventEmitter.jsx';;\n\nclass Animate extends EventEmitter {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n super();\n }\n //--------------------------\n // methods\n //--------------------------\n object(properties) {\n var animation = anime(\n properties\n );\n //animation.start(properties);\n }\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default Animate\n","class StringUtils\n{\n\n //--------------------------\n // constructor\n //--------------------------\n constructor()\n {}\n //--------------------------\n // methods\n //--------------------------\n cleanString(string)\n {\n var clean = string.replace(/(^\\-+|[^a-zA-Z0-9\\/_| -]+|\\-+$)/g, '').toLowerCase().replace(/[\\/_| -]+/g, '-');\n return clean;\n }\n\n decodeHTML(string, quote_style) {\n var optTemp = 0,\n i = 0,\n noquotes = false;\n if (typeof quote_style === 'undefined') {\n quote_style = 2;\n }\n string = string.toString().replace(/</g, '<').replace(/>/g, '>');\n var OPTS = {\n 'ENT_NOQUOTES': 0,\n 'ENT_HTML_QUOTE_SINGLE': 1,\n 'ENT_HTML_QUOTE_DOUBLE': 2,\n 'ENT_COMPAT': 2,\n 'ENT_QUOTES': 3,\n 'ENT_IGNORE': 4\n };\n if (quote_style === 0) {\n noquotes = true;\n }\n if (typeof quote_style !== 'number') { // Allow for a single string or an array of string flags\n quote_style = [].concat(quote_style);\n for (i = 0; i < quote_style.length; i++) {\n // Resolve string input to bitwise e.g. 'PATHINFO_EXTENSION' becomes 4\n if (OPTS[quote_style[i]] === 0) {\n noquotes = true;\n } else if (OPTS[quote_style[i]]) {\n optTemp = optTemp | OPTS[quote_style[i]];\n }\n }\n quote_style = optTemp;\n }\n if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) {\n string = string.replace(/�*39;/g, \"'\"); // PHP doesn't currently escape if more than one 0, but it should\n // string = string.replace(/'|�*27;/g, \"'\"); // This would also be useful here, but not a part of PHP\n }\n if (!noquotes) {\n string = string.replace(/"/g, '\"');\n }\n // Put this in last place to avoid escape being double-decoded\n string = string.replace(/&/g, '&');\n return string;\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default StringUtils\n","import DataUtils, { REQUEST_TYPE_GET, REQUEST_TYPE_PUT, REQUEST_TYPE_POST, REQUEST_TYPE_DELETE, CONTENT_TYPE_JSON, CONTENT_TYPE_FORM } from '../tools/utilities/DataUtils';\nimport * as DataEvent from '../tools/events/DataEvent';\nimport StringUtils from '../tools/utilities/StringUtils';\nclass EntryTasks {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n var folio = [];\n this.dataUtils = new DataUtils();\n }\n //--------------------------\n // methods\n //--------------------------\n start() {}\n\n submitPost(edit, uploadFiles) {\n let self = this;\n return new Promise(function(resolve, reject) {\n //collect form data\n //if(!this.validateForm())\n var postData = new FormData();\n //let projectImages = document.getElementById('projectImages');\n //var fileSelect = projectImages;\n var files = uploadFiles;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n // Check the file type.\n if (!file.type.match('image.*')) {\n continue;\n }\n // Add the file to the request.\n postData.append('feature_image', file, file.name);\n }\n //var category = document.getElementById(\"content_category\");\n //let project_form = document.forms.namedItem(\"folio-project\");\n var txt = document.createElement(\"textarea\");\n txt.innerHTML = document.getElementById('edit-text-code').innerHTML;\n postData.append(\"title\", document.getElementById('entry_title').value);\n postData.append('slug', new StringUtils().cleanString(document.getElementById('entry_title').value));\n postData.append(\"entry_plaintext\", txt.value);\n postData.append(\"origin_date\", document.getElementById('entry-date').value);\n postData.append(\"tags\", document.getElementById('entry_tags').value);\n let postURL;\n let postEventType;\n if (edit) {\n let postID = document.getElementById('option-update').getAttribute('data-id');\n postURL = \"/api/blog/update/\" + postID;\n postEventType = DataEvent.POST_UPDATED;\n \n } else {\n postURL = \"/api/blog/add\";\n postEventType = DataEvent.POST_ADDED;\n }\n self.dataUtils.request(postURL, postEventType, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, postData)\n .then((response) => {\n resolve({\n response\n })\n }).catch((err) => {\n reject({\n err\n });\n })\n });\n }\n\n deletePost(){\n let self = this;\n let postID = document.getElementById('option-update').getAttribute('data-id');\n return new Promise(function(resolve, reject){\n self.dataUtils.request(\"/api/blog/delete/\" + postID, DataEvent.POST_DELETED, REQUEST_TYPE_POST, CONTENT_TYPE_FORM)\n .then((response) => {\n resolve({\n response\n })\n }).catch((err) => {\n reject({\n err\n });\n })\n })\n this.dataUtils.re\n }\n\n validateForm() {\n let valid = false;\n if (this.entry_form.title.value == \"\" || this.entry_form.price.value == \"\" || this.entry_form.description == \"\") {\n return valid;\n } else {\n valid = true;\n return valid;\n }\n }\n//--------------------------\n// event handlers\n//--------------------------\n}\nexport { EntryTasks as default }\n","export const EDITOR_DELETE = 'editorDelete';\nexport const EDITOR_UPLOAD_POST_IMAGE = 'editorUploadImage';\nexport const EDITOR_SAVE = 'editorSave';\nexport const EDITOR_UPDATE = 'editorUpdate';\n\nclass EditorEvent\n{\n\n //--------------------------\n // methods\n //--------------------------\n\n\n\n //--------------------------\n // event handlers\n //--------------------------\n}\nexport default new EditorEvent\n","class DateUtils {\n\n //--------------------------\n // constructor\n //--------------------------\n constructor() {}\n\n //--------------------------\n // methods\n //--------------------------\n getMKtime() {\n var time = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), new Date().getMinutes(), new Date().getSeconds(), 0).getTime() / 1000;\n return time;\n }\n\n convertMKtime(seconds) {\n var date = new Date(seconds * 1000);\n return date;\n }\n\n getDate(type, rawdate) {\n var day = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCDate()) : String(new Date().getUTCDate()));\n var month = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMonth() + 1) : String(new Date().getUTCMonth() + 1));\n var year = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCFullYear()) : String(new Date().getUTCFullYear()));\n var hour = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCHours()) : String(new Date().getUTCHours()));\n var minute = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMinutes()) : String(new Date().getUTCMinutes()));\n var seconds = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCSeconds()) : String(new Date().getUTCSeconds()));\n var millisecond = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getUTCMilliseconds()) : String(new Date().getUTCMilliseconds()));\n var offset = ((rawdate != null || rawdate != '') ? String(new Date(rawdate).getTimezoneOffset()) : String(new Date().getTimezoneOffset()));\n if (day.length == 1)\n day = String(\"0\" + day);\n if (month.length == 1)\n month = String(\"0\" + month);\n offset = String(offset / 60);\n if (offset.length == 1)\n offset = String(\"0\" + offset);\n switch (type) {\n case \"day\":\n return day;\n break;\n case \"month\":\n return month;\n break;\n case \"year\":\n return year;\n break;\n case \"stamp\":\n return String(year + \"-\" + month + \"-\" + day + \" \" + hour + \":\" + minute + \":\" + seconds + \".\" + millisecond + \"-\" + (offset));\n break\n default:\n return String(year + \"-\" + month + \"-\" + day);\n break;\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n}\n\nexport default DateUtils","const attributes = [\n 'borderBottomWidth',\n 'borderLeftWidth',\n 'borderRightWidth',\n 'borderTopStyle',\n 'borderRightStyle',\n 'borderBottomStyle',\n 'borderLeftStyle',\n 'borderTopWidth',\n 'boxSizing',\n 'fontFamily',\n 'fontSize',\n 'fontWeight',\n 'height',\n 'letterSpacing',\n 'lineHeight',\n 'marginBottom',\n 'marginLeft',\n 'marginRight',\n 'marginTop',\n 'outlineWidth',\n 'overflow',\n 'overflowX',\n 'overflowY',\n 'paddingBottom',\n 'paddingLeft',\n 'paddingRight',\n 'paddingTop',\n 'textAlign',\n 'textOverflow',\n 'textTransform',\n 'whiteSpace',\n 'wordBreak',\n 'wordWrap',\n];\n\n/**\n * Create a mirror\n *\n * @param {Element} element The element\n * @param {string} html The html\n *\n * @return {object} The mirror object\n */\nconst createMirror = (element, html) => {\n\n /**\n * The mirror element\n */\n const mirror = document.createElement('div');\n\n /**\n * Create the CSS for the mirror object\n *\n * @return {object} The style object\n */\n const mirrorCss = () => {\n const css = {\n position: 'absolute',\n left: -9999,\n top: 0,\n zIndex: -2000\n };\n\n if (element.tagName === 'TEXTAREA') {\n attributes.push('width');\n }\n\n attributes.forEach((attr) => {\n css[attr] = getComputedStyle(element)[attr];\n });\n\n return css;\n };\n\n /**\n * Initialize the mirror\n *\n * @param {string} html The html\n *\n * @return {void}\n */\n const initialize = (html) => {\n const styles = mirrorCss();\n Object.keys(styles).forEach(key => {\n mirror.style[key] = styles[key];\n });\n mirror.innerHTML = html;\n element.parentNode.insertBefore(mirror, element.nextSibling);\n };\n\n /**\n * Get the rect\n *\n * @return {Rect} The bounding rect\n */\n const rect = () => {\n const marker = mirror.ownerDocument.getElementById('caret-position-marker');\n const boundingRect = {\n left: marker.offsetLeft,\n top: marker.offsetTop,\n height: marker.offsetHeight\n };\n mirror.parentNode.removeChild(mirror);\n\n return boundingRect;\n };\n\n initialize(html);\n\n return {\n rect,\n };\n};\n\nexport default createMirror;\n","/**\n * Check if a DOM Element is content editable\n *\n * @param {Element} element The DOM element\n *\n * @return {bool} If it is content editable\n */\nexport const isContentEditable = (element) => !!(\n element.contentEditable &&\n element.contentEditable === 'true'\n);\n\n/**\n * Get the context from settings passed in\n *\n * @param {object} settings The settings object\n *\n * @return {object} window and document\n */\nexport const getContext = (settings = {}) => {\n const { customPos, iframe, noShadowCaret } = settings;\n if (iframe) {\n return {\n iframe,\n window: iframe.contentWindow,\n document: iframe.contentDocument || iframe.contentWindow.document,\n noShadowCaret,\n customPos,\n };\n }\n\n return {\n window,\n document,\n noShadowCaret,\n customPos,\n };\n};\n\n/**\n * Get the offset of an element\n *\n * @param {Element} element The DOM element\n * @param {object} ctx The context\n *\n * @return {object} top and left\n */\nexport const getOffset = (element, ctx) => {\n const win = ctx && ctx.window || window;\n const doc = ctx && ctx.document || document;\n const rect = element.getBoundingClientRect();\n const docEl = doc.documentElement;\n const scrollLeft = win.pageXOffset || docEl.scrollLeft;\n const scrollTop = win.pageYOffset || docEl.scrollTop;\n\n return {\n top: rect.top + scrollTop,\n left: rect.left + scrollLeft\n };\n};\n\n/**\n * Check if a value is an object\n *\n * @param {any} value The value to check\n *\n * @return {bool} If it is an object\n */\nexport const isObject = (value) => typeof value === 'object' && value !== null;\n","import createMirror from './mirror';\nimport { getOffset as elementOffset } from './utils';\n\n/**\n * Create a Input caret object.\n *\n * @param {Element} element The element\n * @param {Object} ctx The context\n */\nconst createInputCaret = (element, ctx) => {\n\n /**\n * Get the current position\n *\n * @returns {int} The caret position\n */\n const getPos = () => {\n return element.selectionStart;\n };\n\n /**\n * Set the position\n *\n * @param {int} pos The position\n *\n * @return {Element} The element\n */\n const setPos = (pos) => {\n element.setSelectionRange(pos, pos);\n\n return element;\n };\n\n /**\n * The offset\n *\n * @param {int} pos The position\n *\n * @return {object} The offset\n */\n const getOffset = (pos) => {\n const rect = elementOffset(element);\n const position = getPosition(pos);\n\n return {\n top: rect.top + position.top + ctx.document.body.scrollTop,\n left: rect.left + position.left + ctx.document.body.scrollLeft,\n height: position.height,\n };\n };\n\n /**\n * Get the current position\n *\n * @param {int} pos The position\n *\n * @return {object} The position\n */\n const getPosition = (pos) => {\n const format = (val) => {\n let value = val.replace(/<|>|`|\"|&/g, '?')\n .replace(/\\r\\n|\\r|\\n/g,'
');\n return value;\n };\n\n if (ctx.customPos || ctx.customPos === 0) {\n pos = ctx.customPos;\n }\n\n const position = pos === undefined ? getPos() : pos;\n const startRange = element.value.slice(0, position);\n const endRange = element.value.slice(position);\n let html = `${format(startRange)}`;\n html += '|';\n html += `${format(endRange)}`;\n\n const mirror = createMirror(element, html);\n const rect = mirror.rect();\n rect.pos = getPos();\n\n return rect;\n };\n\n return {\n getPos,\n setPos,\n getOffset,\n getPosition,\n };\n};\n\nexport default createInputCaret;\n","/**\n * Create an Editable Caret\n * @param {Element} element The editable element\n * @param {object|null} ctx The context\n *\n * @return {EditableCaret}\n */\nconst createEditableCaret = (element, ctx) => {\n\n /**\n * Set the caret position\n *\n * @param {int} pos The position to se\n *\n * @return {Element} The element\n */\n const setPos = (pos) => {\n const sel = ctx.window.getSelection();\n if (sel) {\n let offset = 0;\n let found = false;\n const find = (position, parent) => {\n for (let i = 0; i < parent.childNodes.length; i++) {\n const node = parent.childNodes[i];\n if (found) {\n break;\n }\n if (node.nodeType === 3) {\n if (offset + node.length >= position) {\n found = true;\n const range = ctx.document.createRange();\n range.setStart(node, position - offset);\n sel.removeAllRanges();\n sel.addRange(range);\n break;\n } else {\n offset += node.length;\n }\n } else {\n find(pos, node);\n }\n }\n };\n find(pos, element);\n }\n\n return element;\n };\n\n /**\n * Get the offset\n *\n * @return {object} The offset\n */\n const getOffset = () => {\n const range = getRange();\n let offset = {\n height: 0,\n left: 0,\n right: 0,\n };\n\n if (!range) {\n return offset;\n }\n\n const hasCustomPos = ctx.customPos || ctx.customPos === 0;\n\n // endContainer in Firefox would be the element at the start of\n // the line\n if ((range.endOffset - 1 > 0 && range.endContainer !== element) || hasCustomPos) {\n const clonedRange = range.cloneRange();\n const fixedPosition = hasCustomPos ? ctx.customPos : range.endOffset;\n clonedRange.setStart(range.endContainer, fixedPosition - 1 < 0 ? 0 : fixedPosition - 1);\n clonedRange.setEnd(range.endContainer, fixedPosition);\n const rect = clonedRange.getBoundingClientRect();\n offset = {\n height: rect.height,\n left: rect.left + rect.width,\n top: rect.top,\n };\n clonedRange.detach();\n }\n\n if ((!offset || (offset && offset.height === 0)) && !ctx.noShadowCaret) {\n const clonedRange = range.cloneRange();\n const shadowCaret = ctx.document.createTextNode('|');\n clonedRange.insertNode(shadowCaret);\n clonedRange.selectNode(shadowCaret);\n const rect = clonedRange.getBoundingClientRect();\n offset = {\n height: rect.height,\n left: rect.left,\n top: rect.top,\n };\n shadowCaret.parentNode.removeChild(shadowCaret);\n clonedRange.detach();\n }\n\n if (offset) {\n const doc = ctx.document.documentElement;\n offset.top += ctx.window.pageYOffset - (doc.clientTop || 0);\n offset.left += ctx.window.pageXOffset - (doc.clientLeft || 0);\n }\n\n return offset;\n };\n\n /**\n * Get the position\n *\n * @return {object} The position\n */\n const getPosition = () => {\n const offset = getOffset();\n const pos = getPos();\n const rect = element.getBoundingClientRect();\n const inputOffset = {\n top: rect.top + ctx.document.body.scrollTop,\n left: rect.left + ctx.document.body.scrollLeft\n };\n offset.left -= inputOffset.left;\n offset.top -= inputOffset.top;\n offset.pos = pos;\n\n return offset;\n };\n\n /**\n * Get the range\n *\n * @return {Range|null}\n */\n const getRange = () => {\n if (!ctx.window.getSelection) {\n return;\n }\n const sel = ctx.window.getSelection();\n\n return sel.rangeCount > 0 ? sel.getRangeAt(0) : null;\n };\n\n /**\n * Get the caret position\n *\n * @return {int} The position\n */\n const getPos = () => {\n const range = getRange();\n const clonedRange = range.cloneRange();\n clonedRange.selectNodeContents(element);\n clonedRange.setEnd(range.endContainer, range.endOffset);\n const pos = clonedRange.toString().length;\n clonedRange.detach();\n\n return pos;\n };\n\n return {\n getPos,\n setPos,\n getPosition,\n getOffset,\n getRange,\n };\n};\n\nexport default createEditableCaret;\n","import createInputCaret from './input';\nimport createEditableCaret from './editable';\nimport {\n isContentEditable,\n getContext,\n isObject,\n} from './utils';\n\nexport { getOffset } from './utils';\n\nconst createCaret = (element, ctx) => {\n if (isContentEditable(element)) {\n return createEditableCaret(element, ctx);\n }\n\n return createInputCaret(element, ctx);\n};\n\nexport const position = (element, value, settings = {}) => {\n let options = settings;\n if (isObject(value)) {\n options = value;\n value = null;\n }\n const ctx = getContext(options);\n const caret = createCaret(element, ctx);\n\n if (value || value === 0) {\n return caret.setPos(value);\n }\n\n return caret.getPosition();\n};\n\n/**\n *\n * @param {Element} element The DOM element\n * @param {number|undefined} value The value to set\n * @param {object} settings Any settings for context\n */\nexport const offset = (element, value, settings = {}) => {\n let options = settings;\n if (isObject(value)) {\n options = value;\n value = null;\n }\n\n const ctx = getContext(options);\n const caret = createCaret(element, ctx);\n return caret.getOffset(value);\n};\n","import * as DataEvent from '../events/DataEvent';\nimport DateUtils from './DateUtils';\nimport {\n position,\n offset\n} from 'caret-pos';\n\nimport EventEmitter from '../events/EventEmitter';\nimport * as EditorEvent from '../events/EditorEvent';\n\nclass TextEditor extends EventEmitter {\n\n //--------------------------\n // constructor\n //--------------------------\n constructor(textEditor, scrollLimit) {\n super();\n hljs.initHighlightingOnLoad();\n //this.dataUtils = new DataUtils();\n this.dateUtils = new DateUtils();\n this.textEditor = textEditor;\n this.fixLimit = scrollLimit;\n this.caretPos = null;\n this.url = '';\n let self = this;\n this.setInputs();\n\n window.addEventListener(\"scroll\", f => {\n var fixLimit = this.fixLimit;\n if (window.pageYOffset >= fixLimit) {\n document.getElementById('edit-control').style.position = \"fixed\"\n } else {\n document.getElementById('edit-control').style.position = \"relative\"\n }\n });\n this.refresh();\n }\n //--------------------------\n // methods\n //--------------------------\n setInputs() {\n let self = this;\n var editorButtons = document.querySelectorAll('.editor-button');\n for (var i = 0, length = editorButtons.length; i < length; i++) {\n editorButtons[i].addEventListener('click', e => this.handleEditorOption(e), false);\n }\n this.textEditor.addEventListener('input', f => {\n self.refresh();\n })\n }\n\n refresh() {\n var caret = position(this.textEditor).pos;\n var spiffed = hljs.highlight('markdown', this.textEditor.innerText).value;\n var temp = document.createElement(\"div\");\n temp.innerText = spiffed;\n this.textEditor.innerHTML = temp.innerText;\n position(this.textEditor, caret)\n }\n\n notify(type, data) {\n switch (type) {\n case DataEvent.POST_UPDATED:\n document.getElementById('submit-update').classList.add('icon-hide');\n document.getElementById('submit-good').classList.remove('icon-hide');\n document.getElementById('option-update').classList.remove('submit-start');\n document.getElementById('option-update').classList.add('submit-cool');\n setTimeout(f => {\n document.getElementById('submit-update').classList.remove('icon-hide');\n document.getElementById('submit-good').classList.add('icon-hide');\n document.getElementById('option-update').classList.add('submit-start');\n document.getElementById('option-update').classList.remove('submit-cool');\n }, 2000);\n\n break;\n case DataEvent.POST_ADDED:\n // do nothing\n break;\n case EditorEvent.EDITOR_UPLOAD_POST_IMAGE:\n position(this.textEditor, this.caretPos);\n var sel, range, pulled;\n sel = window.getSelection(); //console.log(sel)\n //console.log(note.message)\n if (sel.rangeCount) {\n range = sel.getRangeAt(0);\n pulled = sel.getRangeAt(0).toString();\n range.deleteContents();\n range.insertNode(document.createTextNode(\"![image alt text](\" + data + \" 'image title')\"));\n }\n this.refresh();\n break;\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n handleEditorOption(e) {\n e.preventDefault();\n var self = this;\n var sel, range, pulled;\n sel = window.getSelection(); //console.log(sel)\n if (sel.rangeCount) {\n range = sel.getRangeAt(0);\n pulled = sel.getRangeAt(0).toString();\n range.deleteContents();\n switch (e.target.id) {\n case \"option-bold\":\n range.insertNode(document.createTextNode(\"**\" + pulled + \"**\"));\n break;\n case \"option-italic\":\n range.insertNode(document.createTextNode(\"*\" + pulled + \"*\"));\n break;\n case \"option-strikethrough\":\n range.insertNode(document.createTextNode(\"\" + pulled + \"\"));\n break;\n case \"option-header1\":\n range.insertNode(document.createTextNode(\"# \" + pulled));\n break;\n case \"option-header2\":\n range.insertNode(document.createTextNode(\"## \" + pulled));\n break;\n case \"option-header3\":\n range.insertNode(document.createTextNode(\"### \" + pulled));\n break;\n case \"option-image\":\n this.caretPos = position(this.textEditor).pos;\n this.emitEvent(EditorEvent.EDITOR_UPLOAD_POST_IMAGE);\n break;\n case \"submit-save\":\n case \"option-save\":\n this.emitEvent(EditorEvent.EDITOR_SAVE);\n break;\n case \"submit-update\":\n case \"option-update\":\n this.emitEvent(EditorEvent.EDITOR_UPDATE);\n break\n case \"option-link\":\n range.insertNode(document.createTextNode(\"[\" + pulled + \"](PASTE URL HERE)\"));\n break;\n case \"option-delete\":\n this.emitEvent(EditorEvent.EDITOR_DELETE);\n break\n default:\n //range.insertNode(document.createTextNode(\"[\" + self.url + \"](PASTE URL HERE)\"));\n break;\n }\n }\n this.refresh()\n }\n}\nexport default TextEditor","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.TinyDatePicker = factory());\n}(this, (function () { 'use strict';\n\n /**\n * @file A generic set of mutation-free date functions.\n */\n\n /**\n * now returns the current date without any time values\n *\n * @returns {Date}\n */\n function now() {\n var dt = new Date();\n dt.setHours(0, 0, 0, 0);\n return dt;\n }\n\n /**\n * dateEq compares two dates\n *\n * @param {Date} date1 the first date\n * @param {Date} date2 the second date\n * @returns {boolean}\n */\n function datesEq(date1, date2) {\n return (date1 && date1.toDateString()) === (date2 && date2.toDateString());\n }\n\n /**\n * shiftDay shifts the specified date by n days\n *\n * @param {Date} dt\n * @param {number} n\n * @returns {Date}\n */\n function shiftDay(dt, n) {\n dt = new Date(dt);\n dt.setDate(dt.getDate() + n);\n return dt;\n }\n\n /**\n * shiftMonth shifts the specified date by a specified number of months\n *\n * @param {Date} dt\n * @param {number} n\n * @param {boolean} wrap optional, if true, does not change year\n * value, defaults to false\n * @returns {Date}\n */\n function shiftMonth(dt, n, wrap) {\n dt = new Date(dt);\n\n var dayOfMonth = dt.getDate();\n var month = dt.getMonth() + n;\n\n dt.setDate(1);\n dt.setMonth(wrap ? (12 + month) % 12 : month);\n dt.setDate(dayOfMonth);\n\n // If dayOfMonth = 31, but the target month only has 30 or 29 or whatever...\n // head back to the max of the target month\n if (dt.getDate() < dayOfMonth) {\n dt.setDate(0);\n }\n\n return dt;\n }\n\n /**\n * shiftYear shifts the specified date by n years\n *\n * @param {Date} dt\n * @param {number} n\n * @returns {Date}\n */\n function shiftYear(dt, n) {\n dt = new Date(dt);\n dt.setFullYear(dt.getFullYear() + n);\n return dt;\n }\n\n /**\n * setYear changes the specified date to the specified year\n *\n * @param {Date} dt\n * @param {number} year\n */\n function setYear(dt, year) {\n dt = new Date(dt);\n dt.setFullYear(year);\n return dt;\n }\n\n /**\n * setMonth changes the specified date to the specified month\n *\n * @param {Date} dt\n * @param {number} month\n */\n function setMonth(dt, month) {\n return shiftMonth(dt, month - dt.getMonth());\n }\n\n /**\n * dateOrParse creates a function which, given a date or string, returns a date\n *\n * @param {function} parse the function used to parse strings\n * @returns {function}\n */\n function dateOrParse(parse) {\n return function (dt) {\n return dropTime(typeof dt === 'string' ? parse(dt) : dt);\n };\n }\n\n /**\n * constrainDate returns dt or min/max depending on whether dt is out of bounds (inclusive)\n *\n * @export\n * @param {Date} dt\n * @param {Date} min\n * @param {Date} max\n * @returns {Date}\n */\n function constrainDate(dt, min, max) {\n return (dt < min) ? min :\n (dt > max) ? max :\n dt;\n }\n\n function dropTime(dt) {\n dt = new Date(dt);\n dt.setHours(0, 0, 0, 0);\n return dt;\n }\n\n /**\n * @file Utility functions for function manipulation.\n */\n\n /**\n * bufferFn buffers calls to fn so they only happen every ms milliseconds\n *\n * @param {number} ms number of milliseconds\n * @param {function} fn the function to be buffered\n * @returns {function}\n */\n function bufferFn(ms, fn) {\n var timeout = undefined;\n return function () {\n clearTimeout(timeout);\n timeout = setTimeout(fn, ms);\n };\n }\n\n /**\n * noop is a function which does nothing at all.\n */\n function noop() { }\n\n /**\n * copy properties from object o2 to object o1.\n *\n * @params {Object} o1\n * @params {Object} o2\n * @returns {Object}\n */\n function cp() {\n var args = arguments;\n var o1 = args[0];\n for (var i = 1; i < args.length; ++i) {\n var o2 = args[i] || {};\n for (var key in o2) {\n o1[key] = o2[key];\n }\n }\n return o1;\n }\n\n /**\n * @file Responsible for sanitizing and creating date picker options.\n */\n\n var english = {\n days: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n today: 'Today',\n clear: 'Clear',\n close: 'Close',\n };\n\n /**\n * DatePickerOptions constructs a new date picker options object, overriding\n * default values with any values specified in opts.\n *\n * @param {DatePickerOptions} opts\n * @returns {DatePickerOptions}\n */\n function DatePickerOptions(opts) {\n opts = opts || {};\n opts = cp(defaults(), opts);\n var parse = dateOrParse(opts.parse);\n opts.lang = cp(english, opts.lang);\n opts.parse = parse;\n opts.inRange = makeInRangeFn(opts);\n opts.min = parse(opts.min || shiftYear(now(), -100));\n opts.max = parse(opts.max || shiftYear(now(), 100));\n opts.hilightedDate = opts.parse(opts.hilightedDate);\n\n return opts;\n }\n\n function defaults() {\n return {\n lang: english,\n\n // Possible values: dp-modal, dp-below, dp-permanent\n mode: 'dp-modal',\n\n // The date to hilight initially if the date picker has no\n // initial value.\n hilightedDate: now(),\n\n format: function (dt) {\n return (dt.getMonth() + 1) + '/' + dt.getDate() + '/' + dt.getFullYear();\n },\n\n parse: function (str) {\n var date = new Date(str);\n return isNaN(date) ? now() : date;\n },\n\n dateClass: function () { },\n\n inRange: function () {\n return true;\n }\n };\n }\n\n function makeInRangeFn(opts) {\n var inRange = opts.inRange; // Cache this version, and return a variant\n\n return function (dt, dp) {\n return inRange(dt, dp) && opts.min <= dt && opts.max >= dt;\n };\n }\n\n /**\n * @file Helper functions for dealing with dom elements.\n */\n\n var Key = {\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n enter: 13,\n esc: 27,\n };\n\n /**\n * on attaches an event handler to the specified element, and returns an\n * off function which can be used to remove the handler.\n *\n * @param {string} evt the name of the event to handle\n * @param {HTMLElement} el the element to attach to\n * @param {function} handler the event handler\n * @returns {function} the off function\n */\n function on(evt, el, handler) {\n el.addEventListener(evt, handler, true);\n\n return function () {\n el.removeEventListener(evt, handler, true);\n };\n }\n\n var CustomEvent = shimCustomEvent();\n\n function shimCustomEvent() {\n var CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function (event, params) {\n params = params || {bubbles: false, cancelable: false, detail: undefined};\n var evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n }\n\n return CustomEvent;\n }\n\n /**\n * @file Manages the calendar / day-picker view.\n */\n\n var dayPicker = {\n onKeyDown: keyDown,\n onClick: {\n 'dp-day': selectDay,\n 'dp-next': gotoNextMonth,\n 'dp-prev': gotoPrevMonth,\n 'dp-today': selectToday,\n 'dp-clear': clear,\n 'dp-close': close,\n 'dp-cal-month': showMonthPicker,\n 'dp-cal-year': showYearPicker,\n },\n render: render\n };\n\n /**\n * view renders the calendar (day picker) as an HTML string.\n *\n * @param {DatePickerContext} context the date picker being rendered\n * @returns {string}\n */\n function render(dp) {\n var opts = dp.opts;\n var lang = opts.lang;\n var state = dp.state;\n var dayNames = lang.days;\n var dayOffset = opts.dayOffset || 0;\n var selectedDate = state.selectedDate;\n var hilightedDate = state.hilightedDate;\n var hilightedMonth = hilightedDate.getMonth();\n var today = now().getTime();\n\n return (\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '' +\n '
' +\n '
' +\n dayNames.map(function (name, i) {\n return (\n '' + dayNames[(i + dayOffset) % dayNames.length] + ''\n );\n }).join('') +\n mapDays(hilightedDate, dayOffset, function (date) {\n var isNotInMonth = date.getMonth() !== hilightedMonth;\n var isDisabled = !opts.inRange(date);\n var isToday = date.getTime() === today;\n var className = 'dp-day';\n className += (isNotInMonth ? ' dp-edge-day' : '');\n className += (datesEq(date, hilightedDate) ? ' dp-current' : '');\n className += (datesEq(date, selectedDate) ? ' dp-selected' : '');\n className += (isDisabled ? ' dp-day-disabled' : '');\n className += (isToday ? ' dp-day-today' : '');\n className += ' ' + opts.dateClass(date, dp);\n\n return (\n ''\n );\n }) +\n '
' +\n '
' +\n '' +\n '' +\n '' +\n '
' +\n '
'\n );\n }\n\n /**\n * keyDown handles the key down event for the day-picker\n *\n * @param {Event} e\n * @param {DatePickerContext} dp\n */\n function keyDown(e, dp) {\n var key = e.keyCode;\n var shiftBy =\n (key === Key.left) ? -1 :\n (key === Key.right) ? 1 :\n (key === Key.up) ? -7 :\n (key === Key.down) ? 7 :\n 0;\n\n if (key === Key.esc) {\n dp.close();\n } else if (shiftBy) {\n e.preventDefault();\n dp.setState({\n hilightedDate: shiftDay(dp.state.hilightedDate, shiftBy)\n });\n }\n }\n\n function selectToday(e, dp) {\n dp.setState({\n selectedDate: now(),\n });\n }\n\n function clear(e, dp) {\n dp.setState({\n selectedDate: null,\n });\n }\n\n function close(e, dp) {\n dp.close();\n }\n\n function showMonthPicker(e, dp) {\n dp.setState({\n view: 'month'\n });\n }\n\n function showYearPicker(e, dp) {\n dp.setState({\n view: 'year'\n });\n }\n\n function gotoNextMonth(e, dp) {\n var hilightedDate = dp.state.hilightedDate;\n dp.setState({\n hilightedDate: shiftMonth(hilightedDate, 1)\n });\n }\n\n function gotoPrevMonth(e, dp) {\n var hilightedDate = dp.state.hilightedDate;\n dp.setState({\n hilightedDate: shiftMonth(hilightedDate, -1)\n });\n }\n\n function selectDay(e, dp) {\n dp.setState({\n selectedDate: new Date(parseInt(e.target.getAttribute('data-date'))),\n });\n }\n\n function mapDays(currentDate, dayOffset, fn) {\n var result = '';\n var iter = new Date(currentDate);\n iter.setDate(1);\n iter.setDate(1 - iter.getDay() + dayOffset);\n\n // If we are showing monday as the 1st of the week,\n // and the monday is the 2nd of the month, the sunday won't\n // show, so we need to shift backwards\n if (dayOffset && iter.getDate() === dayOffset + 1) {\n iter.setDate(dayOffset - 6);\n }\n\n // We are going to have 6 weeks always displayed to keep a consistent\n // calendar size\n for (var day = 0; day < (6 * 7); ++day) {\n result += fn(iter);\n iter.setDate(iter.getDate() + 1);\n }\n\n return result;\n }\n\n /**\n * @file Manages the month-picker view.\n */\n\n var monthPicker = {\n onKeyDown: keyDown$1,\n onClick: {\n 'dp-month': onChooseMonth\n },\n render: render$1\n };\n\n function onChooseMonth(e, dp) {\n dp.setState({\n hilightedDate: setMonth(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-month'))),\n view: 'day',\n });\n }\n\n /**\n * render renders the month picker as an HTML string\n *\n * @param {DatePickerContext} dp the date picker context\n * @returns {string}\n */\n function render$1(dp) {\n var opts = dp.opts;\n var lang = opts.lang;\n var months = lang.months;\n var currentDate = dp.state.hilightedDate;\n var currentMonth = currentDate.getMonth();\n\n return (\n '
' +\n months.map(function (month, i) {\n var className = 'dp-month';\n className += (currentMonth === i ? ' dp-current' : '');\n\n return (\n ''\n );\n }).join('') +\n '
'\n );\n }\n\n /**\n * keyDown handles keydown events that occur in the month picker\n *\n * @param {Event} e\n * @param {DatePickerContext} dp\n */\n function keyDown$1(e, dp) {\n var key = e.keyCode;\n var shiftBy =\n (key === Key.left) ? -1 :\n (key === Key.right) ? 1 :\n (key === Key.up) ? -3 :\n (key === Key.down) ? 3 :\n 0;\n\n if (key === Key.esc) {\n dp.setState({\n view: 'day',\n });\n } else if (shiftBy) {\n e.preventDefault();\n dp.setState({\n hilightedDate: shiftMonth(dp.state.hilightedDate, shiftBy, true)\n });\n }\n }\n\n /**\n * @file Manages the year-picker view.\n */\n\n var yearPicker = {\n render: render$2,\n onKeyDown: keyDown$2,\n onClick: {\n 'dp-year': onChooseYear\n },\n };\n\n /**\n * view renders the year picker as an HTML string.\n *\n * @param {DatePickerContext} dp the date picker context\n * @returns {string}\n */\n function render$2(dp) {\n var state = dp.state;\n var currentYear = state.hilightedDate.getFullYear();\n var selectedYear = state.selectedDate.getFullYear();\n\n return (\n '
' +\n mapYears(dp, function (year) {\n var className = 'dp-year';\n className += (year === currentYear ? ' dp-current' : '');\n className += (year === selectedYear ? ' dp-selected' : '');\n\n return (\n ''\n );\n }) +\n '
'\n );\n }\n\n function onChooseYear(e, dp) {\n dp.setState({\n hilightedDate: setYear(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-year'))),\n view: 'day',\n });\n }\n\n function keyDown$2(e, dp) {\n var key = e.keyCode;\n var opts = dp.opts;\n var shiftBy =\n (key === Key.left || key === Key.up) ? 1 :\n (key === Key.right || key === Key.down) ? -1 :\n 0;\n\n if (key === Key.esc) {\n dp.setState({\n view: 'day',\n });\n } else if (shiftBy) {\n e.preventDefault();\n var shiftedYear = shiftYear(dp.state.hilightedDate, shiftBy);\n\n dp.setState({\n hilightedDate: constrainDate(shiftedYear, opts.min, opts.max),\n });\n }\n }\n\n function mapYears(dp, fn) {\n var result = '';\n var max = dp.opts.max.getFullYear();\n\n for (var i = max; i >= dp.opts.min.getFullYear(); --i) {\n result += fn(i);\n }\n\n return result;\n }\n\n /**\n * @file Defines the base date picker behavior, overridden by various modes.\n */\n\n var views = {\n day: dayPicker,\n year: yearPicker,\n month: monthPicker\n };\n\n function BaseMode(input, emit, opts) {\n var detatchInputEvents; // A function that detaches all events from the input\n var closing = false; // A hack to prevent calendar from re-opening when closing.\n var selectedDate; // The currently selected date\n var dp = {\n // The root DOM element for the date picker, initialized on first open.\n el: undefined,\n opts: opts,\n shouldFocusOnBlur: true,\n shouldFocusOnRender: true,\n state: initialState(),\n adjustPosition: noop,\n containerHTML: '
',\n\n attachToDom: function () {\n document.body.appendChild(dp.el);\n },\n\n updateInput: function (selectedDate) {\n var e = new CustomEvent('change', {bubbles: true});\n e.simulated = true;\n input.value = selectedDate ? opts.format(selectedDate) : '';\n input.dispatchEvent(e);\n },\n\n computeSelectedDate: function () {\n return opts.parse(input.value);\n },\n\n currentView: function() {\n return views[dp.state.view];\n },\n\n open: function () {\n if (closing) {\n return;\n }\n\n if (!dp.el) {\n dp.el = createContainerElement(opts, dp.containerHTML);\n attachContainerEvents(dp);\n }\n\n selectedDate = constrainDate(dp.computeSelectedDate(), opts.min, opts.max);\n dp.state.hilightedDate = selectedDate || opts.hilightedDate;\n dp.state.view = 'day';\n\n dp.attachToDom();\n dp.render();\n\n emit('open');\n },\n\n isVisible: function () {\n return !!dp.el && !!dp.el.parentNode;\n },\n\n hasFocus: function () {\n var focused = document.activeElement;\n return dp.el &&\n dp.el.contains(focused) &&\n focused.className.indexOf('dp-focuser') < 0;\n },\n\n shouldHide: function () {\n return dp.isVisible();\n },\n\n close: function (becauseOfBlur) {\n var el = dp.el;\n\n if (!dp.isVisible()) {\n return;\n }\n\n if (el) {\n var parent = el.parentNode;\n parent && parent.removeChild(el);\n }\n\n closing = true;\n\n if (becauseOfBlur && dp.shouldFocusOnBlur) {\n focusInput(input);\n }\n\n // When we close, the input often gains refocus, which\n // can then launch the date picker again, so we buffer\n // a bit and don't show the date picker within N ms of closing\n setTimeout(function() {\n closing = false;\n }, 100);\n\n emit('close');\n },\n\n destroy: function () {\n dp.close();\n detatchInputEvents();\n },\n\n render: function () {\n if (!dp.el) {\n return;\n }\n\n var hadFocus = dp.hasFocus();\n var html = dp.currentView().render(dp);\n html && (dp.el.firstChild.innerHTML = html);\n\n dp.adjustPosition();\n\n if (hadFocus || dp.shouldFocusOnRender) {\n focusCurrent(dp);\n }\n },\n\n // Conceptually similar to setState in React, updates\n // the view state and re-renders.\n setState: function (state) {\n for (var key in state) {\n dp.state[key] = state[key];\n }\n\n emit('statechange');\n dp.render();\n },\n };\n\n detatchInputEvents = attachInputEvents(input, dp);\n\n // Builds the initial view state\n // selectedDate is a special case and causes changes to hilightedDate\n // hilightedDate is set on open, so remains undefined initially\n // view is the current view (day, month, year)\n function initialState() {\n return {\n get selectedDate() {\n return selectedDate;\n },\n set selectedDate(dt) {\n if (dt && !opts.inRange(dt)) {\n return;\n }\n\n if (dt) {\n selectedDate = new Date(dt);\n dp.state.hilightedDate = selectedDate;\n } else {\n selectedDate = dt;\n }\n\n dp.updateInput(selectedDate);\n emit('select');\n dp.close();\n },\n view: 'day',\n };\n }\n\n return dp;\n }\n\n function createContainerElement(opts, containerHTML) {\n var el = document.createElement('div');\n\n el.className = opts.mode;\n el.innerHTML = containerHTML;\n\n return el;\n }\n\n function attachInputEvents(input, dp) {\n var bufferShow = bufferFn(5, function () {\n if (dp.shouldHide()) {\n dp.close();\n } else {\n dp.open();\n }\n });\n\n var off = [\n on('blur', input, bufferFn(150, function () {\n if (!dp.hasFocus()) {\n dp.close(true);\n }\n })),\n\n on('mousedown', input, function () {\n if (input === document.activeElement) {\n bufferShow();\n }\n }),\n\n on('focus', input, bufferShow),\n\n on('input', input, function (e) {\n var date = dp.opts.parse(e.target.value);\n isNaN(date) || dp.setState({\n hilightedDate: date\n });\n }),\n ];\n\n // Unregister all events that were registered above.\n return function() {\n off.forEach(function (f) {\n f();\n });\n };\n }\n\n function focusCurrent(dp) {\n var current = dp.el.querySelector('.dp-current');\n return current && current.focus();\n }\n\n function attachContainerEvents(dp) {\n var el = dp.el;\n var calEl = el.querySelector('.dp');\n\n // Hack to get iOS to show active CSS states\n el.ontouchstart = noop;\n\n function onClick(e) {\n e.target.className.split(' ').forEach(function(evt) {\n var handler = dp.currentView().onClick[evt];\n handler && handler(e, dp);\n });\n }\n\n // The calender fires a blur event *every* time we redraw\n // this means we need to buffer the blur event to see if\n // it still has no focus after redrawing, and only then\n // do we return focus to the input. A possible other approach\n // would be to set context.redrawing = true on redraw and\n // set it to false in the blur event.\n on('blur', calEl, bufferFn(150, function () {\n if (!dp.hasFocus()) {\n dp.close(true);\n }\n }));\n\n on('keydown', el, function (e) {\n if (e.keyCode === Key.enter) {\n onClick(e);\n } else {\n dp.currentView().onKeyDown(e, dp);\n }\n });\n\n // If the user clicks in non-focusable space, but\n // still within the date picker, we don't want to\n // hide, so we need to hack some things...\n on('mousedown', calEl, function (e) {\n e.target.focus && e.target.focus(); // IE hack\n if (document.activeElement !== e.target) {\n e.preventDefault();\n focusCurrent(dp);\n }\n });\n\n on('click', el, onClick);\n }\n\n function focusInput(input) {\n // When the modal closes, we need to focus the original input so the\n // user can continue tabbing from where they left off.\n input.focus();\n\n // iOS zonks out if we don't blur the input, so...\n if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {\n input.blur();\n }\n }\n\n /**\n * @file Defines the modal date picker behavior.\n */\n\n function ModalMode(input, emit, opts) {\n var dp = BaseMode(input, emit, opts);\n\n // In modal mode, users really shouldn't be able to type in\n // the input, as all input is done via the calendar.\n input.readonly = true;\n\n // In modal mode, we need to know when the user has tabbed\n // off the end of the calendar, and set focus to the original\n // input. To do this, we add a special element to the DOM.\n // When the user tabs off the bottom of the calendar, they\n // will tab onto this element.\n dp.containerHTML += '.';\n\n return dp;\n }\n\n /**\n * @file Defines the dropdown date picker behavior.\n */\n\n function DropdownMode(input, emit, opts) {\n var dp = BaseMode(input, emit, opts);\n\n dp.shouldFocusOnBlur = false;\n\n Object.defineProperty(dp, 'shouldFocusOnRender', {\n get: function() {\n return input !== document.activeElement;\n }\n });\n\n dp.adjustPosition = function () {\n autoPosition(input, dp);\n };\n\n return dp;\n }\n\n function autoPosition(input, dp) {\n var inputPos = input.getBoundingClientRect();\n var win = window;\n\n adjustCalY(dp, inputPos, win);\n adjustCalX(dp, inputPos, win);\n\n dp.el.style.visibility = '';\n }\n\n function adjustCalX(dp, inputPos, win) {\n var cal = dp.el;\n var scrollLeft = win.pageXOffset;\n var inputLeft = inputPos.left + scrollLeft;\n var maxRight = win.innerWidth + scrollLeft;\n var offsetWidth = cal.offsetWidth;\n var calRight = inputLeft + offsetWidth;\n var shiftedLeft = maxRight - offsetWidth;\n var left = calRight > maxRight && shiftedLeft > 0 ? shiftedLeft : inputLeft;\n\n cal.style.left = left + 'px';\n }\n\n function adjustCalY(dp, inputPos, win) {\n var cal = dp.el;\n var scrollTop = win.pageYOffset;\n var inputTop = scrollTop + inputPos.top;\n var calHeight = cal.offsetHeight;\n var belowTop = inputTop + inputPos.height + 8;\n var aboveTop = inputTop - calHeight - 8;\n var isAbove = (aboveTop > 0 && belowTop + calHeight > scrollTop + win.innerHeight);\n var top = isAbove ? aboveTop : belowTop;\n\n if (cal.classList) {\n cal.classList.toggle('dp-is-above', isAbove);\n cal.classList.toggle('dp-is-below', !isAbove);\n }\n cal.style.top = top + 'px';\n }\n\n /**\n * @file Defines the permanent date picker behavior.\n */\n\n function PermanentMode(root, emit, opts) {\n var dp = BaseMode(root, emit, opts);\n\n dp.close = noop;\n dp.destroy = noop;\n dp.updateInput = noop;\n dp.shouldFocusOnRender = opts.shouldFocusOnRender;\n\n dp.computeSelectedDate = function () {\n return opts.hilightedDate;\n };\n\n dp.attachToDom = function () {\n root.appendChild(dp.el);\n };\n\n dp.open();\n\n return dp;\n }\n\n /**\n * @file Defines the various date picker modes (modal, dropdown, permanent)\n */\n\n function Mode(input, emit, opts) {\n input = input && input.tagName ? input : document.querySelector(input);\n\n if (opts.mode === 'dp-modal') {\n return ModalMode(input, emit, opts);\n }\n\n if (opts.mode === 'dp-below') {\n return DropdownMode(input, emit, opts);\n }\n\n if (opts.mode === 'dp-permanent') {\n return PermanentMode(input, emit, opts);\n }\n }\n\n /**\n * @file Defines simple event emitter behavior.\n */\n\n /**\n * Emitter constructs a new emitter object which has on/off methods.\n *\n * @returns {EventEmitter}\n */\n function Emitter() {\n var handlers = {};\n\n function onOne(name, handler) {\n (handlers[name] = (handlers[name] || [])).push(handler);\n }\n\n function onMany(fns) {\n for (var name in fns) {\n onOne(name, fns[name]);\n }\n }\n\n return {\n on: function (name, handler) {\n if (handler) {\n onOne(name, handler);\n } else {\n onMany(name);\n }\n\n return this;\n },\n\n emit: function (name, arg) {\n (handlers[name] || []).forEach(function (handler) {\n handler(name, arg);\n });\n },\n\n off: function (name, handler) {\n if (!name) {\n handlers = {};\n } else if (!handler) {\n handlers[name] = [];\n } else {\n handlers[name] = (handlers[name] || []).filter(function (h) {\n return h !== handler;\n });\n }\n\n return this;\n }\n };\n }\n\n /**\n * @file The root date picker file, defines public exports for the library.\n */\n\n /**\n * The date picker language configuration\n * @typedef {Object} LangOptions\n * @property {Array.} [days] - Days of the week\n * @property {Array.} [months] - Months of the year\n * @property {string} today - The label for the 'today' button\n * @property {string} close - The label for the 'close' button\n * @property {string} clear - The label for the 'clear' button\n */\n\n /**\n * The configuration options for a date picker.\n *\n * @typedef {Object} DatePickerOptions\n * @property {LangOptions} [lang] - Configures the label text, defaults to English\n * @property {('dp-modal'|'dp-below'|'dp-permanent')} [mode] - The date picker mode, defaults to 'dp-modal'\n * @property {(string|Date)} [hilightedDate] - The date to hilight if no date is selected\n * @property {function(string|Date):Date} [parse] - Parses a date, the complement of the \"format\" function\n * @property {function(Date):string} [format] - Formats a date for displaying to user\n * @property {function(Date):string} [dateClass] - Associates a custom CSS class with a date\n * @property {function(Date):boolean} [inRange] - Indicates whether or not a date is selectable\n * @property {(string|Date)} [min] - The minimum selectable date (inclusive, default 100 years ago)\n * @property {(string|Date)} [max] - The maximum selectable date (inclusive, default 100 years from now)\n */\n\n /**\n * The state values for the date picker\n *\n * @typedef {Object} DatePickerState\n * @property {string} view - The current view 'day' | 'month' | 'year'\n * @property {Date} selectedDate - The date which has been selected by the user\n * @property {Date} hilightedDate - The date which is currently hilighted / active\n */\n\n /**\n * An instance of TinyDatePicker\n *\n * @typedef {Object} DatePicker\n * @property {DatePickerState} state - The values currently displayed.\n * @property {function} on - Adds an event handler\n * @property {function} off - Removes an event handler\n * @property {function} setState - Changes the current state of the date picker\n * @property {function} open - Opens the date picker\n * @property {function} close - Closes the date picker\n * @property {function} destroy - Destroys the date picker (removing all handlers from the input, too)\n */\n\n /**\n * TinyDatePicker constructs a new date picker for the specified input\n *\n * @param {HTMLElement | string} input The input or CSS selector associated with the datepicker\n * @param {DatePickerOptions} opts The options for initializing the date picker\n * @returns {DatePicker}\n */\n function TinyDatePicker(input, opts) {\n var emitter = Emitter();\n var options = DatePickerOptions(opts);\n var mode = Mode(input, emit, options);\n var me = {\n get state() {\n return mode.state;\n },\n on: emitter.on,\n off: emitter.off,\n setState: mode.setState,\n open: mode.open,\n close: mode.close,\n destroy: mode.destroy,\n };\n\n function emit(evt) {\n emitter.emit(evt, me);\n }\n\n return me;\n }\n\n return TinyDatePicker;\n\n})));\n","//TOOLS\nimport DataUtils, {\n REQUEST_TYPE_GET,\n REQUEST_TYPE_PUT,\n REQUEST_TYPE_POST,\n REQUEST_TYPE_DELETE,\n CONTENT_TYPE_JSON,\n CONTENT_TYPE_FORM\n} from '../tools/utilities/DataUtils';\nimport * as DataEvent from '../tools/events/DataEvent';\nimport Animate from '../tools/effects/Animate';\nimport * as Ease from '../tools/effects/Animate';\nimport EntryTasks from '../tasks/EntryTasks';\nimport * as EditorEvent from '../tools/events/EditorEvent';\nimport TextEditor from '../tools/utilities/TextEditor';\nimport TinyDatePicker from 'tiny-date-picker';\nimport DateUtils from '../tools/utilities/DateUtils';\n\n\nclass Entry {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n reframe('iframe');\n let self = this;\n this.uploadFiles;\n this.dataUtils = new DataUtils();\n this.dateUtils = new DateUtils();\n\n if (document.getElementById('edit-text-code')) {\n this.editor = new TextEditor(document.getElementById('edit-text-code'),\n document.getElementById('header').offsetHeight +\n document.getElementById('entry-header').offsetHeight +\n document.getElementById('entry-feature').offsetHeight\n );\n\n this.editor.addListener(EditorEvent.EDITOR_DELETE, f => this.handleEditorOptions(EditorEvent.EDITOR_DELETE), false)\n this.editor.addListener(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, f => this.handleEditorOptions(EditorEvent.EDITOR_UPLOAD_POST_IMAGE), false)\n this.editor.addListener(EditorEvent.EDITOR_UPDATE, f => this.handleEditorOptions(EditorEvent.EDITOR_UPDATE), false)\n this.editor.addListener(EditorEvent.EDITOR_SAVE, f => this.handleEditorOptions(EditorEvent.EDITOR_SAVE), false)\n document.getElementById('post-image').addEventListener('change', e => this.handlePostImageAdd(e), false);\n\n TinyDatePicker(document.getElementById('entry-date'), {\n mode: 'dp-below',\n format(date) {\n //return date;\n return self.dateUtils.getDate('origin', date);\n }\n });\n }\n this.start();\n }\n //--------------------------\n // methods\n //--------------------------\n start() {\n let self = this;\n new Animate().object({\n targets: document.getElementById('loader'),\n duration: 300,\n opacity: 0,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n new Animate().object({\n targets: document.getElementById('header'),\n duration: 10,\n opacity: 1,\n easing: 'easeInOutQuad',\n complete: function () {\n if (document.getElementById('the-intro'))\n document.getElementById('the-intro').style.opacity = 1;\n if (document.getElementById('blog-entry'))\n document.getElementById('blog-entry').style.opacity = 1;\n }\n });\n }\n });\n\n if (document.getElementById('featured-image-drop')) {\n document.getElementById('featured-image-drop').addEventListener('dragover', this.handleDragOver, false);\n document.getElementById('featured-image-drop').addEventListener('drop', this.handleDrop, false);\n document.getElementById('featured-click').addEventListener('change', this.handleClicked, false);\n\n if (document.getElementById('new-upload-link')) {\n document.getElementById('new-upload-link').addEventListener('click', e => {\n document.getElementById('featured-click').click();\n })\n }\n }\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n handleEditorOptions(e) {\n switch (e) {\n case EditorEvent.EDITOR_SAVE:\n case EditorEvent.EDITOR_UPDATE:\n let edit = false;\n if (e == EditorEvent.EDITOR_UPDATE)\n edit = true;\n new EntryTasks().submitPost(edit, Entry.uploadFiles).then((response) => {\n let note = JSON.parse(response['response']['request'].response);\n this.editor.notify(note.message, note.postID);\n if (note.message == DataEvent.POST_ADDED)\n window.location = \"/@/dashboard/entries/edit/\" + note.postID;\n }).catch((err) => {\n console.log(err)\n });\n break;\n\n case EditorEvent.EDITOR_DELETE:\n\n if (confirm('Aye! You know you\\'re deleting this post, right?')) {\n new EntryTasks().deletePost().then((response) => {\n let note = JSON.parse(response['response']['request'].response);\n window.location = \"/@/dashboard/entries/\";\n //console.log(note);\n }).catch((err) => {\n console.log(err)\n });\n } else {\n // Do nothing!\n }\n break;\n\n case EditorEvent.EDITOR_UPLOAD_POST_IMAGE:\n document.getElementById('post-image').click();\n break;\n }\n }\n\n handleDragOver(e) {\n e.stopPropagation();\n e.preventDefault();\n e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.\n }\n handleClicked(e) {\n e.stopPropagation();\n e.preventDefault();\n //console.log(\"IMAGES \" + e.target.files);\n Entry.uploadFiles = e.target.files;\n for (var i = 0, f; f = Entry.uploadFiles[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function (theFile) {\n return function (f) {\n // Render thumbnail.\n var span = document.createElement('span');\n span.innerHTML = [\n ''\n ].join('');\n //document.getElementById('featured-image-drop').insertBefore(span, null);\n document.getElementById('featured-image-drop').innerHTML = '';\n document.getElementById('featured-image-drop').appendChild(span);\n };\n })(f);\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n\n }\n\n handleDrop(e) {\n e.stopPropagation();\n e.preventDefault();\n Entry.uploadFiles = e.dataTransfer.files;\n //console.log(MemberArea.uploadFiles.length);\n for (var i = 0, f; f = Entry.uploadFiles[i]; i++) {\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n var reader = new FileReader();\n // Closure to capture the file information.\n reader.onload = (function (theFile) {\n return function (f) {\n // Render thumbnail.\n var span = document.createElement('span');\n span.innerHTML = [\n ''\n ].join('');\n //document.getElementById('featured-image-drop').insertBefore(span, null);\n document.getElementById('featured-image-drop').innerHTML = '';\n document.getElementById('featured-image-drop').appendChild(span);\n };\n })(f);\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n }\n\n handlePostImageAdd(e) {\n e.stopPropagation();\n e.preventDefault();\n let self = this;\n\n var postData = new FormData();\n var files = e.target.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n // Check the file type.\n if (!file.type.match('image.*')) {\n continue;\n }\n postData.append('post_image', file, file.name);\n }\n this.dataUtils.request(\"/api/blog/add-post-image\", DataEvent.POST_IMAGE_ADDED, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, postData)\n .then((response) => {\n self.editor.notify(EditorEvent.EDITOR_UPLOAD_POST_IMAGE, JSON.parse(response.request['response']).url);\n }).catch((err) => {\n console.log(err)\n })\n }\n}\nEntry.uploadFiles = [];\nexport {\n Entry as\n default\n}","//TOOLS\nimport DataUtils, {\n REQUEST_TYPE_GET,\n REQUEST_TYPE_PUT,\n REQUEST_TYPE_POST,\n REQUEST_TYPE_DELETE,\n CONTENT_TYPE_JSON,\n CONTENT_TYPE_FORM\n} from '../tools/utilities/DataUtils.jsx';\nimport Entry from './DashEntry';\nimport Animate from '../tools/effects/Animate.jsx';\nclass DisplayManager {\n //--------------------------\n // constructor\n //--------------------------\n constructor() {\n this.dataUtils = new DataUtils();\n this.currentDisplay = '';\n this.urlPieces = document.URL.split(\"/\");\n //grab url so system knows what to display \n this.chooseDisplay(this.urlPieces[5], this.urlPieces[6]);\n\n }\n //--------------------------\n // methods\n //--------------------------\n start() {\n let self = this;\n new Animate().object({\n targets: document.getElementById('loader'),\n duration: 300,\n opacity: 0,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n new Animate().object({\n targets: document.getElementById('header'),\n duration: 10,\n opacity: 1,\n easing: 'easeInOutQuad',\n complete: function () {\n document.getElementById('loader').style.display = 'none';\n document.getElementById('loader').style.visibility = 'hidden';\n }\n });\n }\n });\n }\n\n chooseDisplay(section, page) {\n this.currentDisplay = '';\n //console.log(section+\" \"+page)\n switch (section) {\n case 'entries':\n this\n this.currentDisplay = new Entry();\n break;\n \n default:\n // just chill\n break;\n }\n this.start();\n\n }\n //--------------------------\n // event handlers\n //--------------------------\n\n}\nexport {\n DisplayManager as\n default\n}","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';\nimport * as DataEvent from './tools/events/DataEvent.jsx';\nimport DisplayManager from './controllers/DisplayManager.jsx';\n\nexport default class Base {\n //--------------------------\n // constructor\n //--------------------------\n \n //TODO: Flip to unified structure defined in BMG, brah\n constructor() {\n var self = this;\n var admin = [];\n var folio = [];\n var displayManager = [];\n this.dataUtils = new DataUtils();\n this.settings = [];\n this.start(); \n }\n start() {\n this.displayManager = new DisplayManager();\n }\n //--------------------------\n // methods\n //--------------------------\n loadSettings() {\n var self = this;\n this.dataUtils.request('/base-assets/data/settings.json', DataEvent.SETTINGS_LOADED)\n .then((response) => {\n this.settings = JSON.parse(response['request'].response);\n this.start();\n //transfer \n \n })\n .catch((err) => {\n //console.log(err);\n });\n }\n\n //--------------------------\n // event handlers\n //--------------------------\n\n}\n","import Base from './Base.jsx'\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\n var base = new Base();\n}, false);\n"]} \ No newline at end of file diff --git a/themes/dash/partials/front.pug b/themes/dash/partials/front.pug index 3f56a78..a5384ec 100644 --- a/themes/dash/partials/front.pug +++ b/themes/dash/partials/front.pug @@ -25,7 +25,7 @@ br - var index = 0; - for ( index; index < items.length; index++) - a(href="/@/dashboard/edit"+items[index].slug id=items[index].uuid) + a(href="/@/dashboard/entries/edit/"+items[index].slug id=items[index].uuid) = items[index].title br br diff --git a/themes/dash/src/com/controllers/DashEntry.jsx b/themes/dash/src/com/controllers/DashEntry.jsx index b612579..79d0e2b 100644 --- a/themes/dash/src/com/controllers/DashEntry.jsx +++ b/themes/dash/src/com/controllers/DashEntry.jsx @@ -105,6 +105,8 @@ class Entry { new EntryTasks().submitPost(edit, Entry.uploadFiles).then((response) => { let note = JSON.parse(response['response']['request'].response); this.editor.notify(note.message, note.postID); + if (note.message == DataEvent.POST_ADDED) + window.location = "/@/dashboard/entries/edit/" + note.postID; }).catch((err) => { console.log(err) }); @@ -123,8 +125,6 @@ class Entry { } else { // Do nothing! } - - break; case EditorEvent.EDITOR_UPLOAD_POST_IMAGE: @@ -226,9 +226,7 @@ class Entry { }).catch((err) => { console.log(err) }) - } - } Entry.uploadFiles = []; export { diff --git a/themes/dash/src/com/tools/utilities/TextEditor.jsx b/themes/dash/src/com/tools/utilities/TextEditor.jsx index e63582f..451d8e6 100644 --- a/themes/dash/src/com/tools/utilities/TextEditor.jsx +++ b/themes/dash/src/com/tools/utilities/TextEditor.jsx @@ -74,7 +74,7 @@ class TextEditor extends EventEmitter { break; case DataEvent.POST_ADDED: - window.location = "/@/dashboard/entries/edit/" + data; + // do nothing break; case EditorEvent.EDITOR_UPLOAD_POST_IMAGE: position(this.textEditor, this.caretPos); diff --git a/themes/dash/src/styles/main/_entries.styl b/themes/dash/src/styles/main/_entries.styl index 2c41388..76a0434 100644 --- a/themes/dash/src/styles/main/_entries.styl +++ b/themes/dash/src/styles/main/_entries.styl @@ -34,7 +34,7 @@ background $primary - 5% #entries-list - color $black + color $white a.entry-list-link display inline-block diff --git a/themes/dash/src/styles/main/_structure.styl b/themes/dash/src/styles/main/_structure.styl index a9e5155..41a6cb8 100644 --- a/themes/dash/src/styles/main/_structure.styl +++ b/themes/dash/src/styles/main/_structure.styl @@ -56,7 +56,7 @@ svg.icons label#the-title font-family 'Apercu-Mono' font-size 2em - color $primary + color $tertiary text-decoration none display block // word-break: break-all;