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
This commit is contained in:
parent
a72feee812
commit
f23966ef87
2 changed files with 11 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue