Minor updates

This commit is contained in:
Tony Air 2018-04-21 10:36:06 +07:00
parent 5d9098d8d8
commit 3ac28c6700
33 changed files with 427 additions and 265 deletions

8
.gitignore vendored
View File

@ -1,5 +1,4 @@
/betternavigator
/.idea
/.env
/node_modules
/composer.lock
@ -7,5 +6,6 @@
/vendor
/public/assets
/public/resources
/site/client
/silverstripe-cache
/site/client/dist
/silverstripe-cache
yarn-error\.log

22
.idea/workspace.xml generated
View File

@ -1,27 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3f6401de-a140-484e-9b13-d08de67bdfe7" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/.idea/php.xml" />
<change beforePath="$PROJECT_DIR$/.eslintignore" afterPath="$PROJECT_DIR$/.eslintignore" />
<change beforePath="$PROJECT_DIR$/.gitignore" afterPath="$PROJECT_DIR$/.gitignore" />
<change beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
<change beforePath="$PROJECT_DIR$/browserconfig.xml" afterPath="$PROJECT_DIR$/browserconfig.xml" />
<change beforePath="$PROJECT_DIR$/cache.appcache" afterPath="$PROJECT_DIR$/cache.appcache" />
<change beforePath="$PROJECT_DIR$/composer.json" afterPath="$PROJECT_DIR$/composer.json" />
<change beforePath="$PROJECT_DIR$/manifest.json" afterPath="$PROJECT_DIR$/manifest.json" />
<change beforePath="$PROJECT_DIR$/package-lock.json" afterPath="$PROJECT_DIR$/package-lock.json" />
<change beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
<change beforePath="$PROJECT_DIR$/phpcs.xml.dist" afterPath="" />
<change beforePath="$PROJECT_DIR$/site/_config/debugbar.yml" afterPath="" />
<change beforePath="$PROJECT_DIR$/site/_config/webpack.yml" afterPath="$PROJECT_DIR$/site/_config/webpack.yml" />
<change beforePath="$PROJECT_DIR$/site/code/DeferedRequirements.php" afterPath="" />
<change beforePath="$PROJECT_DIR$/site/code/WebpackTemplateProvider.php" afterPath="" />
<change beforePath="$PROJECT_DIR$/site/src/scss/_layout.scss" afterPath="$PROJECT_DIR$/site/src/scss/_layout.scss" />
<change beforePath="$PROJECT_DIR$/site/templates/Page.ss" afterPath="$PROJECT_DIR$/site/templates/Page.ss" />
<change beforePath="$PROJECT_DIR$/webpack.config.dev.js" afterPath="$PROJECT_DIR$/webpack.config.dev.js" />
<change beforePath="$PROJECT_DIR$/webpack.config.prod.js" afterPath="$PROJECT_DIR$/webpack.config.prod.js" />
</list>
<list default="true" id="3f6401de-a140-484e-9b13-d08de67bdfe7" name="Default" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />

View File

@ -5,26 +5,27 @@
"require": {
"php": ">=7.1.0",
"silverstripe/recipe-cms": "1.1",
"wilr/silverstripe-googlesitemaps": "dev-master",
"silverstripe/userforms": "dev-master",
"undefinedoffset/sortablegridfield": "dev-master",
"silvershop/silverstripe-hasonefield": "dev-master",
"silverstripe/spamprotection": "dev-master",
"silverstripe/recaptcha": "dev-master",
"wilr/silverstripe-googlesitemaps": "*",
"silverstripe/userforms": "*",
"undefinedoffset/sortablegridfield": "*",
"silverstripe/spamprotection": "*",
"silverstripe/recaptcha": "*",
"jonom/silverstripe-betternavigator": "*",
"dnadesign/silverstripe-elemental": "^2.0",
"sheadawson/silverstripe-linkable": "dev-master",
"silverstripe/externallinks": "^2.0"
"sheadawson/silverstripe-linkable": "*",
"silverstripe/externallinks": "*",
"symbiote/silverstripe-gridfieldextensions": "*",
"colymba/gridfield-bulk-editing-tools": "3.0.0-beta4",
"dnadesign/silverstripe-elemental-list": "*",
"dnadesign/silverstripe-elemental-virtual": "*",
"dnadesign/silverstripe-elemental-userforms": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"extra": {
"expose": [
"betternavigator/css",
"betternavigator/javascript",
"betternavigator/images",
"site/client"
"site/client/dist",
"site/thirdparty/client"
],
"project-files-installed": [
"mysite/.htaccess",
@ -46,4 +47,4 @@
},
"prefer-stable": true,
"minimum-stability": "dev"
}
}

293
package-lock.json generated
View File

