diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-19 08:27:14 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-12-19 08:27:14 +0200 |
commit | 88a1c5b30d6ff07c9a3d0a9644ed02a4b8090d4b (patch) | |
tree | 9b5a496f7d7ad2d00677d2032ade61aba78aee0e /src/app.c | |
parent | e5af4c98f3f95781c190c2f16c286f8370cfe011 (diff) |
Bookmark a link via context menu
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1383,9 +1383,18 @@ iBool handleCommand_App(const char *cmd) { | |||
1383 | } | 1383 | } |
1384 | else if (equal_Command(cmd, "bookmark.add")) { | 1384 | else if (equal_Command(cmd, "bookmark.add")) { |
1385 | iDocumentWidget *doc = document_App(); | 1385 | iDocumentWidget *doc = document_App(); |
1386 | makeBookmarkCreation_Widget(url_DocumentWidget(doc), | 1386 | if (suffixPtr_Command(cmd, "url")) { |
1387 | bookmarkTitle_DocumentWidget(doc), | 1387 | iString *title = collect_String(newRange_String(range_Command(cmd, "title"))); |
1388 | siteIcon_GmDocument(document_DocumentWidget(doc))); | 1388 | replace_String(title, "%20", " "); |
1389 | makeBookmarkCreation_Widget(collect_String(suffix_Command(cmd, "url")), | ||
1390 | title, | ||
1391 | 0x1f588 /* pin */); | ||
1392 | } | ||
1393 | else { | ||
1394 | makeBookmarkCreation_Widget(url_DocumentWidget(doc), | ||
1395 | bookmarkTitle_DocumentWidget(doc), | ||
1396 | siteIcon_GmDocument(document_DocumentWidget(doc))); | ||
1397 | } | ||
1389 | postCommand_App("focus.set id:bmed.title"); | 1398 | postCommand_App("focus.set id:bmed.title"); |
1390 | return iTrue; | 1399 | return iTrue; |
1391 | } | 1400 | } |