Commit f23966ef authored by Benjamin Neff's avatar Benjamin Neff Committed by Dennis Schubert

Make mobile bookmarklet work the same way as with desktop UI

This fixes that it fails when you call it without notes parameter.

closes #7698
parent a72feee8
......@@ -7,6 +7,7 @@
## Bug fixes
* Fix invite link on the contacts page when the user has no contacts [#7690](https://github.com/diaspora/diaspora/pull/7690)
* Fixed the mobile bookmarklet when called without parameters [#7698](https://github.com/diaspora/diaspora/pull/7698)
## Features
* Check if redis is running in script/server [#7685](https://github.com/diaspora/diaspora/pull/7685)
......
......@@ -6,16 +6,21 @@ $(document).ready(function() {
return params.content;
}
var content = params.title + " - " + params.url;
if (params.notes.length > 0) {
content += " - " + params.notes;
var separator = "\n\n";
var contents = "### " + params.title + separator;
if (params.notes) {
var notes = params.notes.toString().replace(/(?:\r\n|\r|\n)/g, "\n> ");
contents += "> " + notes + separator;
}
return content;
contents += params.url;
return contents;
}
var content = publisherContent(gon.preloads.bookmarklet);
if (content.length > 0) {
$("#status_message_text").val(content);
var textarea = $("#status_message_text");
textarea.val(content);
autosize.update(textarea);
}
});
// @license-end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment