Make warning message on reader match library
This commit is contained in:
committed by
Hongbo Wu
parent
062215afa4
commit
2e7b7c1bb5
@ -257,8 +257,9 @@ struct WebReaderContainerView: View {
|
|||||||
.frame(height: readerViewNavBarHeight * navBarVisibilityRatio)
|
.frame(height: readerViewNavBarHeight * navBarVisibilityRatio)
|
||||||
.opacity(navBarVisibilityRatio)
|
.opacity(navBarVisibilityRatio)
|
||||||
.background(Color.systemBackground)
|
.background(Color.systemBackground)
|
||||||
.alert("Are you sure?", isPresented: $showDeleteConfirmation) {
|
.alert("Are you sure you want to remove this item? All associated notes and highlights will be deleted.",
|
||||||
Button("Remove Link", role: .destructive) {
|
isPresented: $showDeleteConfirmation) {
|
||||||
|
Button("Remove Item", role: .destructive) {
|
||||||
Snackbar.show(message: "Link removed")
|
Snackbar.show(message: "Link removed")
|
||||||
dataService.removeLink(objectID: item.objectID)
|
dataService.removeLink(objectID: item.objectID)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
|
|||||||
@ -11,13 +11,34 @@ function iconURL() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ShareExtension.prototype = {
|
ShareExtension.prototype = {
|
||||||
|
getHighlightHTML: function() {
|
||||||
|
try {
|
||||||
|
var sel = window.getSelection()
|
||||||
|
return (function () {
|
||||||
|
var html = "";
|
||||||
|
var sel = window.getSelection();
|
||||||
|
if (sel.rangeCount) {
|
||||||
|
var container = document.createElement("div");
|
||||||
|
for (var i = 0, len = sel.rangeCount; i < len; ++i) {
|
||||||
|
container.appendChild(sel.getRangeAt(i).cloneContents());
|
||||||
|
}
|
||||||
|
html = container.innerHTML;
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
})()
|
||||||
|
} catch {
|
||||||
|
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
},
|
||||||
run: function(arguments) {
|
run: function(arguments) {
|
||||||
arguments.completionFunction({
|
arguments.completionFunction({
|
||||||
'url': window.location.href,
|
'url': window.location.href,
|
||||||
'title': document.title.toString(),
|
'title': document.title.toString(),
|
||||||
'iconURL': iconURL(),
|
'iconURL': iconURL(),
|
||||||
'contentType': document.contentType,
|
'contentType': document.contentType,
|
||||||
'originalHTML': new XMLSerializer().serializeToString(document)
|
'originalHTML': new XMLSerializer().serializeToString(document),
|
||||||
|
'highlightHTML': this.getHighlightHTML()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user