mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 10:55:56 +00:00
Merge branch 'wip-filter-stuff'
This commit is contained in:
22
js/common.js
22
js/common.js
@@ -400,25 +400,3 @@ const Notify = {
|
||||
}
|
||||
};
|
||||
|
||||
// http://stackoverflow.com/questions/6251937/how-to-get-selecteduser-highlighted-text-in-contenteditable-element-and-replac
|
||||
/* exported getSelectionText */
|
||||
function getSelectionText() {
|
||||
let text = "";
|
||||
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
const sel = window.getSelection();
|
||||
if (sel.rangeCount) {
|
||||
const container = document.createElement("div");
|
||||
for (let i = 0, len = sel.rangeCount; i < len; ++i) {
|
||||
container.appendChild(sel.getRangeAt(i).cloneContents());
|
||||
}
|
||||
text = container.innerHTML;
|
||||
}
|
||||
} else if (typeof document.selection != "undefined") {
|
||||
if (document.selection.type == "Text") {
|
||||
text = document.selection.createRange().textText;
|
||||
}
|
||||
}
|
||||
|
||||
return text.stripTags();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user