mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 07:45:46 +00:00
Added portable app support
This commit is contained in:
25
portable-json-creator/index.html
Normal file
25
portable-json-creator/index.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>TessesFramework portable.json creator</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>TessesFramework portable.json creator</h1>
|
||||
|
||||
Choose the way you want your app to be portable
|
||||
<ul>
|
||||
<li>
|
||||
<a href="./portableapps/">
|
||||
PortableApps.com
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="./relative/">
|
||||
Relative To Application
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
98
portable-json-creator/portableapps/index.html
Normal file
98
portable-json-creator/portableapps/index.html
Normal file
@@ -0,0 +1,98 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>TessesFramework portable.json creator</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>TessesFramework portable.json creator</h1>
|
||||
Don't want PortableApps.com click <a href="../relative/">here</a> for just having directories relative to application
|
||||
|
||||
<fieldset>
|
||||
<legend>Configuration</legend>
|
||||
|
||||
<label for="user">TF_User: </label>
|
||||
<select id="user">
|
||||
<option value="system">System's %USERPROFILE%</option>
|
||||
<option value="app">MyApp\Data\TF_User (tied to app)</option>
|
||||
<option value="documents" selected>PAF\Documents\TF_User (shared between all tessesframework portable apps)</option>
|
||||
</select>
|
||||
|
||||
<br>
|
||||
<label for="desktop">Desktop: </label>
|
||||
<select id="desktop">
|
||||
<option value="system">System's</option>
|
||||
<option value="tf_user">TF_User\Desktop</option>
|
||||
<option value="documents" selected>PAF\Documents\Desktop</option>
|
||||
</select>
|
||||
<br>
|
||||
<label for="downloads">Downloads: </label>
|
||||
<select id="downloads">
|
||||
<option value="system">System's</option>
|
||||
<option value="tf_user">TF_User\Downloads</option>
|
||||
<option value="documents" selected>PAF\Documents\Downloads</option>
|
||||
</select>
|
||||
<br>
|
||||
<input type="checkbox" id="system_documents">
|
||||
<label for="system_documents">Use System's Documents Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_pictures">
|
||||
<label for="system_pictures">Use System's Pictures Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_videos">
|
||||
<label for="system_videos">Use System's Videos Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_music">
|
||||
<label for="system_music">Use System's Music Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_config">
|
||||
<label for="system_config">Use System's Config Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_cache">
|
||||
<label for="system_cache">Use System's Cache Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_data">
|
||||
<label for="system_data">Use System's Data Folder</label>
|
||||
<br>
|
||||
<input type="checkbox" id="system_state">
|
||||
<label for="system_state">Use System's State Folder</label>
|
||||
|
||||
<br>
|
||||
<input type="checkbox" id="system_temp" checked>
|
||||
<label for="system_temp">Use System's Temp Folder</label>
|
||||
|
||||
</fieldset>
|
||||
<button id="saveBtn">Save</button>
|
||||
<script>
|
||||
(function(){
|
||||
saveBtn.onclick = ()=>{
|
||||
const dict = {
|
||||
portable_type: "PortableApps.com",
|
||||
portable_data: {
|
||||
user: user.value,
|
||||
desktop: desktop.value,
|
||||
downloads: downloads.value,
|
||||
|
||||
system_documents: system_documents.checked,
|
||||
system_pictures: system_pictures.checked,
|
||||
system_videos: system_videos.checked,
|
||||
system_music: system_music.checked,
|
||||
system_config: system_config.checked,
|
||||
system_cache: system_cache.checked,
|
||||
system_data: system_data.checked,
|
||||
system_state: system_state.checked,
|
||||
system_temp: system_temp.checked
|
||||
}
|
||||
};
|
||||
|
||||
const json = JSON.stringify(dict,null,'\t');
|
||||
const a = document.createElement('a');
|
||||
a.href = `data:text/json;charset=utf-8,${encodeURIComponent(json)}`;
|
||||
a.download="portable.json";
|
||||
a.click();
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
157
portable-json-creator/relative/index.html
Normal file
157
portable-json-creator/relative/index.html
Normal file
@@ -0,0 +1,157 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>TessesFramework portable.json creator</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>TessesFramework portable.json creator</h1>
|
||||
Want PortableApps.com click <a href="../portableapps/">here</a>
|
||||
<br>system: don't make this folder portable, default: the default value (not portable if TF_User directory is "system", otherwise it's a subdirectory in the TF_User directory), anything else is relative to executable directory (for all of these)
|
||||
<br>Please use "/" and not "\" even if on Windows
|
||||
<fieldset>
|
||||
<legend>Configuration</legend>
|
||||
<label for="user">TF_User: </label>
|
||||
<datalist id="user_datalist">
|
||||
<option>system</option>
|
||||
<option>../TF_User</option>
|
||||
</datalist>
|
||||
<input type="text" id="user" value="../TF_User" list="user_datalist">
|
||||
|
||||
<br>
|
||||
<label for="documents">Documents: </label>
|
||||
<datalist id="documents_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Documents</option>
|
||||
</datalist>
|
||||
<input type="text" id="documents" value="default" list="documents_datalist">
|
||||
|
||||
<br>
|
||||
<label for="downloads">Downloads: </label>
|
||||
<datalist id="downloads_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Downloads</option>
|
||||
</datalist>
|
||||
<input type="text" id="downloads" value="default" list="downloads_datalist">
|
||||
|
||||
<br>
|
||||
<label for="desktop">Desktop: </label>
|
||||
<datalist id="desktop_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Desktop</option>
|
||||
</datalist>
|
||||
<input type="text" id="desktop" value="default" list="desktop_datalist">
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<label for="pictures">Pictures: </label>
|
||||
<datalist id="pictures_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Pictures</option>
|
||||
</datalist>
|
||||
<input type="text" id="pictures" value="default" list="pictures_datalist">
|
||||
|
||||
<br>
|
||||
<label for="videos">Videos: </label>
|
||||
<datalist id="videos_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Videos</option>
|
||||
</datalist>
|
||||
<input type="text" id="videos" value="default" list="videos_datalist">
|
||||
|
||||
<br>
|
||||
<label for="music">Music: </label>
|
||||
<datalist id="music_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Music</option>
|
||||
</datalist>
|
||||
<input type="text" id="music" value="default" list="music_datalist">
|
||||
|
||||
<br>
|
||||
<label for="config">Config: </label>
|
||||
<datalist id="config_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Config</option>
|
||||
</datalist>
|
||||
<input type="text" id="config" value="default" list="config_datalist">
|
||||
|
||||
<br>
|
||||
<label for="cache">Cache: </label>
|
||||
<datalist id="cache_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Cache</option>
|
||||
</datalist>
|
||||
<input type="text" id="cache" value="default" list="cache_datalist">
|
||||
|
||||
<br>
|
||||
<label for="data">Data: </label>
|
||||
<datalist id="data_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Data</option>
|
||||
</datalist>
|
||||
<input type="text" id="data" value="default" list="data_datalist">
|
||||
|
||||
<br>
|
||||
<label for="state">State: </label>
|
||||
<datalist id="state_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/State</option>
|
||||
</datalist>
|
||||
<input type="text" id="state" value="default" list="state_datalist">
|
||||
|
||||
<br>
|
||||
<label for="temp">Temp: </label>
|
||||
<datalist id="temp_datalist">
|
||||
<option>system</option>
|
||||
<option>default</option>
|
||||
<option>../TF_User/Temp</option>
|
||||
</datalist>
|
||||
<input type="text" id="temp" value="system" list="temp_datalist">
|
||||
</fieldset>
|
||||
|
||||
|
||||
<button id="saveBtn">Save</button>
|
||||
<script>
|
||||
(function(){
|
||||
saveBtn.onclick = ()=>{
|
||||
const dict = {
|
||||
portable_type: "relative",
|
||||
portable_data: {
|
||||
user: user.value,
|
||||
documents: documents.value,
|
||||
downloads: downloads.value,
|
||||
desktop: desktop.value,
|
||||
pictures: pictures.value,
|
||||
videos: videos.value,
|
||||
music: music.value,
|
||||
config: config.value,
|
||||
cache: cache.value,
|
||||
data: data.value,
|
||||
state: state.value,
|
||||
temp: temp.value
|
||||
}
|
||||
};
|
||||
|
||||
const json = JSON.stringify(dict,null,'\t');
|
||||
const a = document.createElement('a');
|
||||
a.href = `data:text/json;charset=utf-8,${encodeURIComponent(json)}`;
|
||||
a.download="portable.json";
|
||||
a.click();
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user