@ -5,21 +5,21 @@
"requires": true,
"dependencies": {
"@babel/code-frame": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz",
"integrity": "sha512-L8i94FLSyaLQpRfDo/qqSm8Ndb44zMtXParXo0MebJICG1zoCCL4+GkzUOlB4BNTRSXXQdb3feam/qw7bKPipQ==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz",
"integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==",
"dev": true,
"requires": {
"@babel/highlight": "7.0.0-beta.42"
"@babel/highlight": "7.0.0-beta.44"
}
},
"@babel/generator": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.42.tgz",
"integrity": "sha512-9x3zS4nG/6GAvJWB8fAK+5g/Di36xdubB43dMNSucNJTwPvmyfCippir/0I8zyG+ID66hLCLi8V9bomlWRYaHA==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz",
"integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==",
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.44",
"jsesc": "2.5.1",
"lodash": "4.17.5",
"source-map": "0.5.7",
@ -41,38 +41,38 @@
}
},
"@babel/helper-function-name": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.42.tgz",
"integrity": "sha512-6IZ+kkPypwJrnmNzI3y31qAps2kXoPtCE241SvBva2YzB0n/YORWx2YM0jHPYOJBU9Xx5KkUhOKuWkeXZQgtTA==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz",
"integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==",
"dev": true,
"requires": {
"@babel/helper-get-function-arity": "7.0.0-beta.42",
"@babel/template": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42"
"@babel/helper-get-function-arity": "7.0.0-beta.44",
"@babel/template": "7.0.0-beta.44",
"@babel/types": "7.0.0-beta.44"
}
},
"@babel/helper-get-function-arity": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.42.tgz",
"integrity": "sha512-hF5KKcn+V/5PwU7KZ1aVwo535woLC9eV+djaoyNPZeMMJ2s+8bZlEa66Tarei0T68VRL5LXIs1Ao4hSabSkpBg==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz",
"integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==",
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.44"
}
},
"@babel/helper-split-export-declaration": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.42.tgz",
"integrity": "sha512-2r8pZG6SAJTTaI2OhxCmz5PKlMUPY5adOHrHtb1gM3ibJPDOzPAeOQNzItdxNnM33jjRakEGitXX6iYg7Sz73w==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz",
"integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==",
"dev": true,
"requires": {
"@babel/types": "7.0.0-beta.42"
"@babel/types": "7.0.0-beta.44"
}
},
"@babel/highlight": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.42.tgz",
"integrity": "sha512-X3Ur/A/lIbbP8W0pmwgqtDXIxhQmxPaiwY9SKP7kF9wvZfjZRwMvbJE92ozUhF3UDK3DCKaV7oGqmI1rP/zqWA==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz",
"integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==",
"dev": true,
"requires": {
"chalk": "2.3.2",
@ -81,47 +81,47 @@
}
},
"@babel/template": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.42.tgz",
"integrity": "sha512-EK7YdTe47j4VxlwNvz5bnlk5Jx/wWublnqfgOY2IuSNdxCQgXrLD34PfTnabGxywNSkJkcSo6jwr2JGT+S48dA==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz",
"integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"babylon": "7.0.0-beta.42",
"@babel/code-frame": "7.0.0-beta.44",
"@babel/types": "7.0.0-beta.44",
"babylon": "7.0.0-beta.44",
"lodash": "4.17.5"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.42.tgz",
"integrity": "sha512-h6E/OkkvcBw/JimbL0p8dIaxrcuQn3QmIYGC/GtJlRYif5LTKBYPHXYwqluJpfS/kOXoz0go+9mkmOVC0M+zWw==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
"integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
}
}
},
"@babel/traverse": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.42.tgz",
"integrity": "sha512-DZwMuZBfYVIn/cxpXZzHDgKmarW/MWqplLv1k7QJYhK5r5l6GAac/DkKl75A0CjPYrD3VGco6H6ZQp12QaYKSw==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz",
"integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.42",
"@babel/generator": "7.0.0-beta.42",
"@babel/helper-function-name": "7.0.0-beta.42",
"@babel/helper-split-export-declaration": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"babylon": "7.0.0-beta.42",
"@babel/code-frame": "7.0.0-beta.44",
"@babel/generator": "7.0.0-beta.44",
"@babel/helper-function-name": "7.0.0-beta.44",
"@babel/helper-split-export-declaration": "7.0.0-beta.44",
"@babel/types": "7.0.0-beta.44",
"babylon": "7.0.0-beta.44",
"debug": "3.1.0",
"globals": "11.3.0",
"globals": "11.4.0",
"invariant": "2.2.4",
"lodash": "4.17.5"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.42.tgz",
"integrity": "sha512-h6E/OkkvcBw/JimbL0p8dIaxrcuQn3QmIYGC/GtJlRYif5LTKBYPHXYwqluJpfS/kOXoz0go+9mkmOVC0M+zWw==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
"integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
},
"debug": {
@ -134,17 +134,17 @@
}
},
"globals": {
"version": "11.3.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz",
"integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==",
"version": "11.4.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.4.0.tgz",
"integrity": "sha512-Dyzmifil8n/TmSqYDEXbm+C8yitzJQqQIlJQLNRMwa+BOUJpRC19pyVeN12JAjt61xonvXjtff+hJruTRXn5HA==",
"dev": true
}
}
},
"@babel/types": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.42.tgz",
"integrity": "sha512-+pmpISmTHQqMMpHHtDLxcvtRhmn53bAxy8goJfHipS/uy/r3PLcuSdPizLW7DhtBWbtgIKZufLObfnIMoyMNsw==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz",
"integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==",
"dev": true,
"requires": {
"esutils": "2.0.2",
@ -667,23 +667,23 @@
}
},
"babel-eslint": {
"version": "8.2.2",
"resolved": "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz",
"integrity": "sha512-Qt2lz2egBxNYWqN9JIO2z4NOOf8i4b5JS6CFoYrOZZTDssueiV1jH/jsefyg+86SeNY3rB361/mi3kE1WK2WYQ==",
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.3.tgz",
"integrity": "sha512-0HeSTtaXg/Em7FCUWxwOT+KeFSO1O7LuRuzhk7g+1BjwdlQGlHq4OyMi3GqGxrNfEq8jEi6Hmt5ylEQUhurgiQ==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0-beta.42",
"@babel/traverse": "7.0.0-beta.42",
"@babel/types": "7.0.0-beta.42",
"babylon": "7.0.0-beta.42",
"@babel/code-frame": "7.0.0-beta.44",
"@babel/traverse": "7.0.0-beta.44",
"@babel/types": "7.0.0-beta.44",
"babylon": "7.0.0-beta.44",
"eslint-scope": "3.7.1",
"eslint-visitor-keys": "1.0.0"
},
"dependencies": {
"babylon": {
"version": "7.0.0-beta.42",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.42.tgz",
"integrity": "sha512-h6E/OkkvcBw/JimbL0p8dIaxrcuQn3QmIYGC/GtJlRYif5LTKBYPHXYwqluJpfS/kOXoz0go+9mkmOVC0M+zWw==",
"version": "7.0.0-beta.44",
"resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz",
"integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==",
"dev": true
}
}
@ -1870,9 +1870,9 @@
}
},
"bootstrap": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.0.0.tgz",
"integrity": "sha512-gulJE5dGFo6Q61V/whS6VM4WIyrlydXfCgkE+Gxe5hjrJ8rXLLZlALq7zq2RPhOc45PSwQpJkrTnc2KgD6cvmA=="
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.1.0.tgz",
"integrity": "sha512-kCo82nE8qYVfOa/Z3hL98CPgPIEkh6iPdiJrUJMQ9n9r0+6PEET7cmhLlV0XVYmEj5QtKIOaSGMLxy5jSFhKog=="
},
"bootstrap-offcanvas": {
"version": "1.0.0",
@ -1917,9 +1917,9 @@
"dev": true
},
"browser-sync": {
"version": "2.23.6",
"resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.23.6.tgz",
"integrity": "sha512-loCO5NQKZXfBJrEvmLwF1TPSECCsPopNd29qduoysLmpw8op2lgolGMjz3oI/MjG4duzB9TfDs7k58djRSwPwg==",
"version": "2.23.7",
"resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.23.7.tgz",
"integrity": "sha512-ZyaNxjsYNXzTa6vqyauR7f++FIhhUXUbeSGcXfFLVWIqCPBChpjsoKQNCwC3rQ6+LemKpDRQ+bxU44hzmIBGvQ==",
"dev": true,
"requires": {
"browser-sync-ui": "1.0.1",
@ -4702,9 +4702,9 @@
}
},
"eslint-module-utils": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz",
"integrity": "sha512-jDI/X5l/6D1rRD/3T43q8Qgbls2nq5km5KSqiwlyUbGo5+04fXhMKdCPhjwbqAa6HXWaMxj8Q4hQDIh7IadJQw==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz",
"integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=",
"dev": true,
"requires": {
"debug": "2.6.9",
@ -4742,21 +4742,21 @@
}
},
"eslint-plugin-import": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz",
"integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=",
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.11.0.tgz",
"integrity": "sha1-Fa7qN6Z0mdhI6OmBgG1GJ7VQOBY=",
"dev": true,
"requires": {
"builtin-modules": "1.1.1",
"contains-path": "0.1.0",
"debug": "2.6.9",
"doctrine": "1.5.0",
"eslint-import-resolver-node": "0.3.2",
"eslint-module-utils": "2.1.1",
"eslint-module-utils": "2.2.0",
"has": "1.0.1",
"lodash": "4.17.5",
"minimatch": "3.0.4",
"read-pkg-up": "2.0.0"
"read-pkg-up": "2.0.0",
"resolve": "1.6.0"
},
"dependencies": {
"doctrine": {
@ -4832,9 +4832,9 @@
}
},
"eslint-plugin-jquery": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.3.0.tgz",
"integrity": "sha512-YTHb9wcMpCNzu6Ig6SZV6UmHtmy20legETJH/DiANwCGtELHxi4iN8r+LC24IjrrB9LwqeSU/GhI9ojhPO5Hug==",
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jquery/-/eslint-plugin-jquery-1.3.1.tgz",
"integrity": "sha512-ymFQ6K7BXPg9z6ZWVGnaRObsxS5rZ1w6Cwgg4GW6lWaMBS5XO2rW34ddlOEccG6DANQyNrpt70nVSuaqKb0uzQ==",
"dev": true
},
"eslint-plugin-react": {
@ -5762,6 +5762,9 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true
},
"foundation-emails": {
"version": "github:zurb/foundation-emails#7a0a991807f6981c71ec796055dd5231af7bc749"
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@ -8800,6 +8803,14 @@
}
}
},
"jquery-zoom": {
"version": "1.7.20",
"resolved": "https://registry.npmjs.org/jquery-zoom/-/jquery-zoom-1.7.20.tgz",
"integrity": "sha1-Jbn53FCAS0jCHxeWlJpfasF/u6c=",
"requires": {
"jquery": "3.3.1"
}
},
"js-base64": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz",
@ -9006,12 +9017,12 @@
"lodash": "4.17.5",
"md5": "2.2.1",
"node-sass": "4.8.3",
"postcss-loader": "2.1.3",
"postcss-loader": "2.1.4",
"resolve-url-loader": "2.3.0",
"sass-loader": "6.0.7",
"style-loader": "0.18.2",
"uglify-js": "2.8.29",
"uglifyjs-webpack-plugin": "1.2.4",
"uglifyjs-webpack-plugin": "1.2.5",
"vue-loader": "13.7.1",
"vue-template-compiler": "2.5.16",
"webpack": "3.11.0",
@ -9322,9 +9333,9 @@
}
},
"limiter": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.2.tgz",
"integrity": "sha512-JIKZ0xb6fZZYa3deZ0BgXCgX6HgV8Nx3mFGeFHmFWW8Fb2c08e0CyE+G3nalpD0xGvGssjGb1UdFr+PprxZEbw==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.3.tgz",
"integrity": "sha512-zrycnIMsLw/3ZxTbW7HCez56rcFGecWTx5OZNplzcXUUmJLmoYArC6qdJzmAN5BWiNXGcpjhF9RQ1HSv5zebEw==",
"dev": true
},
"load-bmfont": {
@ -9936,6 +9947,11 @@
"readable-stream": "2.3.5"
}
},
"meta-lightbox": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/meta-lightbox/-/meta-lightbox-1.0.0.tgz",
"integrity": "sha512-+TVZ/98N7MwfotfEkGx6pRS8hxe+P33xDwmnZ8Fbrk9QIDNbIlpU5BWhOWmI47FQVgLtqq/JKmDRgfVgb734ZA=="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
@ -15674,9 +15690,9 @@
}
},
"popper.js": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.1.tgz",
"integrity": "sha1-uIFeXNpvYvwgQuR2GGSfdYZuZ1M="
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.14.3.tgz",
"integrity": "sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU="
},
"portfinder": {
"version": "1.0.13",
@ -16395,9 +16411,9 @@
}
},
"postcss-loader": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-2.1.3.tgz",
"integrity": "sha512-RuBcNE8rjCkIB0IsbmkGFRmQJTeQJfCI88E0VTarPNTvaNSv9OFv1DvTwgtAN/qlzyiELsmmmtX/tEzKp/cdug==",
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-2.1.4.tgz",
"integrity": "sha512-L2p654oK945B/gDFUGgOhh7uzj19RWoY1SVMeJVoKno1H2MdbQ0RppR/28JGju4pMb22iRC7BJ9aDzbxXSLf4A==",
"dev": true,
"requires": {
"loader-utils": "1.1.0",
@ -16407,14 +16423,15 @@
},
"dependencies": {
"ajv": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.3.0.tgz",
"integrity": "sha1-FlCkERTvAFdMrBC4Ay2PTBSBLac=",
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.4.0.tgz",
"integrity": "sha1-06/3jpJ3VJdx2vAWTP9ISCt1T8Y=",
"dev": true,
"requires": {
"fast-deep-equal": "1.1.0",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.3.1"
"json-schema-traverse": "0.3.1",
"uri-js": "3.0.2"
}
},
"ajv-keywords": {
@ -16429,7 +16446,7 @@
"integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
"dev": true,
"requires": {
"ajv": "6.3.0",
"ajv": "6.4.0",
"ajv-keywords": "3.1.0"
}
}
@ -17989,9 +18006,9 @@
}
},
"react": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-16.2.0.tgz",
"integrity": "sha512-ZmIomM7EE1DvPEnSFAHZn9Vs9zJl5A9H7el0EGTE6ZbW9FKe/14IYAlPbC8iH25YarEQxZL+E8VW7Mi7kfQrDQ==",
"version": "16.3.2",
"resolved": "https://registry.npmjs.org/react/-/react-16.3.2.tgz",
"integrity": "sha512-o5GPdkhciQ3cEph6qgvYB7LTOHw/GB0qRI6ZFNugj49qJCFfgHwVNjZ5u+b7nif4vOeMIOuYj3CeYe2IBD74lg==",
"dev": true,
"requires": {
"fbjs": "0.8.16",
@ -18007,9 +18024,9 @@
"dev": true
},
"react-dom": {
"version": "16.2.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.2.0.tgz",
"integrity": "sha512-zpGAdwHVn9K0091d+hr+R0qrjoJ84cIBFL2uU60KvWBPfZ7LPSrfqviTxGHWN0sjPZb2hxWzMexwrvJdKePvjg==",
"version": "16.3.2",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.3.2.tgz",
"integrity": "sha512-MMPko3zYncNrz/7gG17wJWUREZDvskZHXOwbttzl0F0L3wDmToyuETuo/r8Y5yvDejwYcRyWI1lvVBjLJWFwKA==",
"dev": true,
"requires": {
"fbjs": "0.8.16",
@ -19396,7 +19413,7 @@
"escape-html": "1.0.3",
"etag": "1.8.1",
"fresh": "0.5.0",
"http-errors": "1.6.2",
"http-errors": "1.6.3",
"mime": "1.3.4",
"ms": "1.0.0",
"on-finished": "2.3.0",
@ -19428,21 +19445,21 @@
"dev": true
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"dev": true,
"requires": {
"depd": "1.1.1",
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": "1.3.1"
"setprototypeof": "1.1.0",
"statuses": "1.5.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=",
"statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=",
"dev": true
}
}
@ -19454,9 +19471,9 @@
"dev": true
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==",
"dev": true
}
}
@ -20316,7 +20333,7 @@
"dev": true,
"requires": {
"commander": "2.15.1",
"limiter": "1.1.2"
"limiter": "1.1.3"
}
},
"stream-to": {
@ -21119,9 +21136,9 @@
"dev": true
},
"uglifyjs-webpack-plugin": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.4.tgz",
"integrity": "sha512-z0IbjpW8b3O/OVn+TTZN4pI29RN1zktFBXLIzzfZ+++cUtZ1ERSlLWgpE/5OERuEUs1ijVQnpYAkSlpoVmQmSQ==",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz",
"integrity": "sha512-hIQJ1yxAPhEA2yW/i7Fr+SXZVMp+VEI3d42RTHBgQd2yhp/1UdBcR3QEWPV5ahBxlqQDMEMTuTEvDHSFINfwSw==",
"dev": true,
"requires": {
"cacache": "10.0.4",
@ -21135,14 +21152,15 @@
},
"dependencies": {
"ajv": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.3.0.tgz",
"integrity": "sha1-FlCkERTvAFdMrBC4Ay2PTBSBLac=",
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.4.0.tgz",
"integrity": "sha1-06/3jpJ3VJdx2vAWTP9ISCt1T8Y=",
"dev": true,
"requires": {
"fast-deep-equal": "1.1.0",
"fast-json-stable-stringify": "2.0.0",
"json-schema-traverse": "0.3.1"
"json-schema-traverse": "0.3.1",
"uri-js": "3.0.2"
}
},
"ajv-keywords": {
@ -21163,7 +21181,7 @@
"integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==",
"dev": true,
"requires": {
"ajv": "6.3.0",
"ajv": "6.4.0",
"ajv-keywords": "3.1.0"
}
},
@ -21389,6 +21407,23 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"uri-js": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-3.0.2.tgz",
"integrity": "sha1-+QuFhQf4HepNz7s8TD2/orVX+qo=",
"dev": true,
"requires": {
"punycode": "2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.0.tgz",
"integrity": "sha1-X4Y+3Im5bbCQdLrXlHvwkFbKTn0=",
"dev": true
}
}
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
@ -23380,9 +23415,9 @@
}
},
"yarn": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.5.1.tgz",
"integrity": "sha1-6GgDYOgyrIlSHrgNrTp7wnpAurQ="
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/yarn/-/yarn-1.6.0.tgz",
"integrity": "sha1-nOxveYbcI3057HBc502VFV/lXUs="
},
"yauzl": {
"version": "2.4.1",

View File

@ -24,37 +24,39 @@
},
"dependencies": {
"bootbox.js": "makeusabrew/bootbox#*",
"bootstrap": "^4.0.0",
"bootstrap": "^4.1.0",
"bootstrap-offcanvas": "^1.0.0",
"core-util-is": "^1.0.2",
"font-awesome": "^4.7.0",
"foundation-emails": "zurb/foundation-emails#*",
"foundation-emails": "github:zurb/foundation-emails#*",
"jquery": "^3.3.1",
"jquery-hammerjs": "^2.0.0",
"jquery-zoom": "^1.7.20",
"meta-lightbox": "^1.0.0",
"npm": "^5.8.0",
"offcanvas-bootstrap": "^2.5.2",
"popper.js": "^1.12.9",
"yarn": "^1.5.1"
"popper.js": "^1.14.3",
"yarn": "^1.6.0"
},
"devDependencies": {
"animate.css": "^3.5.2",
"autoprefixer": "^7.2.5",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.2",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"browser-sync": "^2.23.6",
"browser-sync": "^2.23.7",
"browser-sync-webpack-plugin": "^1.2.0",
"copy-webpack-plugin": "^4.3.1",
"copyfiles": "^1.2.0",
"cross-env": "^5.1.3",
"css-loader": "^0.28.9",
"eslint": "^4.18.1",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jquery": "^1.3.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jquery": "^1.3.1",
"eslint-plugin-react": "^7.7.0",
"exports-loader": "^0.7.0",
"extract-text-webpack-plugin": "^3.0.2",
@ -66,9 +68,9 @@
"node-sass": "^4.7.2",
"object-assign": "^4.1.1",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"postcss-loader": "^2.0.10",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"postcss-loader": "^2.1.4",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-hot-loader": "^3.1.3",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2",
@ -80,7 +82,7 @@
"script-ext-html-webpack-plugin": "^1.8.8",
"style-loader": "^0.19.0",
"svg-url-loader": "^2.3.1",
"uglifyjs-webpack-plugin": "^1.1.6",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^0.6.2",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.11.1",

29
site/LICENSE Normal file
View File

@ -0,0 +1,29 @@
BSD 3-Clause License
Copyright (c) 2018, Thierry François (colymba)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

2
site/README.md Normal file
View File

@ -0,0 +1,2 @@
Your Project Title
========================================

View File

@ -3,9 +3,9 @@
# Cuz WebPack compiling script use it to set configuration
WebpackTemplateProvider:
SRC: site/src
DIST: site/client
SRC: site/client/src
DIST: site/client/dist
HOSTNAME: localhost
PORT: "3000"
TYPESJS: site/src/js/types
TYPESSCSS: site/src/scss/types
TYPESJS: site/client/src/js/types
TYPESSCSS: site/client/src/scss/types

View File

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -1,6 +1,6 @@
import '../scss/app.scss';
// import Bootstrap
// Bootstrap
import Popper from 'popper.js';
import 'bootstrap/js/dist/util';
import 'bootstrap/js/dist/alert';
@ -15,15 +15,19 @@ import 'bootstrap/js/dist/scrollspy';
import 'bootstrap/js/dist/tab';
//
// Extra modules
import 'jquery-zoom/jquery.zoom';
import 'meta-lightbox/meta-lightbox';
// import your custom UI components
import './main';
// import images
function importAll(r) {
return r.keys().map(r);
return r.keys().map(r);
}
const images = importAll(require.context('../img/', false, /\.(png|jpe?g|svg)$/));
const images = importAll(require.context('../img/', false, /\.(png|jpe?g|svg|gif)$/));
// TODO: hot module update
/* const Events = require("./_events");
@ -34,4 +38,4 @@ if (module.hot) {
$(window).trigger(Events.AJAX);
}
});
} */
} */

