-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from PlatoCreative/3.6.0
Laravel Mix & Composer updates
- Loading branch information
Showing
9 changed files
with
94 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
{ | ||
"name": "plato-creative/plato-silverstripe-installer", | ||
"description": "Custom built SilverStripe installer with Foundation.", | ||
"description": "Custom built SilverStripe installer with Foundation", | ||
"type": "silverstripe-module", | ||
"homepage": "https://github.com/PlatoCreative/plato-silverstripe-installer", | ||
"keywords": ["silverstripe", "installer", "plato", "creative", "foundation"], | ||
"keywords": ["silverstripe", "installer", "plato creative"], | ||
"authors": [ | ||
{ | ||
"name": "Myles Beardsmore", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Gorrie Coe", | ||
"email": "[email protected]" | ||
"name": "Plato Creative", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
|
@@ -35,10 +31,11 @@ | |
"markguinn/silverstripe-email-helpers": "1.2.*", | ||
"plato-creative/silverstripe-styleguide": "1.*", | ||
"undefinedoffset/silverstripe-nocaptcha": "0.2.*", | ||
"tractorcow/silverstripe-dynamiccache": "4.1.*" | ||
"tractorcow/silverstripe-dynamiccache": "4.1.*", | ||
"ryanpotter/silverstripe-cms-theme": "^1.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/PHPUnit": "~3.7" | ||
"phpunit/PHPUnit": "~3.7@stable" | ||
}, | ||
"prefer-stable": true, | ||
"minimum-stability": "dev" | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"scripts": { | ||
"dev": "npm run development", | ||
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch-p": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"watch-poll": "npm run watch -- --watch-poll", | ||
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", | ||
"prod": "npm run production", | ||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" | ||
}, | ||
"devDependencies": { | ||
"axios": "^0.16.2", | ||
"cross-env": "^3.2.3", | ||
"foundation-sites": "6.3.*", | ||
"gulp": "^3.9.1", | ||
"jquery": "2.2.3", | ||
"jquery-fancybox": "^3.1.0", | ||
"laravel-elixir": "6.0.0-15", | ||
"laravel-elixir-webpack-official": "^1.0.10", | ||
"script-loader": "^0.7.0" | ||
"jquery-match-height": "^0.7.2", | ||
"laravel-mix": "^0.*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,51 @@ | ||
|
||
// Require jQuery | ||
window.$ = window.jQuery = require('jquery/dist/jquery.js'); | ||
// Require Foundation | ||
/** | ||
* Load Plugins | ||
* If you don't see a plugin below it might be autloaded via webpack | ||
* Check webpack.mix.js for autoloaded plugins. | ||
*/ | ||
require('foundation-sites'); | ||
require('jquery-match-height'); | ||
|
||
|
||
/** | ||
* We'll load the axios HTTP library which allows us to easily issue requests | ||
* to our Laravel back-end. This library automatically handles sending the | ||
* CSRF token as a header based on the value of the "XSRF" token cookie. | ||
*/ | ||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | ||
/** | ||
* Next we will register the CSRF Token as a common header with Axios so that | ||
* all outgoing HTTP requests automatically have it attached. This is just | ||
* a simple convenience so we don't have to attach every token manually. | ||
*/ | ||
let token = document.head.querySelector('meta[name="csrf-token"]'); | ||
if (token) { | ||
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; | ||
} else { | ||
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); | ||
} | ||
|
||
(function($) { | ||
/** | ||
* | ||
* Application script | ||
* | ||
*/ | ||
$(function() { | ||
|
||
// init Foundation | ||
$(document).foundation(); | ||
|
||
$(document).ready(function() { | ||
// google analytics | ||
$('[data-ga-label]').each(function(){ | ||
$(this).on('click', function() { | ||
var $trackingName = $(this).data('ga-label'), | ||
$tagName = $(this).prop("tagName"), | ||
$action = 'click'; | ||
if($tagName=='input'){ | ||
$action = 'submit'; | ||
} | ||
ga('send', 'event', 'button', $action, $trackingName); | ||
}); | ||
// google analytics | ||
$('[data-ga-label]').each(function(){ | ||
$(this).on('click', function() { | ||
var $trackingName = $(this).data('ga-label'), | ||
$tagName = $(this).prop("tagName"), | ||
$action = 'click'; | ||
if($tagName=='input'){ | ||
$action = 'submit'; | ||
} | ||
ga('send', 'event', 'button', $action, $trackingName); | ||
}); | ||
}); | ||
|
||
}(jQuery)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/*------------------------------------------------------------------- | ||
Required plugins | ||
-------------------------------------------------------------------*/ | ||
const { mix } = require('laravel-mix'); | ||
|
||
/*------------------------------------------------------------------- | ||
Tasks | ||
-------------------------------------------------------------------*/ | ||
mix.autoload({ | ||
'jquery': ['$', 'jQuery', 'window.jQuery'], | ||
'axios': ['window.axios'] | ||
}) | ||
.js('themes/base/js/app.js', 'themes/base/js/app.min.js').sourceMaps() | ||
.sass('themes/base/scss/app.scss', 'themes/base/css/').options({ | ||
processCssUrls: false | ||
}) | ||
.sass('themes/base/scss/editor.scss', 'themes/base/css/'); | ||
|
||
// BrowserSync - e.g. "localhost/mysite.com" | ||
mix.browserSync({ | ||
proxy: 'localhost/[YOURSITENAME.CO.NZ]', | ||
files: ["themes/base/css/*", "themes/base/js/app.min.js", "themes/base/templates/*.ss", "themes/base/templates/*/*.ss"] | ||
}); |