Skip to content

Commit 6bd6253

Browse files
committed
Merge branch '0.3.1-wip'
Conflicts: core/server/controllers/admin.js
2 parents 9df4955 + 0169b78 commit 6bd6253

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+960
-858
lines changed

Gruntfile.js

Lines changed: 217 additions & 217 deletions
Large diffs are not rendered by default.

config.example.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ config = {
3434
debug: false
3535
},
3636
server: {
37+
// Host to be passed to node's `net.Server#listen()`
3738
host: '127.0.0.1',
39+
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
3840
port: '2368'
3941
}
4042
},
@@ -53,7 +55,9 @@ config = {
5355
debug: false
5456
},
5557
server: {
58+
// Host to be passed to node's `net.Server#listen()`
5659
host: '127.0.0.1',
60+
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
5761
port: '2368'
5862
}
5963
},

core/client/assets/lib/uploader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
complete: function (result) {
2424
var self = this;
2525

26-
$dropzone.trigger("uploadsuccess", [result, $dropzone.attr('id')]);
27-
2826
function showImage(width, height) {
2927
$dropzone.find('img.js-upload-target').attr({"width": width, "height": height}).css({"display": "block"});
3028
$dropzone.find('.fileupload-loading').remove();
@@ -137,7 +135,7 @@
137135
var self = this;
138136
//This is the start point if no image exists
139137
$dropzone.find('img.js-upload-target').css({"display": "none"});
140-
$dropzone.removeClass('pre-image-uploader').addClass('image-uploader');
138+
$dropzone.removeClass('pre-image-uploader image-uploader-url').addClass('image-uploader');
141139
this.removeExtras();
142140
this.buildExtras();
143141
this.bindFileUpload();
@@ -148,6 +146,7 @@
148146
initUrl: function () {
149147
var self = this, val;
150148
this.removeExtras();
149+
$dropzone.addClass('image-uploader-url').removeClass('pre-image-uploader');
151150
$dropzone.find('.js-fileupload').addClass('right');
152151
$dropzone.append($cancel);
153152
$dropzone.find('.js-cancel').on('click', function () {
@@ -163,6 +162,7 @@
163162
$dropzone.find('div.description').before($url);
164163

165164
$dropzone.find('.js-button-accept').on('click', function () {
165+
$dropzone.trigger('uploadstart', [$dropzone.attr('id')]);
166166
$dropzone.find('div.description').hide();
167167
val = $('#uploadurl').val();
168168
$dropzone.find('.js-fileupload').removeClass('right');
@@ -175,7 +175,7 @@
175175
var self = this;
176176
// This is the start point if an image already exists
177177
source = $dropzone.find('img.js-upload-target').attr('src');
178-
$dropzone.removeClass('image-uploader').addClass('pre-image-uploader');
178+
$dropzone.removeClass('image-uploader image-uploader-url').addClass('pre-image-uploader');
179179
$dropzone.find('div.description').hide();
180180
$dropzone.append($cancel);
181181
$dropzone.find('.js-cancel').on('click', function () {

core/client/assets/sass/modules/global.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,8 @@ main {
12771277
.centre{
12781278
position: relative;
12791279
top: 50px;
1280-
margin-bottom: -6px;
1280+
display: block;
1281+
margin: 0 auto -6px auto;
12811282
}
12821283
.media {
12831284
@include icon($i-image, 60px, darken($lightbrown, 3%)) {
@@ -1408,6 +1409,7 @@ main {
14081409
color: $brown;
14091410
background: rgba(0,0,0,0.1);
14101411
border-radius: 2px;
1412+
min-height: 46px;
14111413

14121414
input {
14131415
position: absolute;

core/client/helpers/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*globals Handlebars, moment
22
*/
33
(function () {
4-
"use strict";
4+
'use strict';
55
Handlebars.registerHelper('date', function (context, block) {
6-
var f = block.hash.format || "MMM Do, YYYY",
6+
var f = block.hash.format || 'MMM Do, YYYY',
77
timeago = block.hash.timeago,
88
date;
99
if (timeago) {

core/client/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*globals window, $, _, Backbone, Validator */
22
(function () {
3-
"use strict";
3+
'use strict';
44

55
var Ghost = {
66
Layout : {},

core/client/markdown-actions.js

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/*global $, window, CodeMirror, Showdown, moment */
44
(function () {
5-
"use strict";
5+
'use strict';
66
var Markdown = {
77
init : function (options, elem) {
88
var self = this;
@@ -17,76 +17,76 @@
1717
replace: function () {
1818
var text = this.elem.getSelection(), pass = true, md, cursor, line, word, letterCount, converter;
1919
switch (this.style) {
20-
case "h1":
20+
case 'h1':
2121
cursor = this.elem.getCursor();
2222
line = this.elem.getLine(cursor.line);
23-
this.elem.setLine(cursor.line, "# " + line);
23+
this.elem.setLine(cursor.line, '# ' + line);
2424
this.elem.setCursor(cursor.line, cursor.ch + 2);
2525
pass = false;
2626
break;
27-
case "h2":
27+
case 'h2':
2828
cursor = this.elem.getCursor();
2929
line = this.elem.getLine(cursor.line);
30-
this.elem.setLine(cursor.line, "## " + line);
30+
this.elem.setLine(cursor.line, '## ' + line);
3131
this.elem.setCursor(cursor.line, cursor.ch + 3);
3232
pass = false;
3333
break;
34-
case "h3":
34+
case 'h3':
3535
cursor = this.elem.getCursor();
3636
line = this.elem.getLine(cursor.line);
37-
this.elem.setLine(cursor.line, "### " + line);
37+
this.elem.setLine(cursor.line, '### ' + line);
3838
this.elem.setCursor(cursor.line, cursor.ch + 4);
3939
pass = false;
4040
break;
41-
case "h4":
41+
case 'h4':
4242
cursor = this.elem.getCursor();
4343
line = this.elem.getLine(cursor.line);
44-
this.elem.setLine(cursor.line, "#### " + line);
44+
this.elem.setLine(cursor.line, '#### ' + line);
4545
this.elem.setCursor(cursor.line, cursor.ch + 5);
4646
pass = false;
4747
break;
48-
case "h5":
48+
case 'h5':
4949
cursor = this.elem.getCursor();
5050
line = this.elem.getLine(cursor.line);
51-
this.elem.setLine(cursor.line, "##### " + line);
51+
this.elem.setLine(cursor.line, '##### ' + line);
5252
this.elem.setCursor(cursor.line, cursor.ch + 6);
5353
pass = false;
5454
break;
55-
case "h6":
55+
case 'h6':
5656
cursor = this.elem.getCursor();
5757
line = this.elem.getLine(cursor.line);
58-
this.elem.setLine(cursor.line, "###### " + line);
58+
this.elem.setLine(cursor.line, '###### ' + line);
5959
this.elem.setCursor(cursor.line, cursor.ch + 7);
6060
pass = false;
6161
break;
62-
case "link":
62+
case 'link':
6363
md = this.options.syntax.link.replace('$1', text);
64-
this.elem.replaceSelection(md, "end");
64+
this.elem.replaceSelection(md, 'end');
6565
cursor = this.elem.getCursor();
6666
this.elem.setSelection({line: cursor.line, ch: cursor.ch - 8}, {line: cursor.line, ch: cursor.ch - 1});
6767
pass = false;
6868
break;
69-
case "image":
69+
case 'image':
7070
cursor = this.elem.getCursor();
7171
md = this.options.syntax.image.replace('$1', text);
72-
if (this.elem.getLine(cursor.line) !== "") {
72+
if (this.elem.getLine(cursor.line) !== '') {
7373
md = "\n\n" + md;
7474
}
7575
this.elem.replaceSelection(md, "end");
7676
cursor = this.elem.getCursor();
7777
this.elem.setSelection({line: cursor.line, ch: cursor.ch - 8}, {line: cursor.line, ch: cursor.ch - 1});
7878
pass = false;
7979
break;
80-
case "uppercase":
80+
case 'uppercase':
8181
md = text.toLocaleUpperCase();
8282
break;
83-
case "lowercase":
83+
case 'lowercase':
8484
md = text.toLocaleLowerCase();
8585
break;
86-
case "titlecase":
86+
case 'titlecase':
8787
md = text.toTitleCase();
8888
break;
89-
case "selectword":
89+
case 'selectword':
9090
cursor = this.elem.getCursor();
9191
word = this.elem.getTokenAt(cursor);
9292
if (!/\w$/g.test(word.string)) {
@@ -95,7 +95,7 @@
9595
this.elem.setSelection({line: cursor.line, ch: word.start}, {line: cursor.line, ch: word.end});
9696
}
9797
break;
98-
case "copyHTML":
98+
case 'copyHTML':
9999
converter = new Showdown.converter();
100100
if (text) {
101101
md = converter.makeHtml(text);
@@ -106,21 +106,23 @@
106106
$(".modal-copyToHTML-content").text(md).selectText();
107107
pass = false;
108108
break;
109-
case "list":
110-
md = text.replace(/^(\s*)(\w\W*)/gm, "$1* $2");
111-
this.elem.replaceSelection(md, "end");
109+
case 'list':
110+
md = text.replace(/^(\s*)(\w\W*)/gm, '$1* $2');
111+
this.elem.replaceSelection(md, 'end');
112112
pass = false;
113113
break;
114-
case "currentDate":
115-
md = moment(new Date()).format("D MMMM YYYY");
114+
case 'currentDate':
115+
md = moment(new Date()).format('D MMMM YYYY');
116+
this.elem.replaceSelection(md, 'end');
117+
pass = false;
116118
break;
117119
default:
118120
if (this.options.syntax[this.style]) {
119121
md = this.options.syntax[this.style].replace('$1', text);
120122
}
121123
}
122124
if (pass && md) {
123-
this.elem.replaceSelection(md, "end");
125+
this.elem.replaceSelection(md, 'end');
124126
if (!text) {
125127
letterCount = md.length;
126128
cursor = this.elem.getCursor();

core/client/mobile-interactions.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@
33
/*global window, document, $, FastClick */
44

55
(function () {
6-
"use strict";
6+
'use strict';
77

88
FastClick.attach(document.body);
99

1010
// ### Show content preview when swiping left on content list
11-
$(".manage").on("click", ".content-list ol li", function (event) {
11+
$('.manage').on('click', '.content-list ol li', function (event) {
1212
if (window.matchMedia('(max-width: 800px)').matches) {
1313
event.preventDefault();
1414
event.stopPropagation();
15-
$(".content-list").animate({right: "100%", left: "-100%", 'margin-right': "15px"}, 300);
16-
$(".content-preview").animate({right: "0", left: "0", 'margin-left': "0"}, 300);
15+
$('.content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300);
16+
$('.content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300);
1717
}
1818
});
1919

2020
// ### Hide content preview
21-
$(".manage").on("click", ".content-preview .button-back", function (event) {
21+
$('.manage').on('click', '.content-preview .button-back', function (event) {
2222
if (window.matchMedia('(max-width: 800px)').matches) {
2323
event.preventDefault();
2424
event.stopPropagation();
25-
$(".content-list").animate({right: "0", left: "0", 'margin-right': "0"}, 300);
26-
$(".content-preview").animate({right: "-100%", left: "100%", 'margin-left': "15px"}, 300);
25+
$('.content-list').animate({right: '0', left: '0', 'margin-right': '0'}, 300);
26+
$('.content-preview').animate({right: '-100%', left: '100%', 'margin-left': '15px'}, 300);
2727
}
2828
});
2929

3030
// ### Show settings options page when swiping left on settings menu link
31-
$(".settings").on("click", ".settings-menu li", function (event) {
31+
$('.settings').on('click', '.settings-menu li', function (event) {
3232
if (window.matchMedia('(max-width: 800px)').matches) {
3333
event.preventDefault();
3434
event.stopPropagation();
35-
$(".settings-sidebar").animate({right: "100%", left: "-102%", 'margin-right': "15px"}, 300);
36-
$(".settings-content").animate({right: "0", left: "0", 'margin-left': "0"}, 300);
37-
$(".settings-content .button-back, .settings-content .button-save").css("display", "inline-block");
35+
$('.settings-sidebar').animate({right: '100%', left: '-102%', 'margin-right': '15px'}, 300);
36+
$('.settings-content').animate({right: '0', left: '0', 'margin-left': '0'}, 300);
37+
$('.settings-content .button-back, .settings-content .button-save').css('display', 'inline-block');
3838
}
3939
});
4040

4141
// ### Hide settings options page
42-
$(".settings").on("click", ".settings-content .button-back", function (event) {
42+
$('.settings').on('click', '.settings-content .button-back', function (event) {
4343
if (window.matchMedia('(max-width: 800px)').matches) {
4444
event.preventDefault();
4545
event.stopPropagation();
46-
$(".settings-sidebar").animate({right: "0", left: "0", 'margin-right': "0"}, 300);
47-
$(".settings-content").animate({right: "-100%", left: "100%", 'margin-left': "15"}, 300);
48-
$(".settings-content .button-back, .settings-content .button-save").css("display", "none");
46+
$('.settings-sidebar').animate({right: '0', left: '0', 'margin-right': '0'}, 300);
47+
$('.settings-content').animate({right: '-100%', left: '100%', 'margin-left': '15'}, 300);
48+
$('.settings-content .button-back, .settings-content .button-save').css('display', 'none');
4949
}
5050
});
5151

core/client/models/post.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*global window, document, Ghost, $, _, Backbone */
22
(function () {
3-
"use strict";
3+
'use strict';
44

55
Ghost.Models.Post = Backbone.Model.extend({
66

@@ -12,8 +12,8 @@
1212

1313
parse: function (resp) {
1414
if (resp.status) {
15-
resp.published = !!(resp.status === "published");
16-
resp.draft = !!(resp.status === "draft");
15+
resp.published = !!(resp.status === 'published');
16+
resp.draft = !!(resp.status === 'draft');
1717
}
1818
if (resp.tags) {
1919
// TODO: parse tags into it's own collection on the model (this.tags)

0 commit comments

Comments
 (0)