View File

@ -1,4 +1,4 @@
// Bootstrap basics
// Bootstrap
@import "_bootstrap_variables";
@import "~bootstrap/scss/root";
@ -34,9 +34,18 @@
@import "~bootstrap/scss/utilities";
@import "~bootstrap/scss/print";
// Fontawesome
$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome";
// Extra modules
$lightbox-breakpoint: map-get($grid-breakpoints, "sm");
$lightbox-link-hover-color: $link-hover-color;
@import "~meta-lightbox/scss/meta-lightbox";
@import "~meta-lightbox/scss/meta-lightbox-theme";
// Your custom variables
@import "_variables";

33
site/package.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "your-project-title",
"version": "3.0.0",
"description": "",
"engines": {
"node": "^6.x"
},
"scripts": {
"build": "NODE_ENV=production webpack -p --bail --progress",
"watch": "NODE_ENV=development webpack --watch --progress",
"tx": "tx push --source && tx pull --all && node transifex.js",
"dist": "npm run tx && npm run build"
},
"repository": {
"type": "git",
"url": "git@github.com:a2nt/silverstripe-webpack.git"
},
"keywords": [
"silverstripe"
],
"author": "Tony Air",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/a2nt/silverstripe-webpack/issues"
},
"homepage": "https://github.com/a2nt/silverstripe-webpack",
"dependencies": {
"webpack": "^3.10"
},
"devDependencies": {
"@silverstripe/webpack-config": "^0.7"
}
}

