diff --git a/client/html/post_edit_sidebar.tpl b/client/html/post_edit_sidebar.tpl
index 78e90aab..ecc65699 100644
--- a/client/html/post_edit_sidebar.tpl
+++ b/client/html/post_edit_sidebar.tpl
@@ -60,9 +60,8 @@
<% if (ctx.canEditPostSource) { %>
- <%= ctx.makeTextInput({
+ <%= ctx.makeTextarea({
text: 'Source',
- name: 'source',
value: ctx.post.source,
}) %>
diff --git a/client/html/post_readonly_sidebar.tpl b/client/html/post_readonly_sidebar.tpl
index 48372f49..ab3f1491 100644
--- a/client/html/post_readonly_sidebar.tpl
+++ b/client/html/post_readonly_sidebar.tpl
@@ -42,9 +42,10 @@
<% if (ctx.post.source) { %>
<% } %>
diff --git a/client/js/controls/post_edit_sidebar_control.js b/client/js/controls/post_edit_sidebar_control.js
index 2180d4b5..030bb7a2 100644
--- a/client/js/controls/post_edit_sidebar_control.js
+++ b/client/js/controls/post_edit_sidebar_control.js
@@ -408,7 +408,7 @@ class PostEditSidebarControl extends events.EventTarget {
}
get _sourceInputNode() {
- return this._formNode.querySelector('.post-source input');
+ return this._formNode.querySelector('.post-source textarea');
}
get _featureLinkNode() {
diff --git a/client/js/controls/post_readonly_sidebar_control.js b/client/js/controls/post_readonly_sidebar_control.js
index f3d1e94f..0d662524 100644
--- a/client/js/controls/post_readonly_sidebar_control.js
+++ b/client/js/controls/post_readonly_sidebar_control.js
@@ -27,6 +27,7 @@ class PostReadonlySidebarControl extends events.EventTarget {
canEditPosts: api.hasPrivilege('posts:edit'),
canViewTags: api.hasPrivilege('tags:view'),
escapeColons: uri.escapeColons,
+ extractRootDomain: uri.extractRootDomain,
getPrettyTagName: misc.getPrettyTagName,
}));
diff --git a/client/js/models/post.js b/client/js/models/post.js
index 90ff300c..d2124adb 100644
--- a/client/js/models/post.js
+++ b/client/js/models/post.js
@@ -33,6 +33,7 @@ class Post extends events.EventTarget {
get fullContentUrl() { return this._fullContentUrl; }
get thumbnailUrl() { return this._thumbnailUrl; }
get source() { return this._source; }
+ get sourceSplit() { return this._source.split('\n'); }
get canvasWidth() { return this._canvasWidth || 800; }
get canvasHeight() { return this._canvasHeight || 450; }
get fileSize() { return this._fileSize || 0; }
@@ -271,10 +272,6 @@ class Post extends events.EventTarget {
Math.round(Math.random() * 1000);
}
- prettyPrintSource() {
- return uri.extractRootDomain(this._source);
- }
-
_updateFromResponse(response) {
const map = () => ({
_version: response.version,