-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
203 lines (165 loc) · 7.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="Wavemaker Novel Planning and Writing Software. " />
<meta name="author" content="" />
<link rel="shortcut icon" type="image/png" href="icons/favicon.ico" />
<link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="manifest" href="manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<title>Wavemaker</title>
<link href="https://fonts.googleapis.com/css?family=Halant|Merriweather|Quicksand" rel="stylesheet">
<link rel="stylesheet" href="lib/css/bootstrap.min.css" />
<link href="lib/css/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="lib/css/ui.fancytree.1.css" rel="stylesheet" />
<link href="lib/css/jquery-ui.css" rel="stylesheet" />
<!-- Custom styles for this template -->
<link rel="stylesheet" href="lib/css/animate.css" />
<link rel="stylesheet" href="global/css/global.css" />
</head>
<body>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-1734434-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-1734434-2');
</script>
<div id="mobilecheck"></div> <!-- If this is visible then we are on mobile-->
<div id="wavemakerApp"></div>
<div id="install-alert" class="alert alert-secondary alert-dismissible animated fadeInDown" role="alert">
Install this as an offline App!
<button id="install-button" class="btn btn-secondary btn-sm ">Click Here!</button>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<script>
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("sw.js").then(function (reg) {
console.log("register", reg);
}).catch(function (err) {
console.log("err", err);
});
}
if (window.matchMedia('(display-mode: standalone)').matches) {
console.log("This is running as standalone.");
} else {
console.log("This is running as webapp.");
}
try {
localStorage.setItem("localstoragetest", "Hello World!");
console.log("storage OK")
} catch (e) {
console.log("Hello")
console.log("Your browser is not letting wavemaker store locally")
console.log("We need localstorage to keep your data in.... otherwise it's pointless")
console.log("thanks, Iain")
alert("You need to enable Local Storage for wavemaker to work")
}
let deferredPrompt;
const installAlert = document.getElementById('install-alert');
const installBtn = document.getElementById('install-button');
installAlert.style.display = 'none';
window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt
e.preventDefault();
// Stash the event so it can be triggered later.
deferredPrompt = e;
// Update UI to notify the user they can add to home screen
installAlert.style.display = 'block';
installBtn.addEventListener('click', (e) => {
// hide our user interface that shows our A2HS button
installAlert.style.display = 'none';
// Show the prompt
deferredPrompt.prompt();
// Wait for the user to respond to the prompt
deferredPrompt.userChoice.then((choiceResult) => {
if (choiceResult.outcome === 'accepted') {
// console.log('User accepted the A2HS prompt');
} else {
// console.log('User dismissed the A2HS prompt');
}
deferredPrompt = null;
});
});
});
</script>
<script src="https://apis.google.com/js/api.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
<!-- Bootstrap core JavaScript s -->
<script src="lib/js/autosize.js"></script>
<script src="lib/js/jquery-3.3.1.min.js"></script>
<script src="lib/js/jquery-ui.min.js"></script>
<script src="lib/js/tether.min.js"></script>
<script src="lib/js/bootstrap.min.js"></script>
<script src="lib/js/sweetalert2.all.js"></script>
<script src="lib/js/dexie.js"></script>
<script src="lib/js/split.min.js"></script>
<script src="lib/js/jquery.fancytree-all-deps.js"></script>
<script src="lib/js/jquery.ui-contextmenu.min.js"></script>
<script src="lib/js/turndown.js"></script>
<script src="lib/js/showdown.min.js"></script>
<script src="lib/js/hammer.min.js"></script>
<script src="global/js/datamanager.js"></script>
<script src="global/js/init.js"></script>
<script>
var AutoSave;
var DoAutoSave = false;
var ShowUploadFeedback=true
AutoSave = setInterval(alertFunc, 300000); // 300000 v=5 mins
var CallDone = false
function alertFunc() {
if(DoAutoSave){
console.log("Autosave Triggered!");
ShowUploadFeedback=false;
if(IsGoogleDrive){
exportDatabase("gDriveSyncUp", false);
}else{
alert("Your Google drive account appears to not be logged in - autosave will fail - return to the main menu and make sure your connection is there. Or turn OFF autosave by reloading this page and choosing not to turn on auto sync")
DoAutoSave = false
CallDone = false
}
}
}
function autoSyncCall(){
if(!CallDone){
console.log(WMproject.state.tool +" Calling for sync")
swal({
title: "Turn On Auto Sync?",
html: "Auto Sync will upload to google drive automatically every five minutes. You will be asked this before each session. To disable it simply restart the app. <BR> (or reload the page)<BR><BR><a href='https://wavemaker.co.uk/blog/to-auto-sync-or-not-to-auto-sync/' class='btn btn-xs' target='_blank'>How to use Auto-Sync</a>" ,
type: "warning",
showCancelButton: true,
confirmButtonColor: "#3085d6",
cancelButtonColor: "#d33",
confirmButtonText: "Yes Please.",
cancelButtonText: "No Thanks."
}).then(result => {
if (result.value) {
DoAutoSave=true
// swal("Auto Sync Turned on!", "Coolio", "success");
}
});
CallDone=true
}
}
</script>
</body>
</html>