Skip to content

Commit

Permalink
updated for foundation 6.4. Simplified. Dependencies locked in.
Browse files Browse the repository at this point in the history
  • Loading branch information
mediabeastnz committed Sep 14, 2017
1 parent 1913a1b commit ea54db9
Show file tree
Hide file tree
Showing 20 changed files with 454 additions and 236 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ A custom installer for a SilverStripe based project, includes commonly used file
This installer requires you have the following:
- Composer
- NPM/nodeJS
- Gulp

### Installation ###
1. Use composer to quickly create a new project:
Expand All @@ -18,14 +17,13 @@ npm install
```
3. Compile SCSS & Javascript
```
gulp --production
npm run prod
```

### Gulp Tips ###
### Compiling Tips ###
There are 3 default commands you can run:
1. `gulp` - this will simply compile all scripts (without compression)
2. `gulp watch` - this will compile like above but keep watching for changes
3. `gulp --production` OR `gulp watch --production` - this will compile all files with compression and all sorts or other goodies.
2. `npm run watch` - this will compile like above but keep watching for changes.
3. `npm run prod` - this will compile all files with compression and all sorts or other goodies. And exclude and logs.

#### Tests via PHPUnit ####
To run PHPUnit and tests use:
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"plato-creative/plato-userforms-extensions": "dev-master",
"plato-creative/silverstripe-typekit" : "dev-master",
"plato-creative/plato-external-login" : "3.4.*",
"plato-creative/silverstripe-email-obfuscator" : "dev-master",
"kinglozzer/metatitle": "1.0.*",
"unclecheese/betterbuttons": "1.3.*",
"tractorcow/silverstripe-robots": "*@dev",
Expand Down
23 changes: 7 additions & 16 deletions mysite/_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,31 @@
// include configuration set in _ss_environment.php
require_once('conf/ConfigureFromEnv.php');

// Hide assests etc from search
FulltextSearchable::enable(array('SiteTree'));
// Remove extra buttons from editor
HtmlEditorConfig::get('cms')->removeButtons('selectall', 'visualaid', 'strikethrough', 'pasteword', 'cut', 'copy', 'paste');

// DEV
if (Director::isDev()) {
// Turn on all errors
ini_set('display_errors', 1);
ini_set("log_errors", 1);
// error_reporting(E_ERROR | E_PARSE);
// error_reporting(E_ALL && ~E_DEPRECATED);
error_reporting(E_ALL | E_STRICT);

SS_Log::add_writer(new SS_LogFileWriter(dirname(__FILE__).'/errors.log'));

// Use Mailgun to send all emails while in DEV mode
// When in LIVE/TEST mode all emails will be sent via the default Mail class.
Email::set_mailer( new SmtpMailer() );

// SSViewer::flush_template_cache();
// Email::send_all_emails_to('[email protected]');
}

// TEST
if (Director::isTest()) {

// BasicAuth::protect_entire_site();

ini_set('display_errors', 1);
ini_set("log_errors", 1);
error_reporting(E_ALL | E_STRICT);

SS_Log::add_writer(new SS_LogFileWriter(dirname(__FILE__).'/errors.log'));

// Email::set_mailer( new SmtpMailer() );
//Email::send_all_emails_to('[email protected]');

}

// Remove extra buttons from editor
HtmlEditorConfig::get('cms')->removeButtons('selectall', 'visualaid', 'strikethrough', 'pasteword', 'cut', 'copy', 'paste');
// LIVE
// if (Director::isLive()) {}
8 changes: 0 additions & 8 deletions mysite/code/pages/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ public function init()
parent::init();
Requirements::themedCSS('app');
Requirements::themedJavascript('app.min');
Requirements::themedJavascript('manifest');
Requirements::themedJavascript('vendor');
Requirements::block(THIRDPARTY_DIR.'/jquery/jquery.js');
Requirements::block('framework/javascript/i18n.js');
Requirements::block('userforms/thirdparty/jquery-validate/jquery.validate.min.js');
Requirements::block('userforms/javascript/lang/en.js');
Requirements::block('userforms/javascript/lang/en_US.js');
Requirements::block('userforms/javascript/UserForm.js');
Requirements::block('userforms/thirdparty/jquery.are-you-sure/jquery.are-you-sure.js');
Requirements::set_force_js_to_bottom(true);
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"browser-sync": "^2.18.13",
"browser-sync-webpack-plugin": "^1.2.0",
"cross-env": "^3.2.3",
"foundation-sites": "^6.4.0",
"foundation-sites": "6.4.3",
"jquery": "^2.2.3",
"jquery-match-height": "^0.7.2",
"laravel-mix": "1.0.*",
"laravel-mix": "1.4.3",
"webpack": "^3.5.6"
}
}
10 changes: 4 additions & 6 deletions themes/base/javascript/app.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
/**
*
* Load Plugins
* If you don't see a plugin below it might be autloaded via webpack
* Check webpack.mix.js for autoloaded plugins.
*
*/
require('jquery-match-height');

import { Foundation } from './foundation';
Foundation.addToJquery(jQuery);

/**
*
* 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;
Expand All @@ -32,6 +31,5 @@ if (token) {
*
*/
$(function() {
// init Foundation
$(document).foundation();
});
20 changes: 10 additions & 10 deletions themes/base/javascript/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
import { Foundation } from 'foundation-sites/js/foundation.core';

// ### Plugins
import { Dropdown } from 'foundation-sites/js/foundation.dropdown';
import { DropdownMenu } from 'foundation-sites/js/foundation.dropdownMenu';
import { Equalizer } from 'foundation-sites/js/foundation.equalizer';
import { Interchange } from 'foundation-sites/js/foundation.interchange';
import { OffCanvas } from 'foundation-sites/js/foundation.offcanvas';
// import { Abide } from 'foundation-sites/js/foundation.abide';
// import { Accordion } from 'foundation-sites/js/foundation.accordion';
// import { AccordionMenu } from 'foundation-sites/js/foundation.accordionMenu';
// import { Drilldown } from 'foundation-sites/js/foundation.drilldown';
// import { Dropdown } from 'foundation-sites/js/foundation.dropdown';
// import { DropdownMenu } from 'foundation-sites/js/foundation.dropdownMenu';
import { Equalizer } from 'foundation-sites/js/foundation.equalizer';
import { Interchange } from 'foundation-sites/js/foundation.interchange';
// import { Magellan } from 'foundation-sites/js/foundation.magellan';
import { OffCanvas } from 'foundation-sites/js/foundation.offcanvas';
// import { Orbit } from 'foundation-sites/js/foundation.orbit';
// import { ResponsiveMenu } from 'foundation-sites/js/foundation.responsiveMenu';
// import { ResponsiveToggle } from 'foundation-sites/js/foundation.responsiveToggle';
Expand All @@ -26,16 +26,16 @@ import { OffCanvas } from 'foundation-sites/js/foundation.offcanvas';
// import { ResponsiveAccordionTabs } from 'foundation-sites/js/foundation.responsiveAccordionTabs';

// ### Include plugins
Foundation.plugin(Dropdown, 'Dropdown');
Foundation.plugin(DropdownMenu, 'DropdownMenu');
Foundation.plugin(Equalizer, 'Equalizer');
Foundation.plugin(Interchange, 'Interchange');
Foundation.plugin(OffCanvas, 'OffCanvas');
// Foundation.plugin(Abide, 'Abide');
// Foundation.plugin(Accordion, 'Accordion');
// Foundation.plugin(AccordionMenu, 'AccordionMenu');
// Foundation.plugin(Drilldown, 'Drilldown');
// Foundation.plugin(Dropdown, 'Dropdown');
// Foundation.plugin(DropdownMenu, 'DropdownMenu');
Foundation.plugin(Equalizer, 'Equalizer');
Foundation.plugin(Interchange, 'Interchange');
// Foundation.plugin(Magellan, 'Magellan');
Foundation.plugin(OffCanvas, 'OffCanvas');
// Foundation.plugin(Orbit, 'Orbit');
// Foundation.plugin(ResponsiveMenu, 'ResponsiveMenu');
// Foundation.plugin(ResponsiveToggle, 'ResponsiveToggle');
Expand Down
Loading

0 comments on commit ea54db9

Please sign in to comment.