navigator.share

This commit is contained in:
Fornax committed 2019-06-04 20:14:25 +02:00
1 parent 1261563f31
commit 0b8d67a8eb
4 files changed
+17 -6

No files matched your search

+2 -2
View File
@@ -11,8 +11,8 @@ type PixelWebConfig struct {
const DefaultConfig = `# Pixeldrain Web UI server configuration
api_url_external = "https://sia.pixeldrain.com/api" # Used in the web browser, should be a full URL. Not ending with a slash
api_url_internal = "http://127.0.0.1:8080/api" # Used for internal API requests to the pixeldrain server, not visible to users
api_url_external = "/api" # Used in the web browser
api_url_internal = "http://127.0.0.1:8080" # Used for internal API requests to the pixeldrain server, not visible to users
static_resource_dir = "res/static"
template_dir = "res/template"
debug_mode = false
+10
View File
@@ -110,10 +110,20 @@ var Toolbar = {
}
};
var Sharebar = {
visible: false,
toggle: function(){
if (navigator.share) {
navigator.share({
title: Viewer.title,
text: "Get this file from Pixeldrain!",
url: window.location.href
});
return;
}
if (!Toolbar.visible){
Toolbar.toggle();
}
+4 -3
View File
@@ -2,6 +2,7 @@
var Viewer = {
currentFile: "",
title: "", // Contains either the file name or list title
listId: "",
isList: false,
isFile: false,
@@ -14,18 +15,18 @@ var Viewer = {
// On small screens the toolbar takes too much space, so it collapses automatically
if($("#filepreview").width() < 400 && Toolbar.visible){
window.setTimeout(function(){
Toolbar.toggle();
}, 800);
Toolbar.toggle();
}
if(type === "file"){
this.isFile = true;
this.currentFile = data.id;
this.title = data.name;
this.setFile(data);
} else if (type === "list") {
this.isList = true;
this.listId = data.id;
this.title = data.title;
ListNavigator.init(data.data);
}
+1 -1
View File
@@ -314,7 +314,7 @@ var UploadWorker = /** @class */ (function () {
};
UploadWorker.prototype.newFile = function () {
var file = this.manager.grabFile();
if (file === undefined) { // No more files in the queue. We're finished
if (file === undefined) {
this.uploading = false;
console.debug("No files left in queue");
return; // Stop the thread