Skip to content

Commit

Permalink
合并官方更新升级到 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
trheyi committed May 15, 2015
2 parents ecfa89a + 42013ee commit 53b6810
Show file tree
Hide file tree
Showing 151 changed files with 2,481 additions and 1,339 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# http://editorconfig.org

root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.hbs]
insert_final_newline = false

[{package,bower}.json]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ Session.vim
# Changelog, which is autogenerated, not committed
CHANGELOG.md

# Casper generated files
# Test generated files
/core/test/functional/*.png
/core/test/coverage

config.js
/core/client/config.js
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ SECURITY.md
*.html
!core/server/email-templates/**
bower_components/**
.editorconfig
10 changes: 8 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
So you're interested in giving us a hand? That's awesome! We've put together some guidelines that should help
you get started quickly and easily. If you need help with contributing, visit the #ghost IRC channel on freenode. Thank you for stopping by!

**Quick Links:** [feature roadmap](https://github.com/TryGhost/Ghost/wiki/Roadmap) - [support forum](https://ghost.org/forum) - [documentation](http://support.ghost.org) - [developer wiki](https://github.com/TryGhost/Ghost/wiki) - [community guidelines](https://ghost.org/about/guidelines/) - [dev blog](http://dev.ghost.org)
**Quick Links:**
- [feature roadmap](https://github.com/TryGhost/Ghost/wiki/Roadmap)
- [support forum](https://ghost.org/forum)
- [documentation](http://support.ghost.org)
- [developer wiki](https://github.com/TryGhost/Ghost/wiki)
- [community guidelines](https://ghost.org/about/guidelines/)
- [dev blog](http://dev.ghost.org)


### TL;DR
Expand Down Expand Up @@ -59,7 +65,7 @@ Guidelines for bug reports:
latest `master` or look for [closed issues in the current milestone](https://github.com/TryGhost/Ghost/issues?labels=&milestone=3&page=1&state=closed).

3. **Isolate the problem** — ideally create a [reduced test
case](http://css-tricks.com/6263-reduced-test-cases/) and a live example.
case](https://css-tricks.com/reduced-test-cases/) and a live example.

4. **Include a screencast if relevant** - Is your issue about a design or front end feature or bug? The most
helpful thing in the world is if we can *see* what you're talking about.
Expand Down
51 changes: 32 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ var _ = require('lodash'),
'core/server/**/*.js',
'core/shared/**/*.js',
'core/test/**/*.js',
'!core/test/coverage/**',
'!core/shared/vendor/**/*.js'
]
},
Expand Down Expand Up @@ -166,6 +167,7 @@ var _ = require('lodash'),
'core/server/**/*.js',
'core/shared/**/*.js',
'core/test/**/*.js',
'!core/test/coverage/**',
'!core/shared/vendor/**/*.js'
]
}
Expand Down Expand Up @@ -240,18 +242,35 @@ var _ = require('lodash'),
// #### All Route tests
routes: {
src: [
'core/test/functional/routes/**/*_test.js'
'core/test/functional/routes/**/*_spec.js'
]
},

// #### All Module tests
module: {
src: [
'core/test/functional/module/**/*_test.js'
'core/test/functional/module/**/*_spec.js'
]
}
},

// ### grunt-mocha-istanbul
// Configuration for the mocha test coverage generator
// `grunt coverage`.
mocha_istanbul: {
coverage: {
// TODO fix the timing/async & cleanup issues with the route and integration tests so that
// they can also have coverage generated for them & the order doesn't matter
src: ['core/test/integration', 'core/test/unit'],
options: {
mask: '**/*_spec.js',
coverageFolder: 'core/test/coverage',
mochaOptions: ['--timeout=15000'],
excludes: ['core/client/**']
}
}
},

// ### grunt-bg-shell
// Used to run ember-cli watch in the background
bgShell: {
Expand Down Expand Up @@ -312,13 +331,6 @@ var _ = require('lodash'),
}
},

// #### Generate coverage report
// See the `grunt test-coverage` task in the section on [Testing](#testing) for more information.
coverage: {
command: 'node ' + mochaPath + ' --timeout 15000 --reporter html-cov > coverage.html ' +
path.resolve(cwd + '/core/test/blanket_coverage.js')
},

shrinkwrap: {
command: 'npm shrinkwrap'
}
Expand All @@ -333,8 +345,8 @@ var _ = require('lodash'),
src: ['.' ],
options: {
onlyUpdated: true,
exclude: 'node_modules,.git,.tmp,bower_components,content,*built,*doc*,*vendor,*client,Gruntfile.js,' +
'config.js,coverage.html,.travis.yml,*.min.css,screen.css',
exclude: 'node_modules,.git,.tmp,bower_components,content,*built,*test,*doc*,*vendor,' +
'config.js,.travis.yml,*.min.css,screen.css',
extras: ['fileSearch']
}
}
Expand Down Expand Up @@ -494,7 +506,7 @@ var _ = require('lodash'),
// * [Building assets](#building%20assets):
// `grunt init`, `grunt` & `grunt prod` or live reload with `grunt dev`
// * [Testing](#testing):
// `grunt validate`, the `grunt test-*` sub-tasks or generate a coverage report with `grunt test-coverage`.
// `grunt validate`, the `grunt test-*` sub-tasks or generate a coverage report with `grunt coverage`.

// ### Help
// Run `grunt help` on the commandline to get a print out of the available tasks and details of
Expand Down Expand Up @@ -579,7 +591,7 @@ var _ = require('lodash'),
//
// `grunt validate` is called by `npm test` and is used by Travis.
grunt.registerTask('validate', 'Run tests and lint code',
['init', 'test-all']);
['init', 'lint', 'test-all']);

// ### Test-All
// **Main testing task**
Expand All @@ -590,7 +602,7 @@ var _ = require('lodash'),
// details of each of the test suites.
//
grunt.registerTask('test-all', 'Run tests and lint code',
['lint', 'test-routes', 'test-module', 'test-unit', 'test-integration', 'shell:ember:test', 'test-functional']);
['test-routes', 'test-module', 'test-unit', 'test-integration', 'shell:ember:test', 'test-functional']);

// ### Lint
//
Expand Down Expand Up @@ -662,7 +674,7 @@ var _ = require('lodash'),
// If you need to run an individual route test file, you can do so, providing you have a `config.js` file and
// mocha installed globally by using a command in the form:
//
// `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/functional/routes/admin_test.js`
// `NODE_ENV=testing mocha --timeout=15000 --ui=bdd --reporter=spec core/test/functional/routes/admin_spec.js`
//
// Route tests are run with [mocha](http://mochajs.org/) using
// [should](https://github.com/visionmedia/should.js) and [supertest](https://github.com/visionmedia/supertest)
Expand Down Expand Up @@ -725,16 +737,17 @@ var _ = require('lodash'),
);

// ### Coverage
// `grunt test-coverage` will generate a report for the Unit and Integration Tests.
// `grunt coverage` will generate a report for the Unit Tests.
//
// This is not currently done as part of CI or any build, but is a tool we have available to keep an eye on how
// well the unit and integration tests are covering the code base.
// Ghost does not have a minimum coverage level - we're more interested in ensuring important and useful areas
// of the codebase are covered, than that the whole codebase is covered to a particular level.
//
// Key areas for coverage are: helpers and theme elements, apps / GDK, the api and model layers.
grunt.registerTask('test-coverage', 'Generate unit and integration (mocha) tests coverage report',
['test-setup', 'shell:coverage']

grunt.registerTask('coverage', 'Generate unit and integration (mocha) tests coverage report',
['test-setup', 'mocha_istanbul:coverage']
);

// #### Master Warning *(Utility Task)*
Expand Down Expand Up @@ -910,7 +923,7 @@ var _ = require('lodash'),
' - Copy files to release-folder/#/#{version} directory\n' +
' - Clean out unnecessary files (travis, .git*, etc)\n' +
' - Zip files in release-folder to dist-folder/#{version} directory',
['init', 'shell:ember:prod', 'uglify:release', 'clean:release', 'copy:release', 'shell:shrinkwrap', 'compress:release']);
['init', 'shell:ember:prod', 'uglify:release', 'clean:release', 'shell:shrinkwrap', 'copy:release', 'compress:release']);
};

