diff --git a/plemp.js b/plemp.js
index 78d75a9..6e75e22 100644
--- a/plemp.js
+++ b/plemp.js
@@ -94,40 +94,39 @@ app.get('/draggables/:id', function(req, res) {
var drag = draggables[drag_id];
var default_style = "left:" + drag.left + "px;top:" + drag.top + "px;";
var mime_type = drag.mime.split("/")
+ var title = drag.name || drag.title || 'Title not set';
+ var content;
switch (mime_type[0]) {
case "image":
- res.send('' +
- '');
+ content = '';
break;
case "video":
- res.send('');
+ content = '';
break;
case "audio":
- res.send('');
+ content = '';
break;
case "text":
file_contents = fs.readFileSync("public/upload/" + drag_id);
- res.send('
' + file_contents +
- '
');
+ content = '
' + file_contents + '
';
break;
case 'application': // FIXME: treat as code for now, but it is probably wrong
file_contents = fs.readFileSync("public/upload/" + drag_id);
- res.send('
' + file_contents +
- '
');
+ content = '
' + file_contents +
+ '
';
break;
default:
- res.send('
Unknown type: ' +
- mime_type + '
');
+ content = 'Unknown type: ' + mime_type + '';
}
+
+ // Wrap the content in a div with title and comments.
+ res.send('