Skip to content

Commit

Permalink
Le texte sélectionné sur la page va dans le champ description
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldarone committed Oct 9, 2015
1 parent 3445e14 commit f4f673c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions data/js/shaarli-get-infos.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ function getTitle() {
}

function getDescription() {
var description = document.querySelector('meta[property="og:description"]') || document.querySelector('meta[name="description"]');
var description = window.getSelection().toString()
|| document.querySelector('meta[property="og:description"]').content
|| document.querySelector('meta[name="description"]').content;

return (description) ? description.content : '';
return (description) ? description : '';
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Shaarli-next",
"name": "shaarli-next",
"version": "2.0.2",
"version": "2.1.0",
"description": "Post URL to Shaarli",
"main": "index.js",
"author": "Alda Marteau-Hardi",
Expand Down

0 comments on commit f4f673c

Please sign in to comment.