mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
commit
14b1d0c01f
16 changed files with 49584 additions and 7 deletions
3
.bowerrc
Normal file
3
.bowerrc
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"directory": "core/shared/vendor"
|
||||||
|
}
|
38
Gruntfile.js
38
Gruntfile.js
|
@ -54,6 +54,10 @@ var path = require('path'),
|
||||||
files: ['core/clientold/tpl/**/*.hbs'],
|
files: ['core/clientold/tpl/**/*.hbs'],
|
||||||
tasks: ['handlebars']
|
tasks: ['handlebars']
|
||||||
},
|
},
|
||||||
|
emberTemplates: {
|
||||||
|
files: 'core/client/templates/**/*.hbs',
|
||||||
|
tasks: ['emberTemplates']
|
||||||
|
},
|
||||||
sass: {
|
sass: {
|
||||||
files: ['<%= paths.adminOldAssets %>/sass/**/*'],
|
files: ['<%= paths.adminOldAssets %>/sass/**/*'],
|
||||||
tasks: ['sass:admin']
|
tasks: ['sass:admin']
|
||||||
|
@ -68,6 +72,12 @@ var path = require('path'),
|
||||||
],
|
],
|
||||||
tasks: ['concat']
|
tasks: ['concat']
|
||||||
},
|
},
|
||||||
|
'concat-ember': {
|
||||||
|
files: [
|
||||||
|
'core/client/**/*.js'
|
||||||
|
],
|
||||||
|
tasks: ['concat:dev-ember']
|
||||||
|
},
|
||||||
livereload: {
|
livereload: {
|
||||||
files: [
|
files: [
|
||||||
// Theme CSS
|
// Theme CSS
|
||||||
|
@ -298,6 +308,19 @@ var path = require('path'),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ### Config for grunt-ember-templates
|
||||||
|
// Compiles handlebar templates for ember
|
||||||
|
emberTemplates: {
|
||||||
|
compile: {
|
||||||
|
options: {
|
||||||
|
templateBasePath: /core\/client\/templates/
|
||||||
|
},
|
||||||
|
files: {
|
||||||
|
"core/built/scripts/templates-ember.js": "core/client/templates/**/*.hbs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// ### Config for grunt-groc
|
// ### Config for grunt-groc
|
||||||
// Generate documentation from code
|
// Generate documentation from code
|
||||||
groc: {
|
groc: {
|
||||||
|
@ -415,6 +438,19 @@ var path = require('path'),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
'dev-ember': {
|
||||||
|
files: {
|
||||||
|
'core/built/scripts/vendor-ember.js': [
|
||||||
|
'core/shared/vendor/jquery/jquery.js',
|
||||||
|
'core/shared/vendor/handlebars/handlebars.js',
|
||||||
|
'core/shared/vendor/ember/ember.js'
|
||||||
|
],
|
||||||
|
|
||||||
|
'core/built/scripts/ghost-dev-ember.js': [
|
||||||
|
'core/client/**/*.js'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
prod: {
|
prod: {
|
||||||
files: {
|
files: {
|
||||||
'core/built/scripts/ghost.js': [
|
'core/built/scripts/ghost.js': [
|
||||||
|
@ -840,7 +876,7 @@ var path = require('path'),
|
||||||
grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify']);
|
grunt.registerTask('prod', 'Build CSS, JS & templates for production', ['sass:compress', 'handlebars', 'concat', 'uglify']);
|
||||||
|
|
||||||
// When you just say 'grunt'
|
// When you just say 'grunt'
|
||||||
grunt.registerTask('default', 'Build CSS, JS & templates for development', ['update_submodules', 'sass:compress', 'handlebars', 'concat']);
|
grunt.registerTask('default', 'Build CSS, JS & templates for development', ['update_submodules', 'sass:compress', 'handlebars', 'emberTemplates:compile', 'concat']);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = configureGrunt;
|
module.exports = configureGrunt;
|
||||||
|
|
7
bower.json
Normal file
7
bower.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"name": "ghost",
|
||||||
|
"dependencies": {
|
||||||
|
"handlebars": "~1.1.2",
|
||||||
|
"ember": "~1.4.0"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
#Ember goes here
|
|
14
core/client/app.js
Executable file
14
core/client/app.js
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
/*global Ember */
|
||||||
|
|
||||||
|
var App = Ember.Application.create({
|
||||||
|
/**
|
||||||
|
* These are debugging flags, they are useful during development
|
||||||
|
*/
|
||||||
|
LOG_ACTIVE_GENERATION: true,
|
||||||
|
LOG_MODULE_RESOLVER: true,
|
||||||
|
LOG_TRANSITIONS: true,
|
||||||
|
LOG_TRANSITIONS_INTERNAL: true,
|
||||||
|
LOG_VIEW_LOOKUPS: true,
|
||||||
|
rootElement: '#ember-app' // tells ember to inject this app into element with selector #ember-app
|
||||||
|
});
|
||||||
|
|
9
core/client/router.js
Executable file
9
core/client/router.js
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
/*global App */
|
||||||
|
|
||||||
|
App.Router.map(function () {
|
||||||
|
'use strict';
|
||||||
|
this.resource('posts');
|
||||||
|
this.resource('post', {path: 'post/:id'}, function () {
|
||||||
|
this.route('edit');
|
||||||
|
});
|
||||||
|
});
|
3
core/client/templates/application.hbs
Executable file
3
core/client/templates/application.hbs
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
<h2 id='title'>Welcome to Ghost on Ember.js</h2>
|
||||||
|
|
||||||
|
{{outlet}}
|
File diff suppressed because one or more lines are too long
|
@ -45,8 +45,7 @@ function setSelected(list, name) {
|
||||||
adminControllers = {
|
adminControllers = {
|
||||||
'index': function (req, res) {
|
'index': function (req, res) {
|
||||||
/*jslint unparam:true*/
|
/*jslint unparam:true*/
|
||||||
// Ember goes here.
|
res.render('default-ember');
|
||||||
res.send(200);
|
|
||||||
},
|
},
|
||||||
// Route: index
|
// Route: index
|
||||||
// Path: /ghost/
|
// Path: /ghost/
|
||||||
|
|
|
@ -55,4 +55,6 @@ module.exports = function (server) {
|
||||||
res.redirect(subdir + '/ghost/');
|
res.redirect(subdir + '/ghost/');
|
||||||
});
|
});
|
||||||
server.get('/ghost/', admin.indexold);
|
server.get('/ghost/', admin.indexold);
|
||||||
|
|
||||||
|
server.get('/ghost/ember/', admin.index);
|
||||||
};
|
};
|
41
core/server/views/default-ember.hbs
Normal file
41
core/server/views/default-ember.hbs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!doctype html>
|
||||||
|
<!--[if (IE 8)&!(IEMobile)]><html class="no-js lt-ie9" lang="en"><![endif]-->
|
||||||
|
<!--[if (gte IE 9)| IEMobile |!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
|
<meta name="csrf-param" content="{{csrfToken}}">
|
||||||
|
|
||||||
|
<title>Ghost Admin</title>
|
||||||
|
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<meta http-equiv="cleartype" content="on">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
|
||||||
|
<link rel="shortcut icon" href="{{asset "favicon.ico"}}">
|
||||||
|
<link rel="apple-touch-icon-precomposed" href="{{asset "img/touch-icon-iphone.png" ghost="true"}}" />
|
||||||
|
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{asset "img/touch-icon-ipad.png" ghost="true"}}" />
|
||||||
|
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{asset "img/small.png" ghost="true"}}" />
|
||||||
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{asset "img/medium.png" ghost="true"}}" />
|
||||||
|
|
||||||
|
<meta name="application-name" content="Ghost"/>
|
||||||
|
<meta name="msapplication-TileColor" content="#ffffff"/>
|
||||||
|
<meta name="msapplication-square70x70logo" content="{{asset "img/small.png" ghost="true"}}" />
|
||||||
|
<meta name="msapplication-square150x150logo" content="{{asset "img/medium.png" ghost="true"}}" />
|
||||||
|
<meta name="msapplication-square310x310logo" content="{{asset "img/large.png" ghost="true"}}" />
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400,300,700">
|
||||||
|
<link rel="stylesheet" href="{{asset "css/screen.css" ghost="true"}}">
|
||||||
|
</head>
|
||||||
|
<body class="{{bodyClass}}{{update_notification classOnly="true"}}">
|
||||||
|
|
||||||
|
<div id="ember-app"></div>
|
||||||
|
|
||||||
|
<script src="/ghost/scripts/vendor-ember.js"></script>
|
||||||
|
<script src="/ghost/scripts/templates-ember.js"></script>
|
||||||
|
<script src="/ghost/scripts/ghost-dev-ember.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
41803
core/shared/vendor/ember/ember.js
vendored
Normal file
41803
core/shared/vendor/ember/ember.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
2595
core/shared/vendor/handlebars/handlebars.js
vendored
Normal file
2595
core/shared/vendor/handlebars/handlebars.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
@ -10,7 +10,7 @@ var testUtils = require('../utils'),
|
||||||
should = require('should'),
|
should = require('should'),
|
||||||
|
|
||||||
// Stuff we are testing
|
// Stuff we are testing
|
||||||
gdPath = "../../client/assets/vendor/showdown/extensions/ghostdown.js",
|
gdPath = "../../clientold/assets/vendor/showdown/extensions/ghostdown.js",
|
||||||
ghostdown = require(gdPath);
|
ghostdown = require(gdPath);
|
||||||
|
|
||||||
describe("Ghostdown showdown extensions", function () {
|
describe("Ghostdown showdown extensions", function () {
|
||||||
|
|
|
@ -11,7 +11,7 @@ var testUtils = require('../utils'),
|
||||||
// Stuff we are testing
|
// Stuff we are testing
|
||||||
Showdown = require('showdown'),
|
Showdown = require('showdown'),
|
||||||
github = require('../../shared/vendor/showdown/extensions/github'),
|
github = require('../../shared/vendor/showdown/extensions/github'),
|
||||||
ghostdown = require('../../client/assets/vendor/showdown/extensions/ghostdown'),
|
ghostdown = require('../../clientold/assets/vendor/showdown/extensions/ghostdown'),
|
||||||
converter = new Showdown.converter({extensions: [ghostdown, github]});
|
converter = new Showdown.converter({extensions: [ghostdown, github]});
|
||||||
|
|
||||||
describe("Showdown client side converter", function () {
|
describe("Showdown client side converter", function () {
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"blanket": "~1.1.5",
|
"blanket": "~1.1.5",
|
||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
|
"grunt-ember-templates": "~0.4.18",
|
||||||
"grunt-cli": "~0.1.13",
|
"grunt-cli": "~0.1.13",
|
||||||
"grunt-contrib-clean": "~0.5.0",
|
"grunt-contrib-clean": "~0.5.0",
|
||||||
"grunt-contrib-compress": "~0.5.2",
|
"grunt-contrib-compress": "~0.5.2",
|
||||||
|
|
Loading…
Add table
Reference in a new issue