View File

@ -7,8 +7,8 @@ use SilverStripe\Control\Director;
use SilverStripe\Core\Path;
use SilverStripe\Core\Manifest\ManifestFileFinder;
class DeferedRequirements implements TemplateGlobalProvider {
class DeferedRequirements implements TemplateGlobalProvider
{
private static $css = [];
private static $js = [];
private static $defered = false;
@ -44,15 +44,17 @@ class DeferedRequirements implements TemplateGlobalProvider {
DeferedRequirements::loadJS('app.js');
// Class libs
if($class) {
$dir = Path::join(Director::publicFolder(), ManifestFileFinder::RESOURCES_DIR);
if ($class) {
$dir = Path::join(Director::publicFolder(), ManifestFileFinder::RESOURCES_DIR, 'site','client');
if(file_exists(Path::join($dir,$class . '.js'))) {
DeferedRequirements::loadJS($class . '.js');
}
if(file_exists(Path::join($dir,$class . '.css'))) {
if (file_exists(Path::join($dir, 'css', $class . '.css'))) {
DeferedRequirements::loadCSS($class . '.css');
}
if (file_exists(Path::join($dir, 'js', $class . '.js'))) {
DeferedRequirements::loadJS($class . '.js');
}
}
return self::forTemplate();

View File

@ -25,7 +25,7 @@ class WebpackTemplateProvider implements TemplateGlobalProvider
/**
* @var string assets static files directory
*/
private static $dist = 'site/dist';
private static $dist = 'site/client/dist';
/**
* @return array
@ -65,37 +65,37 @@ class WebpackTemplateProvider implements TemplateGlobalProvider
public static function isActive()
{
return Director::isDev() && !!@fsockopen(
Config::inst()->get(__CLASS__,'HOSTNAME'),
Config::inst()->get(__CLASS__,'PORT')
Config::inst()->get(__CLASS__, 'HOSTNAME'),
Config::inst()->get(__CLASS__, 'PORT')
);
}
protected static function _getPath($path)
{
return self::isActive() && strpos($path,'//') === false ?
return self::isActive() && strpos($path, '//') === false ?
self::_toDevServerPath($path) :
self::_toPublicPath($path);
}
protected static function _toDevServerPath($path)
{
$path = stripos($path,'css') ? 'site/client/css/'.$path : 'site/client/js/'.$path;
//$path = 'resources/site/client/'.(stripos($path, 'css') ? 'css/' : 'js/').$path;
return sprintf(
'%s%s:%s/%s',
Director::protocol(),
Config::inst()->get(__CLASS__,'HOSTNAME'),
Config::inst()->get(__CLASS__,'PORT'),
Config::inst()->get(__CLASS__, 'HOSTNAME'),
Config::inst()->get(__CLASS__, 'PORT'),
basename($path)
);
}
protected static function _toPublicPath($path)
{
return strpos($path,'//') === false ?
return strpos($path, '//') === false ?
Controller::join_links(
Config::inst()->get(__CLASS__,'DIST'),
(strpos($path,'.css') ? 'css' : 'js' ),
Config::inst()->get(__CLASS__, 'DIST'),
(strpos($path, '.css') ? 'css' : 'js'),
$path
)
: $path;

View File

@ -31,7 +31,9 @@
$BetterNavigator
</div>
<%-- Require CSS+JS from /site/dist/[js,css]/[ClassName].[js,css] --%>
$AutoRequirements($ClassName).RAW
<%-- Require CSS+JS from /public/resourses/[js,css]/[ClassName].[js,css] --%>
$AutoRequirements($ClassName).RAW
<%-- place extra requirements after this line --%>
</body>
</html>

34
site/transifex.js Normal file
View File

@ -0,0 +1,34 @@
/**
* Parse all source JS language files (JSON pulled from Transifex) from client/src/lang
* to SilverStripe i18n js file in client/lang
* Quick and dirty node script!
*/
var fs = require('fs');
var path = require('path');
const PATHS = {
SRC: path.resolve('client/src/lang'),
DIST: path.resolve('client/lang'),
};
console.log('Writing SS i18n JS lang files...');
fs.readdir(PATHS.SRC, function(err, files)
{
files.forEach(function (file) {
var lang = file.split('.').shift();
fs.readFile(PATHS.SRC + '/' + file, "utf8", function(err, data) {
if (err) { console.log(err); }
var fileData = `if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined');
} else {
ss.i18n.addDictionary('${lang}', ${data});
}`;
fs.writeFile(PATHS.DIST + '/' + lang + '.js', fileData, "utf8", function(err) {
if (err) { console.log(err); }
console.log("Saved " + lang + '.js');
});
});
});
});

View File

@ -2,30 +2,34 @@
* Common Environment
*/
const webpack = require("webpack");
const conf = require("./webpack.configuration");
const webpack = require('webpack');
const conf = require('./webpack.configuration');
const path = require("path");
const path = require('path');
const includes = {
app: path.join(__dirname, conf.SRC, "js/app.js"),
app: path.join(__dirname, conf.SRC, 'js/app.js'),
};
const _getAllFilesFromFolder = function(dir) {
dir = path.join(__dirname, dir);
let filesystem = require("fs");
const filesystem = require('fs');
let results = [];
filesystem.readdirSync(dir).forEach(function(file) {
filesystem.readdirSync(dir).forEach((file) => {
if (file === '_notes') {
return;
}
file = dir + "/" + file;
let stat = filesystem.statSync(file);
file = `${dir}/${file}`;
const stat = filesystem.statSync(file);
if (stat && stat.isDirectory()) {
results = results.concat(_getAllFilesFromFolder(file))
} else results.push(file);
results = results.concat(_getAllFilesFromFolder(file));
} else {
results.push(file);
}
});
return results;
@ -34,85 +38,89 @@ const _getAllFilesFromFolder = function(dir) {
// add page specific scripts
const pageScripts = _getAllFilesFromFolder(conf.TYPESJS);
pageScripts.forEach((file) => {
includes[path.basename(file, ".js")] = file;
includes[path.basename(file, '.js')] = file;
});
// add page specific scss
const scssIncludes = _getAllFilesFromFolder(conf.TYPESSCSS);
scssIncludes.forEach((file) => {
includes[path.basename(file, ".scss")] = file;
includes[path.basename(file, '.scss')] = file;
});
module.exports = {
entry: includes,
devtool: "source-map",
devtool: 'source-map',
externals: {
"jquery": "jQuery",
'jquery': 'jQuery',
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
loader: 'babel-loader',
options: {
presets: [
["es2015", {
modules: false
['es2015', {
modules: false,
}],
["stage-2"]
['stage-2'],
],
plugins: [
["transform-react-jsx"],
["react-hot-loader/babel"],
]
['transform-react-jsx'],
['react-hot-loader/babel'],
],
},
}
},
}, {
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
exclude: /node_modules/,
}, {
test: /\.coffee?$/,
use: 'coffee-loader'
use: 'coffee-loader',
}, {
test: /\.(png|jpg|gif|svg)$/,
loader: "file-loader",
test: /\.(png|jpg|jpeg|gif|svg)$/,
loader: 'file-loader',
options: {
name: "[name].[ext]",
name: '[name].[ext]',
outputPath: 'img/',
publicPath: '/site/dist/img/'
}
publicPath: '../img/',
},
}, {
test: /\.worker\.js$/,
use: {
loader: "worker-loader"
}
}]
loader: 'worker-loader',
},
}],
},
resolve: {
modules: [
path.resolve(__dirname, 'public'),
'node_modules'
],
alias: {
'jquery': require.resolve('jquery'),
'jQuery': require.resolve('jquery'),
}
},
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
Popper: ["popper.js", "default"],
Util: "exports-loader?Util!bootstrap/js/dist/util",
Alert: "exports-loader?Alert!bootstrap/js/dist/alert",
Button: "exports-loader?Button!bootstrap/js/dist/button",
Carousel: "exports-loader?Carousel!bootstrap/js/dist/carousel",
Collapse: "exports-loader?Collapse!bootstrap/js/dist/collapse",
Dropdown: "exports-loader?Dropdown!bootstrap/js/dist/dropdown",
Modal: "exports-loader?Modal!bootstrap/js/dist/modal",
Tooltip: "exports-loader?Tooltip!bootstrap/js/dist/tooltip",
Popover: "exports-loader?Popover!bootstrap/js/dist/popover",
Scrollspy: "exports-loader?Scrollspy!bootstrap/js/dist/scrollspy",
Tab: "exports-loader?Tab!bootstrap/js/dist/tab",
})
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery',
Popper: ['popper.js', 'default'],
Util: 'exports-loader?Util!bootstrap/js/dist/util',
Alert: 'exports-loader?Alert!bootstrap/js/dist/alert',
Button: 'exports-loader?Button!bootstrap/js/dist/button',
Carousel: 'exports-loader?Carousel!bootstrap/js/dist/carousel',
Collapse: 'exports-loader?Collapse!bootstrap/js/dist/collapse',
Dropdown: 'exports-loader?Dropdown!bootstrap/js/dist/dropdown',
Modal: 'exports-loader?Modal!bootstrap/js/dist/modal',
Tooltip: 'exports-loader?Tooltip!bootstrap/js/dist/tooltip',
Popover: 'exports-loader?Popover!bootstrap/js/dist/popover',
Scrollspy: 'exports-loader?Scrollspy!bootstrap/js/dist/scrollspy',
Tab: 'exports-loader?Tab!bootstrap/js/dist/tab',
}),
],
};