// Export the configuration
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Ghost中文版由云应用托管服务商 [点云](http://www.diancloud.com) 主


## 参与改进
( 中文版计划, 如何参与改进等 待完善 )
( 中文版计划, 如何参与改进等 待完善 )
2 changes: 1 addition & 1 deletion content/themes/casper
Submodule casper updated 2 files
+33 −16 assets/css/screen.css
+1 −1 package.json
6 changes: 4 additions & 2 deletions core/client/Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ app = new EmberApp({
outputPaths: {
app: {
js: assetLocation('ghost.js')
// css: see config/environment.js (sassOptions)
// css: see config/environment.js (sassOptions)
},
vendor: {
js: assetLocation('vendor.js'),
Expand All @@ -42,7 +42,7 @@ 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');
app.import('bower_components/keymaster/keymaster.js');
app.import('bower_components/device/lib/device.js');
app.import('bower_components/devicejs/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');
Expand All @@ -59,5 +59,7 @@ app.import('bower_components/codemirror/mode/htmlmixed/htmlmixed.js');
app.import('bower_components/codemirror/mode/xml/xml.js');
app.import('bower_components/codemirror/mode/css/css.js');
app.import('bower_components/codemirror/mode/javascript/javascript.js');
app.import('bower_components/xregexp/xregexp-all.js');
app.import('bower_components/password-generator/lib/password-generator.js');

module.exports = app.toTree();
6 changes: 3 additions & 3 deletions core/client/app/assets/lib/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ UploadUi = function ($dropzone, settings) {
if (!$dropzone.find('a.image-url')[0]) {
$dropzone.append('<a class="image-url" title="Add image from URL"><span class="hidden">URL</span></a>');
}
// if (!$dropzone.find('a.image-webcam')[0]) {
// $dropzone.append('<a class="image-webcam" title="Add image from webcam"><span class="hidden">Webcam</span></a>');
// }
// if (!$dropzone.find('a.image-webcam')[0]) {
// $dropzone.append('<a class="image-webcam" title="Add image from webcam"><span class="hidden">Webcam</span></a>');
// }
},

removeExtras: function () {
Expand Down
7 changes: 7 additions & 0 deletions core/client/app/components/gh-blog-url.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Ember from 'ember';

var blogUrl = Ember.Component.extend({
tagName: ''
});

export default blogUrl;
5 changes: 5 additions & 0 deletions core/client/app/controllers/settings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import Ember from 'ember';
var SettingsController = Ember.Controller.extend({

needs: ['feature'],

showGeneral: Ember.computed('session.user.name', function () {
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') ? false : true;
}),
Expand All @@ -21,6 +23,9 @@ var SettingsController = Ember.Controller.extend({
}),
showAbout: Ember.computed('session.user.name', function () {
return this.get('session.user.isAuthor') ? false : true;
}),
showPassProtection: Ember.computed('session.user.name', 'controllers.feature.passProtectUI', function () {
return this.get('session.user.isAuthor') || this.get('session.user.isEditor') || !this.get('controllers.feature.passProtectUI') ? false : true;
})
});

Expand Down
12 changes: 12 additions & 0 deletions core/client/app/controllers/settings/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Ember from 'ember';
var SettingsAboutController = Ember.Controller.extend({
updateNotificationCount: 0,

actions: {
updateNotificationChange: function (count) {
this.set('updateNotificationCount', count);
}
}
});

export default SettingsAboutController;
8 changes: 8 additions & 0 deletions core/client/app/controllers/settings/general.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import Ember from 'ember';
import randomPassword from 'ghost/utils/random-password';

var SettingsGeneralController = Ember.Controller.extend({
selectedTheme: null,

Expand Down Expand Up @@ -37,6 +39,12 @@ var SettingsGeneralController = Ember.Controller.extend({
}, []);
}).readOnly(),

generatePassword: Ember.observer('model.isPrivate', function () {
if (this.get('model.isPrivate') && this.get('model.isDirty')) {
this.get('model').set('password', randomPassword());
}
}),

actions: {
save: function () {
var self = this;
Expand Down
6 changes: 0 additions & 6 deletions core/client/app/helpers/gh-blog-url.js

This file was deleted.

6 changes: 3 additions & 3 deletions core/client/app/helpers/gh-path.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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/)
// {{gh-path admin}} for Ghosts admin root (/myblog/ghost/)
// {{gh-path api}} for Ghosts api root (/myblog/ghost/api/v0.1/)
// {{gh-path}} or {{gh-path 'blog'}} for Ghost's root (/myblog/)
// {{gh-path 'admin'}} for Ghost's admin root (/myblog/ghost/)
// {{gh-path 'api'}} for Ghost's api root (/myblog/ghost/api/v0.1/)
// {{gh-path 'admin' '/assets/hi.png'}} for resolved url (/myblog/ghost/assets/hi.png)
import ghostPaths from 'ghost/utils/ghost-paths';

Expand Down
4 changes: 0 additions & 4 deletions core/client/app/mixins/current-user-settings.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Ember from 'ember';
var CurrentUserSettings = Ember.Mixin.create({
currentUser: function () {
return this.store.find('user', 'me');
},

transitionAuthor: function () {
var self = this;

Expand Down
Loading

0 comments on commit 53b6810

Please sign in to comment.