Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature angular material #1649

Merged
merged 13 commits into from
Sep 12, 2016
1 change: 0 additions & 1 deletion .jshintignore

This file was deleted.

92 changes: 0 additions & 92 deletions .jshintrc

This file was deleted.

92 changes: 47 additions & 45 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,52 @@
'use strict';

import 'angular/angular-csp.css';
import 'angular-ui-select/select.min.css';
import 'bootstrap/dist/css/bootstrap.min.css';

import jQuery from 'jquery';
import 'angular';
import 'angular-ui-select/select';
import 'angular-mocks';
import 'angular-cookies';
import 'angular-resource';
import 'angular-sanitize';
import 'angular-ui-router';
import 'angular-jwt';
import 'angular-bootstrap/ui-bootstrap-tpls';

window.$ = jQuery;
'use strict'

import 'angular/angular-csp.css'
import 'angular-ui-select/select.min.css'
import 'angular-material/angular-material.min.css'

import jQuery from 'jquery'
import 'angular'
import 'angular-ui-select/select'
import 'angular-mocks'
import 'angular-cookies'
import 'angular-resource'
import 'angular-sanitize'
import 'angular-ui-router'
import 'angular-jwt'
import 'angular-aria'
import 'angular-animate'
import 'angular-material'

window.$ = jQuery

angular.element(document).ready(function () {
//Fixing facebook bug with redirect
if (window.location.hash === '#_=_') window.location.hash = '#!';

//Then init the app
angular.bootstrap(document, ['mean']);

});

function processModules(modules) {

var packageModules = ['ngCookies', 'ngResource', 'ui.bootstrap', 'ui.router', 'ui.select', 'ngSanitize'], m, mn;
for (var index in modules) {
m = modules[index];
mn = 'mean.' + m.name;
angular.module(mn, m.angularDependencies || []);
packageModules.push(mn);
}

var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/);
req.keys().map(req);
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/);
req.keys().map(req);
angular.module('mean', packageModules);
// Fixing facebook bug with redirect
if (window.location.hash === '#_=_') window.location.hash = '#!'

// Then init the app
angular.bootstrap(document, ['mean'])
})

function processModules (modules) {
var packageModules = ['ngCookies', 'ngResource', 'ui.router', 'ui.select', 'ngSanitize', 'ngMaterial']
var m
var mn
for (var index in modules) {
m = modules[index]
mn = 'mean.' + m.name
angular.module(mn, m.angularDependencies || [])
packageModules.push(mn)
}

var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/)
req.keys().map(req)
req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/)
req.keys().map(req)
angular.module('mean', packageModules)
}

jQuery.ajax('/_getModules', {
dataType: 'json',
async: false,
success: processModules
});
dataType: 'json',
async: false,
success: processModules
})
18 changes: 9 additions & 9 deletions config/env/default.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
'use strict'

var path = require('path'),
rootPath = path.normalize(__dirname + '/../..');
var path = require('path')
var rootPath = path.join(__dirname, '/../..')

module.exports = {
root: rootPath,
Expand Down Expand Up @@ -45,20 +45,20 @@ module.exports = {
public: {
languages: [{
locale: 'en',
direction: 'ltr',
direction: 'ltr'
}, {
locale: 'he',
direction: 'rtl',
direction: 'rtl'
}],
currentLanguage: 'en',
loginPage: '/auth/login',
cssFramework: 'bootstrap'
},
clusterSticky: false,
stickyOptions: {
proxy: false, //activate layer 4 patching
header: 'x-forwarded-for', //provide here your header containing the users ip
num: (process.env.CPU_COUNT || require('os').cpus().length) - 1,
proxy: false, // activate layer 4 patching
header: 'x-forwarded-for', // provide here your header containing the users ip
num: (process.env.CPU_COUNT || require('os').cpus().length) - 1
},
// The session cookie name
sessionName: 'connect.sid',
Expand All @@ -67,4 +67,4 @@ module.exports = {
json: {limit: '100kb'},
urlencoded: {limit: '100kb', extended: true}
}
};
}
6 changes: 3 additions & 3 deletions config/env/development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict'

module.exports = {
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-dev',
Expand Down Expand Up @@ -58,6 +58,6 @@ module.exports = {
user: 'EMAIL_ID',
pass: 'PASSWORD'
}
},
},
secret: 'SOME_TOKEN_SECRET'
};
}
4 changes: 2 additions & 2 deletions config/env/production.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict'

module.exports = {
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-prod',
Expand Down Expand Up @@ -78,4 +78,4 @@ module.exports = {
}
},
secret: 'SOME_TOKEN_SECRET'
};
}
4 changes: 2 additions & 2 deletions config/env/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
'use strict'

module.exports = {
db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-test',
Expand Down Expand Up @@ -60,4 +60,4 @@ module.exports = {
}
},
secret: 'SOME_TOKEN_SECRET'
};
}
73 changes: 35 additions & 38 deletions config/express.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,68 @@
/* globals require */
'use strict';
'use strict'

/**
* Module dependencies.
*/
var mean = require('meanio'),
compression = require('compression'),
consolidate = require('consolidate'),
express = require('express'),
helpers = require('view-helpers'),
flash = require('connect-flash'),
modRewrite = require('connect-modrewrite'),
// seo = require('mean-seo'),
config = mean.getConfig(),
bodyParser = require('body-parser'),
helmet = require('helmet');


module.exports = function(app, db) {

app.use(bodyParser.json(config.bodyParser.json));
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded));

app.use(helmet());

app.set('showStackError', true);
var mean = require('meanio')
var compression = require('compression')
var consolidate = require('consolidate')
var express = require('express')
var helpers = require('view-helpers')
var flash = require('connect-flash')
var modRewrite = require('connect-modrewrite')
// seo = require('mean-seo'),
var config = mean.getConfig()
var bodyParser = require('body-parser')
var helmet = require('helmet')

module.exports = function (app, db) {
app.use(bodyParser.json(config.bodyParser.json))
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded))

app.use(helmet())

app.set('showStackError', true)

// Prettify HTML
app.locals.pretty = true;
app.locals.pretty = true

// cache=memory or swig dies in NODE_ENV=production
app.locals.cache = 'memory';
app.locals.cache = 'memory'

// Should be placed before express.static
// To ensure that all assets and data are compressed (utilize bandwidth)
app.use(compression({
// Levels are specified in a range of 0 to 9, where-as 0 is
// no compression and 9 is best compression, but slowest
level: 9
}));
}))

// Enable compression on bower_components
app.use('/bower_components', express.static(config.root + '/bower_components'));
app.use('/bower_components', express.static(config.root + '/bower_components'))

app.use('/bundle', express.static(config.root + '/bundle'));
app.use('/bundle', express.static(config.root + '/bundle'))

// Adds logging based on logging config in config/env/ entry
require('./middlewares/logging')(app, config.logging);
require('./middlewares/logging')(app, config.logging)

// assign the template engine to .html files
app.engine('html', consolidate[config.templateEngine]);
app.engine('html', consolidate[config.templateEngine])

// set .html as the default extension
app.set('view engine', 'html');

app.set('view engine', 'html')

// Dynamic helpers
app.use(helpers(config.app.name));
app.use(helpers(config.app.name))

// Connect flash for flash messages
app.use(flash());
app.use(flash())

app.use(modRewrite([

'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]'

]));
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]'

]))

// app.use(seo());
};
// app.use(seo())
}
Loading