View File

@ -19,13 +19,13 @@ const config = merge.strategy({
entry: {
app: [
'react-hot-loader/patch',
'webpack-dev-server/client?https://' + conf.HOSTNAME + ':' + conf.PORT + '/public/resourses/site',
'webpack-dev-server/client?https://' + conf.HOSTNAME + ':' + conf.PORT,
'webpack/hot/only-dev-server',
]
},
output: {
path: path.join(__dirname, conf.DIST),
path: path.join(__dirname, conf.DIST),
filename: '[name].js',
// necessary for HMR to know where to load the hot update chunks
publicPath: 'https://' + conf.HOSTNAME + ':' + conf.PORT + '/'
@ -64,6 +64,8 @@ const config = merge.strategy({
})
]
}
}, {
loader: 'resolve-url-loader'
}, {
loader: 'sass-loader',
options: {
@ -75,6 +77,11 @@ const config = merge.strategy({
use: [{
loader: 'url-loader'
}]
}, {
test: /\.(gif|png|jpg|jpeg|ttf|otf|eot|svg|woff(2)?)$/,
use: [{
loader: 'url-loader'
}]
}]
},
plugins: [
@ -88,7 +95,11 @@ const config = merge.strategy({
port: PORT,
historyApiFallback: true,
hot: false,
clientLogLevel: "info",
clientLogLevel: 'info',
contentBase: [
path.resolve(__dirname, 'public'),
'node_modules'
],
//watchContentBase: true,
overlay: {
warnings: true,

View File

@ -17,7 +17,7 @@ const FaviconsWebpackPlugin = require("favicons-webpack-plugin");
module.exports = merge(common, {
output: {
path: path.join(__dirname, conf.DIST),
path: path.join(__dirname, conf.DIST),
filename: 'js/[name].js',
publicPath: conf.DIST + '/',
},
@ -71,7 +71,17 @@ module.exports = merge(common, {
publicPath: '../fonts/'
}
}]
} ]
}, {
test: /\.(ttf|otf|eot|svg|woff(2)?)$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/',
publicPath: '../fonts/'
}
}]
}]
},
plugins: [
@ -91,7 +101,7 @@ module.exports = merge(common, {
}),
//new OptimizeCSSAssets(),
new FaviconsWebpackPlugin({
logo: path.join(__dirname, conf.SRC) + '/favicon.png',
logo: path.join(__dirname, conf.SRC) + '/favicon.png',
prefix: '/icons/',
statsFilename: conf.DIST + '/icons/iconstats.json',
icons: {