diff --git a/app.js b/app.js index 9c6c739..d7ae9f1 100644 --- a/app.js +++ b/app.js @@ -121,19 +121,19 @@ handlebars = handlebars.create({ }, perRowClass: (numProducts) => { if(parseInt(numProducts) === 1){ - return'col-md-12 col-xl-12 col m12 xl12 product-item'; + return'col-md-12 product-item'; } if(parseInt(numProducts) === 2){ - return'col-md-6 col-xl-6 col m6 xl6 product-item'; + return'col-md-6 product-item'; } if(parseInt(numProducts) === 3){ - return'col-md-4 col-xl-4 col m4 xl4 product-item'; + return'col-md-4 product-item'; } if(parseInt(numProducts) === 4){ - return'col-md-3 col-xl-3 col m3 xl3 product-item'; + return'col-md-3 product-item'; } - return'col-md-6 col-xl-6 col m6 xl6 product-item'; + return'col-md-6 product-item'; }, menuMatch: (title, search) => { if(!title || !search){ diff --git a/gulpfile.js b/gulpfile.js index 86f12fa..85972c7 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,6 +4,12 @@ const cleanCSS = require('gulp-clean-css'); const minify = require('gulp-minify'); const rename = require('gulp-rename'); +function less(){ + return gulp.src('public/stylesheets/less/**/*.less') + .pipe(less()) + .pipe(gulp.dest('./')); +}; + function compressJS(){ return src([ 'public/javascripts/*.js', @@ -58,4 +64,4 @@ function compressThemeJS(){ }; // run the tasks -gulp.task('default', series(compressJS, compressCss, compressThemeCss, compressThemeJS)); +gulp.task('default', series(less, compressJS, compressCss, compressThemeCss, compressThemeJS)); diff --git a/lib/common.js b/lib/common.js index e1eaf5c..655be4c 100755 --- a/lib/common.js +++ b/lib/common.js @@ -436,9 +436,10 @@ const orderMenu = (req, res) => { const db = req.app.db; return getMenu(db) .then((menu) => { + const menuOrder = req.body['order[]']; // update the order - for(let i = 0; i < req.body.navId.length; i++){ - _.find(menu.items, ['title', req.body.navId[i]]).order = i; + for(let i = 0; i < menuOrder.length; i++){ + _.find(menu.items, ['title', menuOrder[i]]).order = i; } return db.menu.updateOne({}, { $set: { items: menu.items } }, { upsert: true }) .then(() => { diff --git a/package-lock.json b/package-lock.json index 4e3cdaa..a6b30d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -504,6 +504,75 @@ } } }, + "accord": { + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/accord/-/accord-0.29.0.tgz", + "integrity": "sha512-3OOR92FTc2p5/EcOzPcXp+Cbo+3C15nV9RXHlOUBCBpHhcB+0frbSNR9ehED/o7sTcyGVtqGJpguToEdlXhD0w==", + "requires": { + "convert-source-map": "^1.5.0", + "glob": "^7.0.5", + "indx": "^0.2.3", + "lodash.clone": "^4.3.2", + "lodash.defaults": "^4.0.1", + "lodash.flatten": "^4.2.0", + "lodash.merge": "^4.4.0", + "lodash.partialright": "^4.1.4", + "lodash.pick": "^4.2.1", + "lodash.uniq": "^4.3.0", + "resolve": "^1.5.0", + "semver": "^5.3.0", + "uglify-js": "^2.8.22", + "when": "^3.7.8" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, "acorn": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", @@ -535,6 +604,16 @@ "uri-js": "^4.2.2" } }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -597,7 +676,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, "requires": { "ansi-wrap": "0.1.0" } @@ -624,7 +702,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", - "dev": true, "requires": { "ansi-wrap": "0.1.0" } @@ -664,8 +741,7 @@ "ansi-wrap": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true + "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=" }, "anymatch": { "version": "3.1.1", @@ -743,8 +819,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" }, "arr-map": { "version": "2.0.2", @@ -876,6 +951,21 @@ "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "optional": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "optional": true + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -926,8 +1016,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { "version": "2.1.2", @@ -1153,6 +1242,18 @@ } } }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "optional": true + }, + "aws4": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz", + "integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==", + "optional": true + }, "axios": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", @@ -1291,6 +1392,15 @@ } } }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, "bcryptjs": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", @@ -1656,6 +1766,21 @@ "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "optional": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", @@ -1943,8 +2068,7 @@ "clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true + "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=" }, "clone-buffer": { "version": "1.0.0", @@ -2073,7 +2197,6 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -2262,8 +2385,7 @@ "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", - "dev": true + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" }, "convert-to-spaces": { "version": "1.0.2", @@ -2379,6 +2501,15 @@ "es5-ext": "^0.10.9" } }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, "dasherize": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", @@ -2621,8 +2752,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "depd": { "version": "1.1.2", @@ -2780,6 +2910,16 @@ "object.defaults": "^1.1.0" } }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2832,6 +2972,15 @@ "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", "dev": true }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "optional": true, + "requires": { + "prr": "~1.0.1" + } + }, "error-ex": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", @@ -3654,8 +3803,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extend-shallow": { "version": "3.0.2", @@ -3760,6 +3908,12 @@ } } }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "optional": true + }, "fancy-log": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", @@ -4065,11 +4219,16 @@ "for-in": "^1.0.1" } }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "optional": true + }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -4174,6 +4333,15 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "optional": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, "glob": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.5.tgz", @@ -5044,6 +5212,20 @@ } } }, + "gulp-less": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/gulp-less/-/gulp-less-4.0.1.tgz", + "integrity": "sha512-hmM2k0FfQp7Ptm3ZaqO2CkMX3hqpiIOn4OHtuSsCeFym63F7oWlEua5v6u1cIjVUKYsVIs9zPg9vbqTEb/udpA==", + "requires": { + "accord": "^0.29.0", + "less": "2.6.x || ^3.7.1", + "object-assign": "^4.0.1", + "plugin-error": "^0.1.2", + "replace-ext": "^1.0.0", + "through2": "^2.0.0", + "vinyl-sourcemaps-apply": "^0.2.0" + } + }, "gulp-minify": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/gulp-minify/-/gulp-minify-3.1.0.tgz", @@ -5084,6 +5266,22 @@ "uglify-js": "^3.1.4" } }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "optional": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "optional": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5281,6 +5479,17 @@ "toidentifier": "1.0.0" } }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "optional": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, "https-proxy-agent": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", @@ -5350,6 +5559,12 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "optional": true + }, "import-fresh": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", @@ -5396,6 +5611,11 @@ "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, + "indx": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/indx/-/indx-0.2.3.tgz", + "integrity": "sha1-Fdz1bunPZcAjTFE8J/vVgOcPvFA=" + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -5545,8 +5765,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-builtin-module": { "version": "1.0.0", @@ -5777,8 +5996,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-unc-path": { "version": "1.0.0", @@ -5836,6 +6054,12 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "optional": true + }, "js-string-escape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", @@ -5857,6 +6081,12 @@ "esprima": "^4.0.0" } }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5875,6 +6105,12 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "optional": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -5886,6 +6122,12 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "optional": true + }, "json5": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", @@ -5903,6 +6145,18 @@ } } }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, "just-debounce": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", @@ -5927,7 +6181,6 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, "requires": { "is-buffer": "^1.1.5" } @@ -5951,6 +6204,11 @@ "package-json": "^6.3.0" } }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + }, "lazystream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", @@ -5978,6 +6236,33 @@ "flush-write-stream": "^1.0.2" } }, + "less": { + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/less/-/less-3.10.3.tgz", + "integrity": "sha512-vz32vqfgmoxF1h3K4J+yKCtajH0PWmjkIFgbs5d78E/c/e+UQTnI+lWK+1eQRE95PXM2mC3rJlLSSP9VQHnaow==", + "requires": { + "clone": "^2.1.2", + "errno": "^0.1.1", + "graceful-fs": "^4.1.2", + "image-size": "~0.5.0", + "mime": "^1.4.1", + "mkdirp": "^0.5.0", + "promise": "^7.1.1", + "request": "^2.83.0", + "source-map": "~0.6.0" + }, + "dependencies": { + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "optional": true, + "requires": { + "asap": "~2.0.3" + } + } + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -6058,6 +6343,11 @@ "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-4.2.1.tgz", "integrity": "sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU=" }, + "lodash.clone": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz", + "integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=" + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -6125,6 +6415,11 @@ "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==" }, + "lodash.partialright": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/lodash.partialright/-/lodash.partialright-4.2.1.tgz", + "integrity": "sha1-ATDYDoM2MmTUAHTzKbij56ihzEs=" + }, "lodash.pick": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", @@ -6150,6 +6445,11 @@ "resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz", "integrity": "sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=" }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + }, "lodash.unset": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.unset/-/lodash.unset-4.5.2.tgz", @@ -6164,6 +6464,11 @@ "chalk": "^2.0.1" } }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=" + }, "loud-rejection": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-2.2.0.tgz", @@ -6466,8 +6771,7 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { "version": "1.42.0", @@ -6490,7 +6794,6 @@ "version": "2.1.21", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", - "dev": true, "requires": { "mime-db": "~1.37.0" }, @@ -6498,8 +6801,7 @@ "mime-db": { "version": "1.37.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", - "dev": true + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" } } }, @@ -6832,6 +7134,12 @@ "resolved": "https://registry.npmjs.org/numeral/-/numeral-2.0.6.tgz", "integrity": "sha1-StCAk21EPCVhrtnyGX7//iX05QY=" }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "optional": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -7281,8 +7589,7 @@ "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" }, "path-root": { "version": "0.1.1", @@ -7329,6 +7636,12 @@ "semver": "^5.0.3" } }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "optional": true + }, "picomatch": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", @@ -7474,7 +7787,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, "requires": { "ansi-cyan": "^0.1.1", "ansi-red": "^0.1.1", @@ -7487,7 +7799,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, "requires": { "arr-flatten": "^1.0.1", "array-slice": "^0.2.3" @@ -7496,20 +7807,17 @@ "arr-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true + "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=" }, "array-slice": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=" }, "extend-shallow": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, "requires": { "kind-of": "^1.1.0" } @@ -7517,8 +7825,7 @@ "kind-of": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true + "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=" } } }, @@ -7645,12 +7952,24 @@ "ipaddr.js": "1.9.0" } }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "optional": true + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "psl": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz", + "integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==", + "optional": true + }, "pump": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", @@ -7680,8 +7999,7 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", - "dev": true + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "quick-lru": { "version": "1.1.0", @@ -8020,14 +8338,12 @@ "repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, "replace-ext": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" }, "replace-homedir": { "version": "1.0.0", @@ -8040,6 +8356,42 @@ "remove-trailing-separator": "^1.1.0" } }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "optional": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "optional": true + } + } + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -8070,7 +8422,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", - "dev": true, "requires": { "path-parse": "^1.0.5" } @@ -8153,6 +8504,14 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "requires": { + "align-text": "^0.1.1" + } + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", @@ -8669,6 +9028,23 @@ "number-is-nan": "^1.0.0" } }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "optional": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -9051,7 +9427,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, "requires": { "readable-stream": "^2.1.5", "xtend": "~4.0.1" @@ -9155,6 +9530,24 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "optional": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "optional": true + } + } + }, "trim-newlines": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", @@ -9179,6 +9572,21 @@ "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", "dev": true }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", @@ -9247,6 +9655,12 @@ "source-map": "~0.6.1" } }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true + }, "uglifycss": { "version": "0.0.27", "resolved": "https://registry.npmjs.org/uglifycss/-/uglifycss-0.0.27.tgz", @@ -9494,6 +9908,12 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, + "uuid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", + "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", + "optional": true + }, "v8-compile-cache": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", @@ -9530,6 +9950,17 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "optional": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, "vinyl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", @@ -9596,7 +10027,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, "requires": { "source-map": "^0.5.1" }, @@ -9604,8 +10034,7 @@ "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, @@ -9624,6 +10053,11 @@ "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", "dev": true }, + "when": { + "version": "3.7.8", + "resolved": "https://registry.npmjs.org/when/-/when-3.7.8.tgz", + "integrity": "sha1-xxMLan6gRpPoQs3J56Hyqjmjn4I=" + }, "which": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", @@ -9681,6 +10115,11 @@ } } }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", diff --git a/package.json b/package.json index 6850dec..b785ddb 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "express-rate-limit": "^5.0.0", "express-session": "^1.17.0", "glob": "^7.1.5", + "gulp-less": "^4.0.1", "helmet": "^3.21.2", "html-entities": "^1.2.0", "i18n": "^0.8.4", @@ -80,6 +81,7 @@ "gulp-clean-css": "^3.10.0", "gulp-minify": "^3.1.0", "gulp-rename": "^1.4.0", + "less": "^3.10.3", "mime-db": "^1.42.0", "supertest": "^3.4.2", "supertest-session": "^4.0.0" diff --git a/public/javascripts/admin.js b/public/javascripts/admin.js index 126a3a0..7d689ad 100644 --- a/public/javascripts/admin.js +++ b/public/javascripts/admin.js @@ -48,12 +48,12 @@ $(document).ready(function (){ var html = '
  • '; html += '
    '; - html += '
    ' + optName + '
    '; - html += '
    ' + optLabel + '
    '; - html += '
    ' + optType + '
    '; - html += '
    ' + optOptions + '
    '; - html += '
    '; - html += ''; + html += '
    ' + optName + '
    '; + html += '
    ' + optLabel + '
    '; + html += '
    ' + optType + '
    '; + html += '
    ' + optOptions + '
    '; + html += '
    '; + html += ''; html += '
  • '; // append data @@ -252,31 +252,35 @@ $(document).ready(function (){ }); $('.btn-delete-image').on('click', function(){ - $.ajax({ - method: 'POST', - url: '/admin/product/deleteimage', - data: { product_id: $('#productId').val(), productImage: $(this).attr('data-id') } - }) - .done(function(msg){ - showNotification(msg.message, 'success', true); - }) - .fail(function(msg){ - showNotification(msg.responseJSON.message, 'danger'); - }); + if(confirm('Are you sure you want to delete this image?')){ + $.ajax({ + method: 'POST', + url: '/admin/product/deleteimage', + data: { product_id: $('#productId').val(), productImage: $(this).attr('data-id') } + }) + .done(function(msg){ + showNotification(msg.message, 'success', true); + }) + .fail(function(msg){ + showNotification(msg.responseJSON.message, 'danger'); + }); + } }); $('.btn-delete-product').on('click', function(){ - $.ajax({ - method: 'POST', - url: '/admin/product/delete', - data: { productId: $(this).attr('data-id') } - }) - .done(function(msg){ - showNotification(msg.message, 'success', true); - }) - .fail(function(msg){ - showNotification(msg.responseJSON.message, 'danger'); - }); + if(confirm('Are you sure you want to delete this product?')){ + $.ajax({ + method: 'POST', + url: '/admin/product/delete', + data: { productId: $(this).attr('data-id') } + }) + .done(function(msg){ + showNotification(msg.message, 'success', true); + }) + .fail(function(msg){ + showNotification(msg.responseJSON.message, 'danger'); + }); + } }); // Call to API to check if a permalink is available @@ -544,6 +548,28 @@ $(document).ready(function (){ } }); + if($('#draggable_list').length){ + $('#draggable_list').sortable({ + update: function (){ + var menuOrder = []; + $('.navId').each(function(val){ + menuOrder.push($($('.navId')[val]).val()); + }); + $.ajax({ + data: { order: menuOrder }, + type: 'POST', + url: '/admin/settings/menu/save_order' + }) + .done(function(){ + showNotification('Menu order saved', 'success', true); + }) + .fail(function(msg){ + showNotification(msg.responseJSON.message, 'danger', true); + }); + } + }); + } + $(document).on('click', '#uploadButton', function(e){ e.preventDefault(); var formData = new FormData($('#uploadForm')[0]); diff --git a/public/javascripts/admin.min.js b/public/javascripts/admin.min.js index e3ea118..8259851 100644 --- a/public/javascripts/admin.min.js +++ b/public/javascripts/admin.min.js @@ -1 +1 @@ -$(document).ready(function(){if($(document).on("click","#btnGenerateAPIkey",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/createApiKey"}).done(function(e){$("#apiKey").val(e.apiKey),showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click",".product_opt_remove",function(e){e.preventDefault();var t=$(this).closest("li").find(".opt-name").html();$.ajax({method:"POST",url:"/admin/product/removeoption",data:{productId:$("#productId").val(),optName:t}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#product_opt_add",function(e){e.preventDefault();var t=$("#product_optName").val(),o=$("#product_optLabel").val(),a=$("#product_optType").val(),i=$("#product_optOptions").val(),n={};""!==$("#productOptions").val()&&'"{}"'!==$("#productOptions").val()&&(n=JSON.parse($("#productOptions").val()));var s='
  • ';s+='
    ',s+='
    '+t+"
    ",s+='
    '+o+"
    ",s+='
    '+a+"
    ",s+='
    '+i+"
    ",s+='
    ',s+='',s+="
  • ",$("#product_opt_wrapper").append(s),n[t]={optName:t,optLabel:o,optType:a,optOptions:$.grep(i.split(","),function(e){return 0===e||e})},$("#productOptions").val(JSON.stringify(n)),$("#product_optName").val(""),$("#product_optLabel").val(""),$("#product_optOptions").val("")}),$("#settingsForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$("#footerHtml_input").val($(".CodeMirror")[0].CodeMirror.getValue()),$("#googleAnalytics_input").val($(".CodeMirror")[1].CodeMirror.getValue()),$("#customCss_input").val($(".CodeMirror")[2].CodeMirror.getValue()),$.ajax({method:"POST",url:"/admin/settings/update",data:$("#settingsForm").serialize()}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(document).on("click","#orderStatusUpdate",function(e){$.ajax({method:"POST",url:"/admin/order/statusupdate",data:{order_id:$("#order_id").val(),status:$("#orderStatus").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#userNewForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$.ajax({method:"POST",url:"/admin/user/insert",data:{usersName:$("#usersName").val(),userEmail:$("#userEmail").val(),userPassword:$("#userPassword").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/user/edit/"+e.userId)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(".userDelete").on("click",function(){confirm("Are you sure you want to delete?")&&$.ajax({method:"POST",url:"/admin/user/delete",data:{userId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#userEditForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$.ajax({method:"POST",url:"/admin/user/update",data:{userId:$("#userId").val(),usersName:$("#usersName").val(),userEmail:$("#userEmail").val(),userPassword:$("#userPassword").val(),userAdmin:$("#userPassword").is(":checked")}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$("#productNewForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),""===$("#productPermalink").val()&&""!==$("#productTitle").val()&&$("#productPermalink").val(slugify($("#productTitle").val())),$.ajax({method:"POST",url:"/admin/product/insert",data:{productTitle:$("#productTitle").val(),productPrice:$("#productPrice").val(),productPublished:$("#productPublished").val(),productStock:$("#productStock").val(),productDescription:$("#productDescription").val(),productPermalink:$("#productPermalink").val(),productOptions:$("#productOptions").val(),productSubscription:$("#productSubscription").val(),productComment:$("#productComment").is(":checked"),productTags:$("#productTags").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/product/edit/"+e.productId)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$("#productEditForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),""===$("#productPermalink").val()&&""!==$("#productTitle").val()&&$("#productPermalink").val(slugify($("#productTitle").val())),$.ajax({method:"POST",url:"/admin/product/update",data:{productId:$("#productId").val(),productTitle:$("#productTitle").val(),productPrice:$("#productPrice").val(),productPublished:$("#productPublished").val(),productStock:$("#productStock").val(),productDescription:$("#productDescription").val(),productPermalink:$("#productPermalink").val(),productOptions:$("#productOptions").val(),productSubscription:$("#productSubscription").val(),productComment:$("#productComment").is(":checked"),productTags:$("#productTags").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(".set-as-main-image").on("click",function(){$.ajax({method:"POST",url:"/admin/product/setasmainimage",data:{product_id:$("#productId").val(),productImage:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(".btn-delete-image").on("click",function(){$.ajax({method:"POST",url:"/admin/product/deleteimage",data:{product_id:$("#productId").val(),productImage:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(".btn-delete-product").on("click",function(){$.ajax({method:"POST",url:"/admin/product/delete",data:{productId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#validate_permalink",function(e){""!==$("#productPermalink").val()?$.ajax({method:"POST",url:"/admin/api/validate_permalink",data:{permalink:$("#productPermalink").val(),docId:$("#productId").val()}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}):showNotification("Please enter a permalink to validate","danger")}),$(document).on("click","#btn_product_filter",function(e){""!==$("#product_filter").val()?window.location.href="/admin/products/filter/"+$("#product_filter").val():showNotification("Please enter a keyword to filter","danger")}),$(document).on("click","#btn_order_filter",function(e){""!==$("#order_filter").val()?window.location.href="/admin/orders/filter/"+$("#order_filter").val():showNotification("Please enter a keyword to filter","danger")}),$(document).on("click","#btn_customer_filter",function(e){""!==$("#customer_filter").val()?window.location.href="/admin/customers/filter/"+$("#customer_filter").val():showNotification("Please enter a keyword to filter","danger")}),$("#sendTestEmail").on("click",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/testEmail"}).done(function(e){showNotification(e,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click",".orderFilterByStatus",function(e){e.preventDefault(),window.location="/admin/orders/bystatus/"+$("#orderStatusFilter").val()}),$('input[class="published_state"]').change(function(){$.ajax({method:"POST",url:"/admin/product/published_state",data:{id:this.id,state:this.checked}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#updateCustomer").validator().on("click",function(e){e.preventDefault(),0===$("#customer-form").validator("validate").has(".has-error").length&&$.ajax({method:"POST",url:"/admin/customer/update",data:{customerId:$("#customerId").val(),email:$("#email").val(),firstName:$("#firstName").val(),lastName:$("#lastName").val(),address1:$("#address1").val(),address2:$("#address2").val(),country:$("#country").val(),state:$("#state").val(),postcode:$("#postcode").val(),phone:$("#phone").val()}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#deleteCustomer").on("click",function(e){e.preventDefault(),$.ajax({method:"DELETE",url:"/admin/customer",data:{customerId:$("#customerId").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/customers")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#footerHtml").length){var e=window.CodeMirror.fromTextArea(document.getElementById("footerHtml"),{mode:"xml",tabMode:"indent",theme:"flatly",lineNumbers:!0,htmlMode:!0,fixedGutter:!1});e.setValue(e.getValue())}if($("#googleAnalytics").length&&window.CodeMirror.fromTextArea(document.getElementById("googleAnalytics"),{mode:"xml",tabMode:"indent",theme:"flatly",lineNumbers:!0,htmlMode:!0,fixedGutter:!1}),$("#customCss").length){var t=window.CodeMirror.fromTextArea(document.getElementById("customCss"),{mode:"text/css",tabMode:"indent",theme:"flatly",lineNumbers:!0}),o=window.cssbeautify(t.getValue(),{indent:" ",autosemicolon:!0});t.setValue(o)}$(document).on("click","#btnPageUpdate",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/settings/page",data:{pageId:$("#pageId").val(),pageName:$("#pageName").val(),pageSlug:$("#pageSlug").val(),pageEnabled:$("#pageEnabled").is(":checked"),pageContent:$("#pageContent").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#btnPageDelete",function(e){e.preventDefault(),confirm("Are you sure?")&&$.ajax({method:"POST",url:"/admin/settings/page/delete",data:{pageId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#settings-menu-new",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/settings/menu/new",data:{navMenu:$("#newNavMenu").val(),navLink:$("#newNavLink").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#settings-menu-update",function(e){e.preventDefault();var t=$(this).attr("data-id"),o=$("#menuId-"+t);$.ajax({method:"POST",url:"/admin/settings/menu/update",data:{navId:o.find(".navId").val(),navMenu:o.find(".navMenu").val(),navLink:o.find(".navLink").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click",".settings-menu-delete",function(e){e.preventDefault(),confirm("Are you sure?")&&$.ajax({method:"POST",url:"/admin/settings/menu/delete",data:{menuId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#uploadButton",function(e){e.preventDefault();var t=new FormData($("#uploadForm")[0]);t.append("productId",$("#productId").val()),$.ajax({method:"POST",url:"/admin/file/upload",processData:!1,contentType:!1,cache:!1,data:t}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})})}); \ No newline at end of file +$(document).ready(function(){if($(document).on("click","#btnGenerateAPIkey",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/createApiKey"}).done(function(e){$("#apiKey").val(e.apiKey),showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click",".product_opt_remove",function(e){e.preventDefault();var t=$(this).closest("li").find(".opt-name").html();$.ajax({method:"POST",url:"/admin/product/removeoption",data:{productId:$("#productId").val(),optName:t}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#product_opt_add",function(e){e.preventDefault();var t=$("#product_optName").val(),o=$("#product_optLabel").val(),a=$("#product_optType").val(),i=$("#product_optOptions").val(),n={};""!==$("#productOptions").val()&&'"{}"'!==$("#productOptions").val()&&(n=JSON.parse($("#productOptions").val()));var s='
  • ';s+='
    ',s+='
    '+t+"
    ",s+='
    '+o+"
    ",s+='
    '+a+"
    ",s+='
    '+i+"
    ",s+='
    ',s+='',s+="
  • ",$("#product_opt_wrapper").append(s),n[t]={optName:t,optLabel:o,optType:a,optOptions:$.grep(i.split(","),function(e){return 0===e||e})},$("#productOptions").val(JSON.stringify(n)),$("#product_optName").val(""),$("#product_optLabel").val(""),$("#product_optOptions").val("")}),$("#settingsForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$("#footerHtml_input").val($(".CodeMirror")[0].CodeMirror.getValue()),$("#googleAnalytics_input").val($(".CodeMirror")[1].CodeMirror.getValue()),$("#customCss_input").val($(".CodeMirror")[2].CodeMirror.getValue()),$.ajax({method:"POST",url:"/admin/settings/update",data:$("#settingsForm").serialize()}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(document).on("click","#orderStatusUpdate",function(e){$.ajax({method:"POST",url:"/admin/order/statusupdate",data:{order_id:$("#order_id").val(),status:$("#orderStatus").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#userNewForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$.ajax({method:"POST",url:"/admin/user/insert",data:{usersName:$("#usersName").val(),userEmail:$("#userEmail").val(),userPassword:$("#userPassword").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/user/edit/"+e.userId)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(".userDelete").on("click",function(){confirm("Are you sure you want to delete?")&&$.ajax({method:"POST",url:"/admin/user/delete",data:{userId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#userEditForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),$.ajax({method:"POST",url:"/admin/user/update",data:{userId:$("#userId").val(),usersName:$("#usersName").val(),userEmail:$("#userEmail").val(),userPassword:$("#userPassword").val(),userAdmin:$("#userPassword").is(":checked")}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$("#productNewForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),""===$("#productPermalink").val()&&""!==$("#productTitle").val()&&$("#productPermalink").val(slugify($("#productTitle").val())),$.ajax({method:"POST",url:"/admin/product/insert",data:{productTitle:$("#productTitle").val(),productPrice:$("#productPrice").val(),productPublished:$("#productPublished").val(),productStock:$("#productStock").val(),productDescription:$("#productDescription").val(),productPermalink:$("#productPermalink").val(),productOptions:$("#productOptions").val(),productSubscription:$("#productSubscription").val(),productComment:$("#productComment").is(":checked"),productTags:$("#productTags").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/product/edit/"+e.productId)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$("#productEditForm").validator().on("submit",function(e){e.isDefaultPrevented()||(e.preventDefault(),""===$("#productPermalink").val()&&""!==$("#productTitle").val()&&$("#productPermalink").val(slugify($("#productTitle").val())),$.ajax({method:"POST",url:"/admin/product/update",data:{productId:$("#productId").val(),productTitle:$("#productTitle").val(),productPrice:$("#productPrice").val(),productPublished:$("#productPublished").val(),productStock:$("#productStock").val(),productDescription:$("#productDescription").val(),productPermalink:$("#productPermalink").val(),productOptions:$("#productOptions").val(),productSubscription:$("#productSubscription").val(),productComment:$("#productComment").is(":checked"),productTags:$("#productTags").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")}))}),$(".set-as-main-image").on("click",function(){$.ajax({method:"POST",url:"/admin/product/setasmainimage",data:{product_id:$("#productId").val(),productImage:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(".btn-delete-image").on("click",function(){$.ajax({method:"POST",url:"/admin/product/deleteimage",data:{product_id:$("#productId").val(),productImage:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(".btn-delete-product").on("click",function(){$.ajax({method:"POST",url:"/admin/product/delete",data:{productId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#validate_permalink",function(e){""!==$("#productPermalink").val()?$.ajax({method:"POST",url:"/admin/api/validate_permalink",data:{permalink:$("#productPermalink").val(),docId:$("#productId").val()}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")}):showNotification("Please enter a permalink to validate","danger")}),$(document).on("click","#btn_product_filter",function(e){""!==$("#product_filter").val()?window.location.href="/admin/products/filter/"+$("#product_filter").val():showNotification("Please enter a keyword to filter","danger")}),$(document).on("click","#btn_order_filter",function(e){""!==$("#order_filter").val()?window.location.href="/admin/orders/filter/"+$("#order_filter").val():showNotification("Please enter a keyword to filter","danger")}),$(document).on("click","#btn_customer_filter",function(e){""!==$("#customer_filter").val()?window.location.href="/admin/customers/filter/"+$("#customer_filter").val():showNotification("Please enter a keyword to filter","danger")}),$("#sendTestEmail").on("click",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/testEmail"}).done(function(e){showNotification(e,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click",".orderFilterByStatus",function(e){e.preventDefault(),window.location="/admin/orders/bystatus/"+$("#orderStatusFilter").val()}),$('input[class="published_state"]').change(function(){$.ajax({method:"POST",url:"/admin/product/published_state",data:{id:this.id,state:this.checked}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#updateCustomer").validator().on("click",function(e){e.preventDefault(),0===$("#customer-form").validator("validate").has(".has-error").length&&$.ajax({method:"POST",url:"/admin/customer/update",data:{customerId:$("#customerId").val(),email:$("#email").val(),firstName:$("#firstName").val(),lastName:$("#lastName").val(),address1:$("#address1").val(),address2:$("#address2").val(),country:$("#country").val(),state:$("#state").val(),postcode:$("#postcode").val(),phone:$("#phone").val()}}).done(function(e){showNotification(e.message,"success")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#deleteCustomer").on("click",function(e){e.preventDefault(),$.ajax({method:"DELETE",url:"/admin/customer",data:{customerId:$("#customerId").val()}}).done(function(e){showNotification(e.message,"success",!1,"/admin/customers")}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$("#footerHtml").length){var e=window.CodeMirror.fromTextArea(document.getElementById("footerHtml"),{mode:"xml",tabMode:"indent",theme:"flatly",lineNumbers:!0,htmlMode:!0,fixedGutter:!1});e.setValue(e.getValue())}if($("#googleAnalytics").length&&window.CodeMirror.fromTextArea(document.getElementById("googleAnalytics"),{mode:"xml",tabMode:"indent",theme:"flatly",lineNumbers:!0,htmlMode:!0,fixedGutter:!1}),$("#customCss").length){var t=window.CodeMirror.fromTextArea(document.getElementById("customCss"),{mode:"text/css",tabMode:"indent",theme:"flatly",lineNumbers:!0}),o=window.cssbeautify(t.getValue(),{indent:" ",autosemicolon:!0});t.setValue(o)}$(document).on("click","#btnPageUpdate",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/settings/page",data:{pageId:$("#pageId").val(),pageName:$("#pageName").val(),pageSlug:$("#pageSlug").val(),pageEnabled:$("#pageEnabled").is(":checked"),pageContent:$("#pageContent").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})}),$(document).on("click","#btnPageDelete",function(e){e.preventDefault(),confirm("Are you sure?")&&$.ajax({method:"POST",url:"/admin/settings/page/delete",data:{pageId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#settings-menu-new",function(e){e.preventDefault(),$.ajax({method:"POST",url:"/admin/settings/menu/new",data:{navMenu:$("#newNavMenu").val(),navLink:$("#newNavLink").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#settings-menu-update",function(e){e.preventDefault();var t=$(this).attr("data-id"),o=$("#menuId-"+t);$.ajax({method:"POST",url:"/admin/settings/menu/update",data:{navId:o.find(".navId").val(),navMenu:o.find(".navMenu").val(),navLink:o.find(".navLink").val()}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click",".settings-menu-delete",function(e){e.preventDefault(),confirm("Are you sure?")&&$.ajax({method:"POST",url:"/admin/settings/menu/delete",data:{menuId:$(this).attr("data-id")}}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.message,"danger",!0)})}),$(document).on("click","#uploadButton",function(e){e.preventDefault();var t=new FormData($("#uploadForm")[0]);t.append("productId",$("#productId").val()),$.ajax({method:"POST",url:"/admin/file/upload",processData:!1,contentType:!1,cache:!1,data:t}).done(function(e){showNotification(e.message,"success",!0)}).fail(function(e){showNotification(e.responseJSON.message,"danger")})})}); \ No newline at end of file diff --git a/public/javascripts/expressCart.js b/public/javascripts/expressCart.js index 4b21f0a..c1b3e97 100644 --- a/public/javascripts/expressCart.js +++ b/public/javascripts/expressCart.js @@ -40,23 +40,23 @@ $(document).ready(function (){ } }); - $('.shipping-form input').each(function(e){ - $(this).wrap('
    '); - var tag = $(this).attr('placeholder'); - $(this).after(''); - }); + // $('.shipping-form input').each(function(e){ + // $(this).wrap('
    '); + // var tag = $(this).attr('placeholder'); + // $(this).after(''); + // }); - $('.shipping-form input').on('focus', function(){ - $(this).next().addClass('floatLabel'); - $(this).next().removeClass('hidden'); - }); + // $('.shipping-form input').on('focus', function(){ + // $(this).next().addClass('floatLabel'); + // $(this).next().removeClass('hidden'); + // }); - $('.shipping-form input').on('blur', function(){ - if($(this).val() === ''){ - $(this).next().addClass('hidden'); - $(this).next().removeClass('floatLabel'); - } - }); + // $('.shipping-form input').on('blur', function(){ + // if($(this).val() === ''){ + // $(this).next().addClass('hidden'); + // $(this).next().removeClass('floatLabel'); + // } + // }); $(document).on('click', '.menu-btn', function(e){ e.preventDefault(); @@ -76,27 +76,25 @@ $(document).ready(function (){ $(this).toggleClass('hover'); }); - if($('.product-title').length){ - $('.product-title').dotdotdot({ - ellipsis: '...' - }); - } - $(document).on('click', '.btn-qty-minus', function(e){ + e.preventDefault(); var qtyElement = $(e.target).parent().parent().find('.cart-product-quantity'); + // console.log('qtyElement', qtyElement); $(qtyElement).val(parseInt(qtyElement.val()) - 1); cartUpdate(qtyElement); }); $(document).on('click', '.btn-qty-add', function(e){ + e.preventDefault(); var qtyElement = $(e.target).parent().parent().find('.cart-product-quantity'); $(qtyElement).val(parseInt(qtyElement.val()) + 1); cartUpdate(qtyElement); }); - $(document).on('change', '.cart-product-quantity', function (e){ - cartUpdate(e.target); - }); + // $(document).on('change', '.cart-product-quantity', function (e){ + // console.log('test'); + // cartUpdate(e.target); + // }); $(document).on('click', '.btn-delete-from-cart', function(e){ deleteFromCart($(e.target)); @@ -123,9 +121,14 @@ $(document).ready(function (){ maxVisible: 5, href: pagerHref, wrapClass: 'pagination', - prevClass: 'waves-effect', - nextClass: 'waves-effect', - activeClass: 'pag-active waves-effect' + prevClass: 'page-item previous', + nextClass: 'page-item next', + activeClass: 'page-item active' + }); + + // Fix for Bootstrap 4 + $('#pager a').each(function(){ + $(this).addClass('page-link'); }); } } @@ -409,7 +412,7 @@ $(document).ready(function (){ $('#input_notify_messageType').val(''); // alert - showNotification(messageVal, messageTypeVal, false); + showNotification(messageVal, messageTypeVal || 'danger', false); } }); @@ -443,6 +446,7 @@ function deleteFromCart(element){ } function cartUpdate(element){ + console.log('element', element.val()); if($(element).val() > 0){ if($(element).val() !== ''){ updateCart(); @@ -462,6 +466,8 @@ function updateCart(){ }); }); + console.log('cartItems', cartItems) + // update cart on server $.ajax({ method: 'POST', diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 00b14c6..bbfd48d 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -1,3 +1,9 @@ +.btn-outline-danger, .btn-warning, .btn-outline-primary { + color: #ffffff !important; + background-color: #000000; + border-color: #000000; +} + .search-bar-input, #frm_search, .search-bar-input .btn{ padding-top: 10px; height: 45px; @@ -38,7 +44,7 @@ padding-left: 0; } -.product_wrapper>a:hover{ +.product-wrapper>a:hover{ color: #cc4135 !important; } @@ -55,12 +61,15 @@ background-color: #cc4135 !important; } +/* Fixes summernote editor issue: https://github.com/summernote/summernote/issues/2516 */ +body .popover{display:none !important; } + .navbar-brand{ color: #cc4135 !important; letter-spacing: 4px; padding-left: 20px !important; - padding-top: 20px !important; - height: 100px !important; + padding-top: 0 !important; + height: 80px !important; font-size: 55px !important; } diff --git a/public/stylesheets/bootstrap-xl.css b/public/stylesheets/bootstrap-xl.css deleted file mode 100644 index 74bb6a9..0000000 --- a/public/stylesheets/bootstrap-xl.css +++ /dev/null @@ -1,270 +0,0 @@ -/* -* CSS file with Bootstrap grid classes for screens bigger than 1600px. Just add this file after the Bootstrap CSS file and you will be able to juse col-xl, col-xl-push, hidden-xl, etc. -* -* Author: Marc van Nieuwenhuijzen -* Company: WebVakman -* Site: WebVakman.nl -* -*/ - -@media (min-width: 1200px) and (max-width: 1599px) { - .hidden-lg { - display: none !important; - } -} - - -.visible-xl-block, -.visible-xl-inline, -.visible-xl-inline-block, -.visible-xl{ - display: none !important; -} - - - -@media (min-width: 1600px) { - .container { - width: 1570px; - } - - .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 { - float: left; - } - - .col-xl-12 { - width: 100%; - } - - .col-xl-11 { - width: 91.66666667%; - } - - .col-xl-10 { - width: 83.33333333%; - } - - .col-xl-9 { - width: 75%; - } - - .col-xl-8 { - width: 66.66666667%; - } - - .col-xl-7 { - width: 58.33333333%; - } - - .col-xl-6 { - width: 50%; - } - - .col-xl-5 { - width: 41.66666667%; - } - - .col-xl-4 { - width: 33.33333333%; - } - - .col-xl-3 { - width: 25%; - } - - .col-xl-2 { - width: 16.66666667%; - } - - .col-xl-1 { - width: 8.33333333%; - } - - .col-xl-pull-12 { - right: 100%; - } - - .col-xl-pull-11 { - right: 91.66666667%; - } - - .col-xl-pull-10 { - right: 83.33333333%; - } - - .col-xl-pull-9 { - right: 75%; - } - - .col-xl-pull-8 { - right: 66.66666667%; - } - - .col-xl-pull-7 { - right: 58.33333333%; - } - - .col-xl-pull-6 { - right: 50%; - } - - .col-xl-pull-5 { - right: 41.66666667%; - } - - .col-xl-pull-4 { - right: 33.33333333%; - } - - .col-xl-pull-3 { - right: 25%; - } - - .col-xl-pull-2 { - right: 16.66666667%; - } - - .col-xl-pull-1 { - right: 8.33333333%; - } - - .col-xl-pull-0 { - right: auto; - } - - .col-xl-push-12 { - left: 100%; - } - - .col-xl-push-11 { - left: 91.66666667%; - } - - .col-xl-push-10 { - left: 83.33333333%; - } - - .col-xl-push-9 { - left: 75%; - } - - .col-xl-push-8 { - left: 66.66666667%; - } - - .col-xl-push-7 { - left: 58.33333333%; - } - - .col-xl-push-6 { - left: 50%; - } - - .col-xl-push-5 { - left: 41.66666667%; - } - - .col-xl-push-4 { - left: 33.33333333%; - } - - .col-xl-push-3 { - left: 25%; - } - - .col-xl-push-2 { - left: 16.66666667%; - } - - .col-xl-push-1 { - left: 8.33333333%; - } - - .col-xl-push-0 { - left: auto; - } - - .col-xl-offset-12 { - margin-left: 100%; - } - - .col-xl-offset-11 { - margin-left: 91.66666667%; - } - - .col-xl-offset-10 { - margin-left: 83.33333333%; - } - - .col-xl-offset-9 { - margin-left: 75%; - } - - .col-xl-offset-8 { - margin-left: 66.66666667%; - } - - .col-xl-offset-7 { - margin-left: 58.33333333%; - } - - .col-xl-offset-6 { - margin-left: 50%; - } - - .col-xl-offset-5 { - margin-left: 41.66666667%; - } - - .col-xl-offset-4 { - margin-left: 33.33333333%; - } - - .col-xl-offset-3 { - margin-left: 25%; - } - - .col-xl-offset-2 { - margin-left: 16.66666667%; - } - - .col-xl-offset-1 { - margin-left: 8.33333333%; - } - - .col-xl-offset-0 { - margin-left: 0; - } - - .visible-xl { - display: block !important; - } - - table.visible-xl { - display: table; - } - - tr.visible-xl { - display: table-row !important; - } - - th.visible-xl, td.visible-xl { - display: table-cell !important; - } - - .visible-xl-block { - display: block !important; - } - - .visible-xl-inline { - display: inline !important; - } - - .visible-xl-inline-block { - display: inline-block !important; - } - - .hidden-xl { - display: none !important; - } -} \ No newline at end of file diff --git a/public/stylesheets/bootstrap-xl.min.css b/public/stylesheets/bootstrap-xl.min.css deleted file mode 100644 index a0b43e1..0000000 --- a/public/stylesheets/bootstrap-xl.min.css +++ /dev/null @@ -1 +0,0 @@ -@media (min-width:1200px) and (max-width:1599px){.hidden-lg{display:none!important}}.visible-xl,.visible-xl-block,.visible-xl-inline,.visible-xl-inline-block{display:none!important}@media (min-width:1600px){.container{width:1570px}.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9{float:left}.col-xl-12{width:100%}.col-xl-11{width:91.66666667%}.col-xl-10{width:83.33333333%}.col-xl-9{width:75%}.col-xl-8{width:66.66666667%}.col-xl-7{width:58.33333333%}.col-xl-6{width:50%}.col-xl-5{width:41.66666667%}.col-xl-4{width:33.33333333%}.col-xl-3{width:25%}.col-xl-2{width:16.66666667%}.col-xl-1{width:8.33333333%}.col-xl-pull-12{right:100%}.col-xl-pull-11{right:91.66666667%}.col-xl-pull-10{right:83.33333333%}.col-xl-pull-9{right:75%}.col-xl-pull-8{right:66.66666667%}.col-xl-pull-7{right:58.33333333%}.col-xl-pull-6{right:50%}.col-xl-pull-5{right:41.66666667%}.col-xl-pull-4{right:33.33333333%}.col-xl-pull-3{right:25%}.col-xl-pull-2{right:16.66666667%}.col-xl-pull-1{right:8.33333333%}.col-xl-pull-0{right:auto}.col-xl-push-12{left:100%}.col-xl-push-11{left:91.66666667%}.col-xl-push-10{left:83.33333333%}.col-xl-push-9{left:75%}.col-xl-push-8{left:66.66666667%}.col-xl-push-7{left:58.33333333%}.col-xl-push-6{left:50%}.col-xl-push-5{left:41.66666667%}.col-xl-push-4{left:33.33333333%}.col-xl-push-3{left:25%}.col-xl-push-2{left:16.66666667%}.col-xl-push-1{left:8.33333333%}.col-xl-push-0{left:auto}.col-xl-offset-12{margin-left:100%}.col-xl-offset-11{margin-left:91.66666667%}.col-xl-offset-10{margin-left:83.33333333%}.col-xl-offset-9{margin-left:75%}.col-xl-offset-8{margin-left:66.66666667%}.col-xl-offset-7{margin-left:58.33333333%}.col-xl-offset-6{margin-left:50%}.col-xl-offset-5{margin-left:41.66666667%}.col-xl-offset-4{margin-left:33.33333333%}.col-xl-offset-3{margin-left:25%}.col-xl-offset-2{margin-left:16.66666667%}.col-xl-offset-1{margin-left:8.33333333%}.col-xl-offset-0{margin-left:0}.visible-xl{display:block!important}table.visible-xl{display:table}tr.visible-xl{display:table-row!important}td.visible-xl,th.visible-xl{display:table-cell!important}.visible-xl-block{display:block!important}.visible-xl-inline{display:inline!important}.visible-xl-inline-block{display:inline-block!important}.hidden-xl{display:none!important}} \ No newline at end of file diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index e7dda13..48b7911 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -91,7 +91,7 @@ a.text-danger:hover, a.text-danger:focus { width: auto; } -.thumbnail-image-container .img-responsive { +.thumbnail-image-container .img-fluid { display: block; width: auto; max-height: 100%; @@ -118,7 +118,7 @@ input[type=number]::-webkit-outer-spin-button { align-items: center; } -.title-image-container .img-responsive { +.title-image-container .img-fluid { display: block; width: auto; max-height: 100%; @@ -193,6 +193,18 @@ input[type=number]::-webkit-outer-spin-button { padding-right: 0px; } +.top-marg-10{ + margin-top: 10px; +} + +.top-marg-15{ + margin-top: 15px; +} + +.top-marg-20{ + margin-top: 20px; +} + .top-pad-10{ padding-top: 10px; } @@ -201,10 +213,38 @@ input[type=number]::-webkit-outer-spin-button { padding-top: 20px; } +.top-pad-50{ + padding-top: 50px; +} + +.top-pad-100{ + padding-top: 100px; +} + +.bottom-pad-10{ + padding-bottom: 10px; +} + +.bottom-pad-15{ + padding-bottom: 15px; +} + .bottom-pad-20{ padding-bottom: 20px; } +.bottom-marg-10{ + margin-bottom: 10px; +} + +.bottom-marg-15{ + margin-bottom: 15px; +} + +.bottom-marg-20{ + margin-bottom: 20px; +} + .left-pad-30{ padding-left: 30px; } @@ -230,6 +270,11 @@ input[type=number]::-webkit-outer-spin-button { padding-right: 5px; } +.breadcrumb{ + background-color: #f8f9fa; + margin-top: 10px; +} + .breadcrumbProPerRow-3{ margin-left: 10px; margin-right: 10px; @@ -261,11 +306,6 @@ input[type=number]::-webkit-outer-spin-button { font-size: 19px; } -.customer-details{ - padding-left: 0px; - padding-right: 0px; -} - .file-form{ padding-left: 15px; padding-right: 15px; @@ -293,7 +333,6 @@ input[type=number]::-webkit-outer-spin-button { width: 100%; text-align: center; font-size: 22px; - color: white; } .input-group .form-control { @@ -404,18 +443,13 @@ input.form-control.customerDetails{ color: #000000; } -.alert-success{ - background-color: #000000; - opacity: 0.65; -} - -.btn-danger, .btn-warning, .btn-primary { +.btn-outline-danger, .btn-warning, .btn-outline-primary { color: #ffffff; background-color: #000000; border-color: #000000; } -.btn-warning:hover, .btn-danger:hover { +.btn-warning:hover, .btn-outline-danger:hover { color: #ffffff; background-color: #000000; border-color: #000000; @@ -459,22 +493,13 @@ a { border-color: #000000; } -.pagination>.disabled>span, .pagination>.disabled>span:hover, .pagination>.disabled>span:focus, .pagination>.disabled>a, .pagination>.disabled>a:hover, .pagination>.disabled>a:focus { - background-color: #000000; +.page-item.disabled .page-link{ + color:#b7b7b7; } -.pagination>li>a, .pagination>li>span { - background-color: #000000; -} - -.pagination>.active>a, .pagination>.active>span, .pagination>.active>a:hover, .pagination>.active>span:hover, .pagination>.active>a:focus, .pagination>.active>span:focus { - background-color: #000000; - opacity: 0.65; -} - -.pagination>li>a:hover, .pagination>li>span:hover, .pagination>li>a:focus, .pagination>li>span:focus { - background-color: #000000; - opacity: 0.65; +.page-link { + color: white; + border: 0; } .navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus { @@ -494,24 +519,6 @@ a { border-top-left-radius: 0px; } -.form-control { - border-radius: 0px; -} - -.btn { - border-radius: 0px; -} - -.pagination>li:first-child>a, .pagination>li:first-child>span{ - border-bottom-left-radius: 0px; - border-top-left-radius: 0px; -} - -.pagination>li:last-child>a, .pagination>li:last-child>span { - border-bottom-right-radius: 0px; - border-top-right-radius: 0px; -} - @media only screen and (min-width: 768px){ .pushy { width: 700px; @@ -561,7 +568,8 @@ a { } .product-title{ - padding-top: 25px; + font-size: 18px; + padding-top: 18px; min-height: auto; } diff --git a/public/stylesheets/style.min.css b/public/stylesheets/style.min.css index 4b53975..4571577 100644 --- a/public/stylesheets/style.min.css +++ b/public/stylesheets/style.min.css @@ -1 +1 @@ -html{position:relative;min-height:100%}body{margin-bottom:140px}body,html{font-size:16px}.content-body{margin-bottom:40px}.menu-top{margin-top:15px;margin-left:15px;margin-right:15px}.menu-side,.product-layout{padding-top:35px}.menu-side-mobile{background-color:transparent!important;color:inherit!important;text-align:center;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.dragable_item{cursor:move}.page-header{padding-bottom:5px}.cart-contents-title{font-size:18px;font-weight:700}.cart-row{padding-bottom:10px;display:flex;align-items:center}.cart-item-row{margin-top:5px}.cart-link{padding-left:7px}.cart-delete-button{color:#d9534f;cursor:pointer;padding-left:5px}a.text-danger:focus,a.text-danger:hover{color:#cc3a2c}.cart-update-button{cursor:pointer}.thumbnail-image{cursor:pointer}#product-images{margin-bottom:30px}.product-layout{padding-top:30px}.product-title-image{margin:auto;max-height:400px;width:auto}.thumbnail-image-container .img-responsive{display:block;width:auto;max-height:100%;margin:auto}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.navbar-brand>img{width:auto;height:100%}.thumbnail{min-height:415px}.vertical-center{display:flex;align-items:center}.title-image-container .img-responsive{display:block;width:auto;max-height:100%;margin:auto}.title-image-container{height:400px}.thumbnail-image-container{height:350px}.product-title{font-size:24px;margin-top:0}.product-title-home{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;justify-content:center;text-align:center}.product-price{padding-bottom:10px;font-size:20px;color:#aaa}.productOptions{padding-bottom:15px}.product-option{font-size:18px}.body_text,.btnAddToCart{padding-top:15px;padding-bottom:15px}.product-option-text{font-size:16px;color:#aaa;padding-bottom:10px;padding-top:10px}.seporator{padding-top:5px;border-bottom:1px solid #eee;padding-bottom:6px}.list-group-input-pad select{margin-top:-7px}.no-pad-left{padding-left:0}.no-pad-right{padding-right:0}.top-pad-10{padding-top:10px}.top-pad-20{padding-top:20px}.bottom-pad-20{padding-bottom:20px}.left-pad-30{padding-left:30px}.shipping-form input{margin-bottom:15px}#header{height:50px}.search-bar{margin-top:10px}.searchMenuLocation-side{padding-left:25px;padding-right:25px}.searchMenuLocation-top{padding-left:5px;padding-right:5px}.breadcrumbProPerRow-3{margin-left:10px;margin-right:10px}.searchProPerRow-3,.searchProPerRow-4{padding-left:0;padding-right:0}.dropup-button{height:34px;padding:0;color:#fff!important}.dropdown-menu>li>a{padding-top:5px!important}.pad-bottom{padding-bottom:25px}.keywords{padding-bottom:30px;padding-top:20px;font-size:19px}.customer-details{padding-left:0;padding-right:0}.file-form{padding-left:15px;padding-right:15px}.editor_btn_action{border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.dropup-list{padding-bottom:5px;margin-right:10px;margin-left:10px;margin-top:10px}#notify_message{position:fixed;display:none;z-index:9999;padding-top:10px;height:50px;bottom:0;width:100%;text-align:center;font-size:22px;color:#fff}.input-group .form-control{z-index:1}.btn-file{position:relative;overflow:hidden}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:0;background:#fff;cursor:inherit;display:block}.offcanvas-element{z-index:100;background-color:#fff}.product-item{padding-left:0;padding-right:0}input:focus{outline:0;background:#fbfbe9}input+label{display:block;cursor:text;transition:.15s ease-out all;position:absolute;top:.9em;left:1.3em}.floatLabel{top:.1em;left:32px;font-size:.7em;color:#999;font-weight:400;transition:.15s ease-out all}input.form-control.customerDetails{padding-bottom:5px}.footer{position:absolute;bottom:0;width:100%;height:100px;padding-top:25px;background-color:#f5f5f5}.admin{margin-bottom:0}.image-next{position:absolute;top:180px;right:0}.image-prev{position:absolute;top:180px;left:0}.image-button{cursor:pointer;opacity:.7}.image-button-show{cursor:pointer;opacity:.7!important}.navbar-default{background-color:#fff}.navbar-default .navbar-nav>li>a{color:#000}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#000}.alert-success{background-color:#000;opacity:.65}.btn-danger,.btn-primary,.btn-warning{color:#fff;background-color:#000;border-color:#000}.btn-danger:hover,.btn-warning:hover{color:#fff;background-color:#000;border-color:#000;opacity:.65}a:focus,a:hover{color:#000}a{color:#000}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{background-color:#000;border-color:#000}.navbar-default .navbar-brand{color:#000;font-size:40px;font-weight:700}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#000}.navbar-brand-image{padding:0;height:70px}.navbar-default .badge{background-color:#000;color:#fff}.navbar-default .navbar-toggle{background-color:#000;border-color:#000}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{background-color:#000}.pagination>li>a,.pagination>li>span{background-color:#000}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{background-color:#000;opacity:.65}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{background-color:#000;opacity:.65}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#000}.thumbnail{border:none}.help-block{color:#95a5a6}.list-group-item:first-child,.list-group-item:last-child{border-top-right-radius:0;border-top-left-radius:0}.form-control{border-radius:0}.btn{border-radius:0}.pagination>li:first-child>a,.pagination>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}@media only screen and (min-width:768px){.pushy{width:700px}.pushy-right{-webkit-transform:translate3d(700px,0,0);-ms-transform:translate3d(700px,0,0);transform:translate3d(700px,0,0)}.pushy-open-right #container,.pushy-open-right .push{-webkit-transform:translate3d(-700px,0,0);-ms-transform:translate3d(-700px,0,0);transform:translate3d(-700px,0,0)}}@media only screen and (max-width:768px){.pushy{width:calc(100%)}.pushy-right{-webkit-transform:translate3d(calc(100%),0,0);-ms-transform:translate3d(calc(100%),0,0);transform:translate3d(calc(100%),0,0)}.pushy-open-right #container,.pushy-open-right .push{-webkit-transform:translate3d(-calc(100%),0,0);-ms-transform:translate3d(-calc(100%),0,0);transform:translate3d(-calc(100%),0,0)}.product-item{padding-left:0;padding-right:0}.showFooter{margin-bottom:220px}.title-image-container{height:auto}.product-title{padding-top:25px;min-height:auto}.search-bar-input{padding-left:0;padding-right:0}.menu-side{padding-top:15px}.product-layout{padding-top:0;padding-bottom:30px}#btn_search{border-top-right-radius:4px;border-bottom-right-radius:4px}.cart-row{padding-top:10px;border-bottom:1px solid #ecf0f1;display:block}.cart-body{padding-top:0}.cart-contents-shipping{padding-top:10px}#cart{padding-bottom:15px}.footer{height:100px}body{margin-bottom:100px}} \ No newline at end of file +html{position:relative;min-height:100%}body{margin-bottom:140px}body,html{font-size:16px}.content-body{margin-bottom:40px}.menu-top{margin-top:15px;margin-left:15px;margin-right:15px}.menu-side,.product-layout{padding-top:35px}.menu-side-mobile{background-color:transparent!important;color:inherit!important;text-align:center;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.dragable_item{cursor:move}.page-header{padding-bottom:5px}.cart-contents-title{font-size:18px;font-weight:700}.cart-row{padding-bottom:10px;display:flex;align-items:center}.cart-item-row{margin-top:5px}.cart-link{padding-left:7px}.cart-delete-button{color:#d9534f;cursor:pointer;padding-left:5px}a.text-danger:focus,a.text-danger:hover{color:#cc3a2c}.cart-update-button{cursor:pointer}.thumbnail-image{cursor:pointer}#product-images{margin-bottom:30px}.product-layout{padding-top:30px}.product-title-image{margin:auto;max-height:400px;width:auto}.thumbnail-image-container .img-responsive{display:block;width:auto;max-height:100%;margin:auto}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.navbar-brand>img{width:auto;height:100%}.thumbnail{min-height:415px}.vertical-center{display:flex;align-items:center}.title-image-container .img-responsive{display:block;width:auto;max-height:100%;margin:auto}.title-image-container{height:400px}.thumbnail-image-container{height:350px}.product-title{font-size:24px;margin-top:0}.product-title-home{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;align-items:center;justify-content:center;text-align:center}.product-price{padding-bottom:10px;font-size:20px;color:#aaa}.productOptions{padding-bottom:15px}.product-option{font-size:18px}.body_text,.btnAddToCart{padding-top:15px;padding-bottom:15px}.product-option-text{font-size:16px;color:#aaa;padding-bottom:10px;padding-top:10px}.seporator{padding-top:5px;border-bottom:1px solid #eee;padding-bottom:6px}.list-group-input-pad select{margin-top:-7px}.no-pad-left{padding-left:0}.no-pad-right{padding-right:0}.top-pad-10{padding-top:10px}.top-pad-20{padding-top:20px}.bottom-pad-20{padding-bottom:20px}.left-pad-30{padding-left:30px}.shipping-form input{margin-bottom:15px}#header{height:50px}.search-bar{margin-top:10px}.searchMenuLocation-side{padding-left:25px;padding-right:25px}.searchMenuLocation-top{padding-left:5px;padding-right:5px}.breadcrumbProPerRow-3{margin-left:10px;margin-right:10px}.searchProPerRow-3,.searchProPerRow-4{padding-left:0;padding-right:0}.dropup-button{height:34px;padding:0;color:#fff!important}.dropdown-menu>li>a{padding-top:5px!important}.pad-bottom{padding-bottom:25px}.keywords{padding-bottom:30px;padding-top:20px;font-size:19px}.customer-details{padding-left:0;padding-right:0}.file-form{padding-left:15px;padding-right:15px}.editor_btn_action{border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.dropup-list{padding-bottom:5px;margin-right:10px;margin-left:10px;margin-top:10px}#notify_message{position:fixed;display:none;z-index:9999;padding-top:10px;height:50px;bottom:0;width:100%;text-align:center;font-size:22px;color:#fff}.input-group .form-control{z-index:1}.btn-file{position:relative;overflow:hidden}.btn-file input[type=file]{position:absolute;top:0;right:0;min-width:100%;min-height:100%;font-size:100px;text-align:right;filter:alpha(opacity=0);opacity:0;outline:0;background:#fff;cursor:inherit;display:block}.offcanvas-element{z-index:100;background-color:#fff}.product-item{padding-left:0;padding-right:0}input:focus{outline:0;background:#fbfbe9}input+label{display:block;cursor:text;transition:.15s ease-out all;position:absolute;top:.9em;left:1.3em}.floatLabel{top:.1em;left:32px;font-size:.7em;color:#999;font-weight:400;transition:.15s ease-out all}input.form-control.customerDetails{padding-bottom:5px}.footer{position:absolute;bottom:0;width:100%;height:100px;padding-top:25px;background-color:#f5f5f5}.admin{margin-bottom:0}.image-next{position:absolute;top:180px;right:0}.image-prev{position:absolute;top:180px;left:0}.image-button{cursor:pointer;opacity:.7}.image-button-show{cursor:pointer;opacity:.7!important}.navbar-default{background-color:#fff}.navbar-default .navbar-nav>li>a{color:#000}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#000}.alert-success{background-color:#000;opacity:.65}.btn-outline-danger,.btn-outline-primary,.btn-warning{color:#fff;background-color:#000;border-color:#000}.btn-outline-danger:hover,.btn-warning:hover{color:#fff;background-color:#000;border-color:#000;opacity:.65}a:focus,a:hover{color:#000}a{color:#000}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{background-color:#000;border-color:#000}.navbar-default .navbar-brand{color:#000;font-size:40px;font-weight:700}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#000}.navbar-brand-image{padding:0;height:70px}.navbar-default .badge{background-color:#000;color:#fff}.navbar-default .navbar-toggle{background-color:#000;border-color:#000}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{background-color:#000}.pagination>li>a,.pagination>li>span{background-color:#000}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{background-color:#000;opacity:.65}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{background-color:#000;opacity:.65}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#000}.thumbnail{border:none}.help-block{color:#95a5a6}.list-group-item:first-child,.list-group-item:last-child{border-top-right-radius:0;border-top-left-radius:0}.form-control{border-radius:0}.btn{border-radius:0}.pagination>li:first-child>a,.pagination>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}@media only screen and (min-width:768px){.pushy{width:700px}.pushy-right{-webkit-transform:translate3d(700px,0,0);-ms-transform:translate3d(700px,0,0);transform:translate3d(700px,0,0)}.pushy-open-right #container,.pushy-open-right .push{-webkit-transform:translate3d(-700px,0,0);-ms-transform:translate3d(-700px,0,0);transform:translate3d(-700px,0,0)}}@media only screen and (max-width:768px){.pushy{width:calc(100%)}.pushy-right{-webkit-transform:translate3d(calc(100%),0,0);-ms-transform:translate3d(calc(100%),0,0);transform:translate3d(calc(100%),0,0)}.pushy-open-right #container,.pushy-open-right .push{-webkit-transform:translate3d(-calc(100%),0,0);-ms-transform:translate3d(-calc(100%),0,0);transform:translate3d(-calc(100%),0,0)}.product-item{padding-left:0;padding-right:0}.showFooter{margin-bottom:220px}.title-image-container{height:auto}.product-title{padding-top:25px;min-height:auto}.search-bar-input{padding-left:0;padding-right:0}.menu-side{padding-top:15px}.product-layout{padding-top:0;padding-bottom:30px}#btn_search{border-top-right-radius:4px;border-bottom-right-radius:4px}.cart-row{padding-top:10px;border-bottom:1px solid #ecf0f1;display:block}.cart-body{padding-top:0}.cart-contents-shipping{padding-top:10px}#cart{padding-bottom:15px}.footer{height:100px}body{margin-bottom:100px}} \ No newline at end of file diff --git a/routes/admin.js b/routes/admin.js index a93d0e7..b357e6d 100644 --- a/routes/admin.js +++ b/routes/admin.js @@ -349,7 +349,7 @@ router.post('/admin/settings/menu/save_order', restrict, checkAccess, (req, res) res.status(400).json({ message: 'Failed saving menu order' }); return; } - res.status(200); + res.status(200).json({}); }); // validate the permalink diff --git a/routes/index.js b/routes/index.js index 927251d..2194533 100644 --- a/routes/index.js +++ b/routes/index.js @@ -180,6 +180,7 @@ router.get('/checkout/payment', (req, res) => { paymentType, cartSize: 'part', cartClose: true, + cartReadOnly: true, page: 'checkout-information', countryList, message: clearSessionValue(req.session, 'message'), @@ -250,12 +251,16 @@ router.post('/product/updatecart', (req, res, next) => { let hasError = false; let stockError = false; + console.log('cartItems', cartItems); + // Check cart exists if(!req.session.cart){ emptyCart(req, res, 'json', 'There are no items if your cart or your cart is expired'); return; } + console.log('req.session.cart', req.session.cart); + async.eachSeries(cartItems, async (cartItem, callback) => { // Find index in cart const cartIndex = _.findIndex(req.session.cart, { productId: cartItem.productId }); @@ -265,6 +270,8 @@ router.post('/product/updatecart', (req, res, next) => { if(typeof productQuantity === 'string'){ productQuantity = parseInt(productQuantity); } + + console.log('productQuantity', productQuantity); if(productQuantity === 0){ // quantity equals zero so we remove the item req.session.cart.splice(cartIndex, 1); diff --git a/views/admin.hbs b/views/admin.hbs index faff45a..84e2ec2 100644 --- a/views/admin.hbs +++ b/views/admin.hbs @@ -1,8 +1,10 @@ {{> partials/menu}} -
    -
    +
    +
    +
    +
    \ No newline at end of file diff --git a/views/customer.hbs b/views/customer.hbs index 8244b99..5e1eaa6 100644 --- a/views/customer.hbs +++ b/views/customer.hbs @@ -1,87 +1,84 @@ {{> partials/menu}} -
    -
    -
    -
    +
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -
    + +
    +
    +
    - -
    - -

    Only populate if wanting to reset the customers password

    -
    + + +

    Only populate if wanting to reset the customers password

    +
    +
    - -
    - -
    + +
    - -
    - +
    +
    \ No newline at end of file diff --git a/views/customers.hbs b/views/customers.hbs index 49f3cc5..8cda5b5 100644 --- a/views/customers.hbs +++ b/views/customers.hbs @@ -1,20 +1,20 @@ {{> partials/menu}} -
    -
    +
    +

    Customers

    -