Ghost/ghost/admin/ember-cli-build.js

94 lines
3.6 KiB
JavaScript
Raw Normal View History

/* jscs:disable */
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app'),
environment = EmberApp.env(),
isProduction = environment === 'production',
mythCompress = isProduction || environment === 'test',
disabled = {enabled: false},
assetLocation;
assetLocation = function (fileName) {
if (isProduction) {
fileName = fileName.replace('.', '.min.');
}
return '/assets/' + fileName;
};
module.exports = function (defaults) {
var app = new EmberApp(defaults, {
babel: {
optional: ['es6.spec.symbols'],
includePolyfill: true
},
outputPaths: {
app: {
js: assetLocation('ghost.js')
},
vendor: {
js: assetLocation('vendor.js'),
css: assetLocation('vendor.css')
}
},
mythOptions: {
source: './app/styles/app.css',
inputFile: 'app.css',
browsers: 'last 2 versions',
// @TODO: enable sourcemaps for development without including them in the release
sourcemap: false,
compress: mythCompress,
outputFile: isProduction ? 'ghost.min.css' : 'ghost.css'
},
hinting: false,
fingerprint: disabled,
2016-06-29 11:25:51 +03:00
nodeAssets: {
codemirror: {
import: [
'lib/codemirror.js',
'lib/codemirror.css',
'theme/xq-light.css',
'mode/htmlmixed/htmlmixed.js',
'mode/xml/xml.js',
'mode/css/css.js',
'mode/javascript/javascript.js',
]
},
'jquery-deparam': {
enabled: EmberApp.env() === 'test',
import: ['jquery-deparam.js']
2016-06-29 11:25:51 +03:00
}
},
'ember-cli-selectize': {
theme: false
}
});
// 'dem Scripts
app.import('bower_components/validator-js/validator.js');
app.import('bower_components/rangyinputs/rangyinputs-jquery-src.js');
app.import('bower_components/showdown-ghost/src/showdown.js');
app.import('bower_components/showdown-ghost/src/extensions/ghostgfm.js');
app.import('bower_components/showdown-ghost/src/extensions/ghostimagepreview.js');
app.import('bower_components/showdown-ghost/src/extensions/footnotes.js');
app.import('bower_components/showdown-ghost/src/extensions/highlight.js');
app.import('bower_components/moment/moment.js');
Timezones: Always use the timezone of blog setting closes TryGhost/Ghost#6406 follow-up PR of #2 - adds a `timeZone` Service to provide the offset (=timezone reg. moment-timezone) of the users blog settings - `gh-datetime-input` will read the offset of the timezone now and adjust the `publishedAt` date with it. This is the date which will be shown in the PSM 'Publish Date' field. When the user writes a new date/time, the offset is considered and will be deducted again before saving it to the model. This way, we always work with a UTC publish date except for this input field. - gets `availableTimezones` from `configuration/timezones` API endpoint - adds a `moment-utc` transform on all date attr (`createdAt`, `updatedAt`, `publishedAt`, `unsubscribedAt` and `lastLogin`) to only work with UTC times on serverside - when switching the timezone in the select box, the user will be shown the local time of the selected timezone - `createdAt`-property in `gh-user-invited` returns now `moment(createdAt).fromNow()` as `createdAt` is a moment date already - added clock service to show actual time ticking below select box - default timezone is '(GMT) Greenwich Mean Time : Dublin, Edinburgh, London' - if no timezone is saved in the settings yet, the default value will be used - shows the local time in 'Publish Date' in PSM by default, until user overwrites it - adds dependency `moment-timezone 0.5.4` to `bower.json` --------- **Tests:** - sets except for clock service in test env - adds fixtures to mirage - adds `service.ajax` and `service:ghostPaths` to navigation-test.js - adds unit test for `gh-format-timeago` helper - updates acceptance test `general-setting` - adds acceptance test for `editor` - adds integration tests for `services/config` and `services/time-zone` --------- **Todos:** - [ ] Integration tests: ~~`services/config`~~, ~~`services/time-zone`~~, `components/gh-datetime-input` - [x] Acceptance test: `editor` - [ ] Unit tests: `utils/date-formatting` - [ ] write issue for renaming date properties (e. g. `createdAt` to `createdAtUTC`) and translate those for server side with serializers
2016-02-02 10:04:40 +03:00
app.import('bower_components/moment-timezone/builds/moment-timezone-with-data.js');
app.import('bower_components/keymaster/keymaster.js');
app.import('bower_components/devicejs/lib/device.js');
app.import('bower_components/jquery-ui/jquery-ui.js');
app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js');
app.import('bower_components/blueimp-load-image/js/load-image.all.min.js');
app.import('bower_components/jquery-file-upload/js/jquery.fileupload-process.js');
app.import('bower_components/jquery-file-upload/js/jquery.fileupload-image.js');
app.import('bower_components/google-caja/html-css-sanitizer-bundle.js');
app.import('bower_components/jqueryui-touch-punch/jquery.ui.touch-punch.js');
app.import('bower_components/password-generator/lib/password-generator.js');
app.import('bower_components/blueimp-md5/js/md5.js');
if (app.env === 'test') {
app.import(app.bowerDirectory + '/jquery.simulate.drag-sortable/jquery.simulate.drag-sortable.js', {type: 'test'});
}
return app.toTree();
};