on mobiles, go to real page to get reactivity
This commit is contained in:
@@ -199,6 +199,7 @@ def generate_index(opts):
|
||||
files = [f for f in files if f != opts.filename]
|
||||
files = [f for f in files if f != opts.password_filename]
|
||||
files = match_files(files, opts.includes)
|
||||
dirs = match_files(dirs, opts.includes)
|
||||
dirs.sort()
|
||||
files.sort()
|
||||
files.sort(key=lambda x: x.find("/") > 0)
|
||||
@@ -318,7 +319,7 @@ def get_password_page(secret, target_base, target_ext):
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, height=device-height, viewport-fit=cover">
|
||||
<title>Password required</title>
|
||||
<script language="JavaScript">
|
||||
Object.defineProperty(String.prototype, 'hashCode', {
|
||||
@@ -332,6 +333,9 @@ Object.defineProperty(String.prototype, 'hashCode', {
|
||||
return hash;
|
||||
}
|
||||
});
|
||||
function isMobile () {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
}
|
||||
function scramble(p,t) {
|
||||
p += t;
|
||||
var sstr = '';
|
||||
@@ -360,9 +364,14 @@ function pw(element) {
|
||||
if (element.value) {
|
||||
pw = pw.split(':',2);
|
||||
if (element.value.hashCode() == parseInt(pw[0])) {
|
||||
let unscrambled = "TARGET_BASE." + unscramble(element.value, atob(pw[1])) + "TARGET_EXT"
|
||||
if (isMobile()) {
|
||||
document.location.replace(unscrambled);
|
||||
return
|
||||
}
|
||||
document.getElementById("body").innerHTML = '';
|
||||
var frame = document.createElement("iframe");
|
||||
frame.src = "TARGET_BASE." + unscramble(element.value, atob(pw[1])) + "TARGET_EXT";
|
||||
frame.src = unscrambled;
|
||||
document.getElementById("body").appendChild(frame);
|
||||
} else {
|
||||
document.getElementById("message").innerHTML = "No match";
|
||||
@@ -427,6 +436,7 @@ def get_header(opts):
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, height=device-height, viewport-fit=cover">
|
||||
<meta name="generator" content="SimpleWebPage """
|
||||
+ VERSION
|
||||
+ """" />
|
||||
|
||||
Reference in New Issue
Block a user