Ember init, bower deps, es6 modules

This commit is contained in:
Matt Enlow 2015-02-12 21:22:32 -07:00
parent 589a563b30
commit 6d80907c99
165 changed files with 516 additions and 43 deletions

9
ghost/admin/.ember-cli Normal file
View File

@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}

View File

@ -1,33 +1,38 @@
{
"node": false,
"browser": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"forin": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"plusplus": true,
"regexp": true,
"undef": true,
"unused": true,
"indent": 4,
"esnext": true,
"quotmark": "single",
"globals": {
"Ember": true,
"Em": true,
"DS": true,
"$": true,
"SimpleAuth": true,
"validator": true,
"ic": true,
"NProgress": true,
"moment": true
},
"predef": ["-Notification"]
"predef": [
"document",
"window",
"-Promise",
"$",
"validator",
"ic",
"SimpleAuth",
"NProgress",
"moment"
],
"browser": true,
"boss": true,
"curly": true,
"debug": false,
"devel": true,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": false,
"eqnull": true,
"esnext": true,
"unused": true
}

38
ghost/admin/Brocfile.js Normal file
View File

@ -0,0 +1,38 @@
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp(
{
sourcemaps: {enabled: false} //see https://github.com/ember-cli/ember-cli/issues/2912
}
);
app.import('bower_components/loader.js/loader.js');
app.import('bower_components/jquery/dist/jquery.js');
app.import('bower_components/ic-ajax/dist/globals/main.js');
app.import('bower_components/ember-load-initializers/ember-load-initializers.js');
app.import('bower_components/validator-js/validator.js');
app.import('bower_components/codemirror/lib/codemirror.js');
app.import('bower_components/codemirror/addon/mode/overlay.js');
app.import('bower_components/codemirror/mode/markdown/markdown.js');
app.import('bower_components/codemirror/mode/gfm/gfm.js');
app.import('bower_components/showdown-ghost/src/showdown.js');
app.import('bower_components/moment/moment.js');
app.import('bower_components/keymaster/keymaster.js');
app.import('bower_components/device/lib/device.js');
app.import('bower_components/jquery-ui/ui/jquery-ui.js');
app.import('bower_components/jquery-file-upload/js/jquery.fileupload.js');
app.import('bower_components/fastclick/lib/fastclick.js');
app.import('bower_components/nprogress/nprogress.js');
app.import('bower_components/ember-simple-auth/simple-auth.js');
app.import('bower_components/ember-simple-auth/simple-auth-oauth2.js');
app.import('bower_components/google-caja/html-css-sanitizer-bundle.js');
app.import('bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js');
app.import('vendor/showdown/extensions/ghostgfm.js');
app.import('vendor/showdown/extensions/ghostimagepreview.js');
app.import('vendor/showdown/extensions/ghostfootnotes.js');
app.import('vendor/showdown/extensions/ghosthighlight.js');
module.exports = app.toTree();

View File

@ -1,3 +1,4 @@
import DS from 'ember-data';
import ghostPaths from 'ghost/utils/ghost-paths';
var BaseAdapter = DS.RESTAdapter.extend({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import BaseAdapter from 'ghost/adapters/base';
// EmbeddedRelationAdapter will augment the query object in calls made to

View File

@ -1,19 +1,20 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import 'ghost/utils/link-view';
import 'ghost/utils/text-field';
import configureApp from 'ghost/config';
import config from './config/environment';
Ember.MODEL_FACTORY_INJECTIONS = true;
var App = Ember.Application.extend({
modulePrefix: 'ghost',
Resolver: Resolver.default
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver: Resolver
});
// Runtime configuration of Ember.Application
configureApp(App);
loadInitializers(App, 'ghost');
loadInitializers(App, config.modulePrefix);
export default App;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var ActivatingListItem = Ember.Component.extend({
tagName: 'li',
classNameBindings: ['active'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*global CodeMirror */
import MarkerManager from 'ghost/mixins/marker-manager';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import DropdownMixin from 'ghost/mixins/dropdown-mixin';
var DropdownButton = Ember.Component.extend(DropdownMixin, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import DropdownMixin from 'ghost/mixins/dropdown-mixin';
var GhostDropdown = Ember.Component.extend(DropdownMixin, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var FileUpload = Ember.Component.extend({
_file: null,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var Form = Ember.View.extend({
tagName: 'form',
attributeBindings: ['enctype'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import TextInputMixin from 'ghost/mixins/text-input';
var Input = Ember.TextField.extend(TextInputMixin);

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import uploader from 'ghost/assets/lib/uploader';
var Markdown = Ember.Component.extend({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var ModalDialog = Ember.Component.extend({
didInsertElement: function () {
this.$('.js-modal-container, .js-modal-background').addClass('fade-in open');

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
function joinUrlParts(url, path) {
if (path[0] !== '/' && url.slice(-1) !== '/') {
path = '/' + path;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var NavItemComponent = Ember.Component.extend({
classNames: 'navigation-item',

View File

@ -1,3 +1,5 @@
import Ember from 'ember';
var NotificationComponent = Ember.Component.extend({
classNames: ['js-bb-notification'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var NotificationsComponent = Ember.Component.extend({
tagName: 'aside',
classNames: 'notifications',

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import DropdownButton from 'ghost/components/gh-dropdown-button';
var PopoverButton = DropdownButton.extend({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import GhostSelect from 'ghost/components/gh-select';
var RolesSelector = GhostSelect.extend({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// GhostSelect is a solution to Ember.Select being evil and worthless.
// (Namely, this solves problems with async data in Ember.Select)
// Inspired by (that is, totally ripped off from) this JSBin

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// See gh-tabs-manager.js for use
var TabPane = Ember.Component.extend({
classNameBindings: ['active'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// See gh-tabs-manager.js for use
var Tab = Ember.Component.extend({
tabsManager: Ember.computed(function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/**
Heavily inspired by ic-tabs (https://github.com/instructure/ic-tabs)

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import TextInputMixin from 'ghost/mixins/text-input';
var TextArea = Ember.TextArea.extend(TextInputMixin);

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*global device*/
var TrimFocusInput = Ember.TextField.extend({
focus: true,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import uploader from 'ghost/assets/lib/uploader';
var PostImageUploader = Ember.Component.extend({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*
Example usage:
{{gh-url-preview prefix="tag" slug=theSlugValue tagName="p" classNames="description"}}

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
function configureApp(App) {
if (!App instanceof Ember.Application) {
return;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
function configureApp(App) {
if (!App instanceof Ember.Application) {
return;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var ApplicationController = Ember.Controller.extend({
// jscs: disable
hideNav: Ember.computed.match('currentPath', /(error|signin|signup|setup|forgotten|reset)/),

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorEditController = Ember.Controller.extend(EditorControllerMixin);

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import EditorControllerMixin from 'ghost/mixins/editor-base-controller';
var EditorNewController = Ember.Controller.extend(EditorControllerMixin, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var ErrorController = Ember.Controller.extend({
code: Ember.computed('content.status', function () {
return this.get('content.status') > 200 ? this.get('content.status') : 500;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var FeatureController = Ember.Controller.extend(Ember.PromiseProxyMixin, {
init: function () {
var promise;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var CopyHTMLController = Ember.Controller.extend({
generatedHTML: Ember.computed.alias('model.generatedHTML')

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var DeleteAllController = Ember.Controller.extend({
actions: {
confirmAccept: function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var DeletePostController = Ember.Controller.extend({
actions: {
confirmAccept: function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var DeleteTagController = Ember.Controller.extend({
postInflection: Ember.computed('model.post_count', function () {
return this.get('model.post_count') > 1 ? 'posts' : 'post';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var DeleteUserController = Ember.Controller.extend({
userPostCount: Ember.computed('model.id', function () {
var promise,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var InviteNewUserController = Ember.Controller.extend({
// Used to set the initial value for the dropdown
authorRole: Ember.computed(function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var LeaveEditorController = Ember.Controller.extend({
args: Ember.computed.alias('model'),

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ValidationEngine from 'ghost/mixins/validation-engine';
export default Ember.Controller.extend(SimpleAuth.AuthenticationControllerMixin, ValidationEngine, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var TransferOwnerController = Ember.Controller.extend({
actions: {
confirmAccept: function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var UploadController = Ember.Controller.extend({
acceptEncoding: 'image/*',

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/* global moment */
import {parseDateString, formatDate} from 'ghost/utils/date-formatting';
import SettingsMenuMixin from 'ghost/mixins/settings-menu-controller';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var PostTagsInputController = Ember.Controller.extend({
tagEnteredOrder: Ember.A(),

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import PaginationControllerMixin from 'ghost/mixins/pagination-controller';
function publishedAtCompare(item1, item2) {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var PostController = Ember.Controller.extend({
isPublished: Ember.computed.equal('model.status', 'published'),
classNameBindings: ['model.featured'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var SettingsController = Ember.Controller.extend({
needs: ['feature'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*global alert */
var appStates,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var SettingsCodeInjectionController = Ember.Controller.extend({
actions: {
save: function () {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var SettingsGeneralController = Ember.Controller.extend({
selectedTheme: null,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var LabsController = Ember.Controller.extend(Ember.Evented, {
needs: ['feature'],

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var NavigationController,
NavItem;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import PaginationMixin from 'ghost/mixins/pagination-controller';
import SettingsMenuMixin from 'ghost/mixins/settings-menu-controller';
import boundOneWay from 'ghost/utils/bound-one-way';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import PaginationControllerMixin from 'ghost/mixins/pagination-controller';
var UsersIndexController = Ember.ArrayController.extend(PaginationControllerMixin, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import SlugGenerator from 'ghost/models/slug-generator';
import isNumber from 'ghost/utils/isNumber';
import boundOneWay from 'ghost/utils/bound-one-way';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ValidationEngine from 'ghost/mixins/validation-engine';
var SigninController = Ember.Controller.extend(SimpleAuth.AuthenticationControllerMixin, ValidationEngine, {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ajax from 'ghost/utils/ajax';
import ValidationEngine from 'ghost/mixins/validation-engine';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var blogUrl = Ember.HTMLBars.makeBoundHelper(function () {
return Ember.String.htmlSafe(this.get('config.blogUrl'));
});

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var countCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
var el = document.createElement('span'),
length,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var countDownCharacters = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
var el = document.createElement('span'),
content,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import counter from 'ghost/utils/word-count';
var countWords = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/* global html_sanitize*/
import cajaSanitizers from 'ghost/utils/caja-sanitizers';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/* global Showdown, html_sanitize*/
import cajaSanitizers from 'ghost/utils/caja-sanitizers';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var formatTimeago = Ember.HTMLBars.makeBoundHelper(function (arr /* hashParams */) {
if (!arr || !arr.length) {
return;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// Handlebars Helper {{gh-path}}
// Usage: Assume 'http://www.myghostblog.org/myblog/'
// {{gh-path}} or {{gh-path blog}} for Ghosts root (/myblog/)

View File

@ -7,6 +7,8 @@
<title>Ghost Admin</title>
{{content-for 'head'}}
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
@ -36,11 +38,19 @@
{{#unless skip_google_fonts}}
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700" />
{{/unless}}
<link rel="stylesheet" href="{{asset "css/ghost.min.css" ghost="true"}}" />
<link rel="stylesheet" href="{{asset "css/vendor.css" ghost="true"}}" />
<link rel="stylesheet" href="{{asset "css/ghost.css" ghost="true"}}" />
{{content-for 'head-footer'}}
</head>
<body>
{{content-for 'body'}}
{{{ghost_script_tags}}}
<script src="assets/vendor.js"></script>
<script src="assets/ghost.js"></script>
{{content-for 'body-footer'}}
</body>
</html>

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ghostPaths from 'ghost/utils/ghost-paths';
var Ghost,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*global Ember */
var trailingHistory,

View File

@ -1,6 +0,0 @@
// Loader to create the Ember.js application
/*global require */
if (!window.disableBoot) {
window.App = require('ghost/app').default.create();
}

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// Code modified from Addepar/ember-widgets
// https://github.com/Addepar/ember-widgets/blob/master/src/mixins.coffee#L39

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var CurrentUserSettings = Ember.Mixin.create({
currentUser: function () {
return this.store.find('user', 'me');

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/*
Dropdowns and their buttons are evented and do not propagate clicks.
*/

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/* global console */
import MarkerManager from 'ghost/mixins/marker-manager';
import PostModel from 'ghost/models/post';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import ShortcutsRoute from 'ghost/mixins/shortcuts-route';
import styleBody from 'ghost/mixins/style-body';
import loadingIndicator from 'ghost/mixins/loading-indicator';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import setScrollClassName from 'ghost/utils/set-scroll-classname';
var EditorViewMixin = Ember.Mixin.create({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// mixin used for routes to display a loading indicator when there is network activity
var loaderOptions,
loadingIndicator;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var MarkerManager = Ember.Mixin.create({
imageMarkdownRegex: /^(?:\{<(.*?)>\})?!(?:\[([^\n\]]*)\])(?:\(([^\n\]]*)\))?$/gim,
markerRegex: /\{<([\w\W]*?)>\}/,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var NProgressSaveMixin = Ember.Mixin.create({
save: function (options) {
if (options && options.disableNProgress) {

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
import { getRequestErrorMessage } from 'ghost/utils/ajax';
var PaginationControllerMixin = Ember.Mixin.create({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var defaultPaginationSettings,
PaginationRoute;

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({
/**

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// SelectiveSaveMixin adds a saveOnly method to a DS.Model.
//
// saveOnly provides a way to save one or more properties of a model while

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var SettingsMenuControllerMixin = Ember.Mixin.create({
needs: 'application',

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
/* global key */
// Configure KeyMaster to respond to all shortcuts,

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
// mixin used for routes that need to set a css className on the body tag
var styleBody = Ember.Mixin.create({

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var BlurField = Ember.Mixin.create({
selectOnClick: false,
stopEnterKeyDownPropagation: false,

View File

@ -1,3 +1,5 @@
import Ember from 'ember';
import DS from 'ember-data';
import {getRequestErrorMessage} from 'ghost/utils/ajax';
import ValidatorExtensions from 'ghost/utils/validator-extensions';

View File

@ -1,3 +1,4 @@
import DS from 'ember-data';
var Notification = DS.Model.extend({
dismissible: DS.attr('boolean'),
location: DS.attr('string'),

View File

@ -1,3 +1,5 @@
import Ember from 'ember';
import DS from 'ember-data';
import ValidationEngine from 'ghost/mixins/validation-engine';
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';

View File

@ -1,3 +1,5 @@
import Ember from 'ember';
import DS from 'ember-data';
var Role = DS.Model.extend({
uuid: DS.attr('string'),
name: DS.attr('string'),

View File

@ -1,3 +1,4 @@
import DS from 'ember-data';
import ValidationEngine from 'ghost/mixins/validation-engine';
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';

View File

@ -1,3 +1,4 @@
import Ember from 'ember';
var SlugGenerator = Ember.Object.extend({
ghostPaths: null,
slugType: null,

View File

@ -1,3 +1,4 @@
import DS from 'ember-data';
import ValidationEngine from 'ghost/mixins/validation-engine';
import NProgressSaveMixin from 'ghost/mixins/nprogress-save';

Some files were not shown because too many files have changed in this diff Show More