Fixed b/w compatibility for linked comments in history skin
This commit is contained in:
parent
4166b29b05
commit
c614e08718
3 changed files with 42 additions and 28 deletions
|
@ -429,32 +429,18 @@ Story.prototype.getMacroHandler = function(name) {
|
||||||
*/
|
*/
|
||||||
Story.prototype.summary_macro = function(param) {
|
Story.prototype.summary_macro = function(param) {
|
||||||
param.limit || (param.limit = 15);
|
param.limit || (param.limit = 15);
|
||||||
var keys, summary;
|
var summary = this.title || this.text;
|
||||||
if (arguments.length > 1) {
|
if (!summary && arguments.length > 1) {
|
||||||
res.push();
|
var buffer, content = [];
|
||||||
var content;
|
|
||||||
for (var i = 1; i < arguments.length; i += 1) {
|
for (var i = 1; i < arguments.length; i += 1) {
|
||||||
if (content = this.getMetadata(arguments[i])) {
|
if (buffer = this.getMetadata(arguments[i])) {
|
||||||
res.write(content);
|
content.push(buffer);
|
||||||
res.write(String.SPACE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
summary = res.pop();
|
summary = content.join(String.SPACE);
|
||||||
}
|
|
||||||
if (!summary) {
|
|
||||||
summary = (this.title || String.EMPTY) + String.SPACE +
|
|
||||||
(this.text || String.EMPTY);
|
|
||||||
}
|
}
|
||||||
var clipped = stripTags(summary).clip(param.limit, param.clipping, '\\s');
|
var clipped = stripTags(summary).clip(param.limit, param.clipping, '\\s');
|
||||||
var head = clipped.split(/(\s)/, param.limit * 0.6).join(String.EMPTY);
|
res.write(clipped || '…');
|
||||||
var tail = clipped.substring(head.length).trim();
|
|
||||||
head = head.trim();
|
|
||||||
if (!head && !tail) {
|
|
||||||
head = '…';
|
|
||||||
}
|
|
||||||
param.link ? html.link({href: this.href()}, head) : res.write(head);
|
|
||||||
res.writeln('\n');
|
|
||||||
res.write(tail);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,13 +114,11 @@
|
||||||
<% #history %>
|
<% #history %>
|
||||||
<li>
|
<li>
|
||||||
<a href='<% this.href %>' title='<% this.modified %>'>
|
<a href='<% this.href %>' title='<% this.modified %>'>
|
||||||
<% this.summary %>
|
<% this.summary | this.link %>
|
||||||
<div>
|
|
||||||
<small>
|
|
||||||
<% this.creator %>, <% this.modified text %>
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
|
<div class='uk-text-small'>
|
||||||
|
<% this.creator %>, <% this.modified text %>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<% #permalink %>
|
<% #permalink %>
|
||||||
|
|
|
@ -422,3 +422,33 @@ Story.prototype.reads_macro = function(param) {
|
||||||
res.write(this.requests);
|
res.write(this.requests);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Story.prototype.summary_macro = function(param) {
|
||||||
|
param.limit || (param.limit = 15);
|
||||||
|
var keys, summary;
|
||||||
|
if (arguments.length > 1) {
|
||||||
|
res.push();
|
||||||
|
var content;
|
||||||
|
for (var i=1; i<arguments.length; i+=1) {
|
||||||
|
if (content = this.getMetadata(arguments[i])) {
|
||||||
|
res.write(content);
|
||||||
|
res.write(String.SPACE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
summary = res.pop();
|
||||||
|
}
|
||||||
|
if (!summary) {
|
||||||
|
summary = (this.title || String.EMPTY) + String.SPACE + (this.text || String.EMPTY);
|
||||||
|
}
|
||||||
|
var clipped = stripTags(summary).clip(param.limit, param.clipping, '\\s');
|
||||||
|
var head = clipped.split(/(\s)/, param.limit * 0.6).join(String.EMPTY);
|
||||||
|
var tail = clipped.substring(head.length).trim();
|
||||||
|
head = head.trim();
|
||||||
|
if (!head && !tail) {
|
||||||
|
head = '…';
|
||||||
|
}
|
||||||
|
html.link({href: this.href()}, head);
|
||||||
|
res.writeln('<br>');
|
||||||
|
res.write(tail);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue