Fix the comments (counter) in the generated draggable HTML for now
This is necessary to give the draggable div a nice, fixed initial height.
This commit is contained in:
parent
e7c1bdc461
commit
063ab8612e
4
app.js
4
app.js
|
@ -298,7 +298,7 @@ app.get('/draggables/:id', function(req, res) {
|
|||
file_contents = fs.readFileSync(__dirname + "/public/upload/" + drag.name, 'utf8');
|
||||
content = '<pre>' + escapeHTML(file_contents) + '</pre>';
|
||||
break;
|
||||
case 'application': // FIXME: treat as code for now, but it is probably wrong
|
||||
case "application": // FIXME: treat as code for now, but it is probably wrong
|
||||
file_contents = fs.readFileSync(__dirname + "/public/upload/" + drag.name, 'utf8');
|
||||
content = '<pre><code class="' + drag.type + '">' +
|
||||
escapeHTML(file_contents) +
|
||||
|
@ -314,7 +314,7 @@ app.get('/draggables/:id', function(req, res) {
|
|||
'<h2><span class="title">' + title + '</span>' +
|
||||
'<div class="delete" title="Delete…">⨯</div>' +
|
||||
'<div class="download" title="Download…">↓</div>' +
|
||||
'</h2>' + content + '<div class="comments"></div>' +
|
||||
'</h2>' + content + '<div class="comments">Comments (0)</div>' +
|
||||
'</div>');
|
||||
});
|
||||
|
||||
|
|
|
@ -29,8 +29,10 @@ $(document).ready(function() {
|
|||
cancel: 'Cancel',
|
||||
style: 'inherit' });
|
||||
// FIXME: actually get the comments!
|
||||
this.find(".comments").text("Comments (0)").hide();
|
||||
// Highlight contained code.
|
||||
//this.find(".comments").text("Comments (0)");
|
||||
// Fix the height of the pre block. FIXME: can this be improved?
|
||||
this.find("pre").css({ height: (this.height() - 80) + "px" });
|
||||
// Highlight contained code in the pre block.
|
||||
this.find("pre code").each(function(idx, elem) {
|
||||
hljs.highlightBlock(elem, ' ');
|
||||
});
|
||||
|
|
Reference in New Issue