2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

Ember init, bower deps, es6 modules

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

9
core/client/.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
core/client/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