Skip to content

Commit a7c52f6

Browse files
now the html save file is created with relative path for
images this correct a bug that was causing the restore project function working only until the program folder was moved from his original position.
1 parent 8680999 commit a7c52f6

File tree

155 files changed

+10999
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+10999
-124
lines changed

css/general.css

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,30 @@ body {
133133

134134

135135

136+
.modal-near-full {
137+
min-width: 65%;
138+
margin-left: 80;
139+
}
140+
141+
.modal-near-full .modal-content {
142+
min-height: 82vh;
143+
}
144+
145+
.modal-near-full .modal-header {
146+
min-height: 4vh;
147+
}
148+
149+
.modal-near-full .modal-body {
150+
max-height: 78vh;
151+
overflow: auto;
152+
}
153+
154+
155+
156+
157+
158+
159+
136160
.modal-center {
137161
margin-top: 30vh;
138162
min-width: 60vw;
@@ -154,9 +178,12 @@ body {
154178
}
155179

156180

181+
.full_width_window_image{
182+
width: 100%;
183+
float: right;
184+
}
157185

158-
159-
#mapRendered{
186+
.half_window_image{
160187
height: 81vh;
161188
float: right;
162189
}
@@ -300,4 +327,4 @@ body {
300327

301328
.textAreaWhite textarea{
302329
color: red
303-
}
330+
}

index.html

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515

1616

1717
<script type="text/javascript" src="js/draggable.js"></script>
18-
<script type="text/javascript" src="js/logic.js"></script>
18+
19+
<script type="text/javascript" src="js/PDF_logic.js"></script>
20+
<script type="text/javascript" src="js/save_project_logic.js"></script>
21+
1922
<script type="text/javascript" src="js/text_script.js"></script>
2023
<script type="text/javascript" src="js/loadTiles.js"></script>
2124
<script type="text/javascript" src="js/bootstrap_page.js"></script>
@@ -34,7 +37,7 @@
3437

3538
<body>
3639

37-
<input type="file" id="restorePageInputFile" accept="text/html" style="display:none"/>
40+
<input type="file" id="restorePageInputFile" accept="text/html" style="display:none" />
3841

3942
<div class="modal fade" id="loadProjectModal" tabindex="-1" role="dialog" aria-hidden="true">
4043
<div class="modal-dialog modal-full" role="document">
@@ -47,30 +50,33 @@ <h1 aria-hidden="true">×</h1>
4750
</div>
4851
<div class="modal-body p-4 funny_scrollbar_blue" id="result">
4952
<div class="row">
50-
<div class="col-12">
51-
<table class="bigtable table table-hover table-striped table-inverse table-responsive">
53+
<div class="col-8">
54+
<table class="bigtable table table-hover">
5255
<thead class="thead-inverse">
5356
<tr>
5457
<th>load</th>
5558
<th>cancel</th>
5659
<th>mission name</th>
57-
60+
5861
</tr>
5962
</thead>
6063
<tbody id="save_list">
61-
64+
6265
</tbody>
6366
</table>
6467
</div>
65-
68+
<div class="col-4">
69+
<image class="full_width_window_image" id="previewLoading"></image>
70+
</div>
71+
6672
</div>
6773
</div>
6874
</div>
6975
</div>
7076
</div>
7177

7278
<div class="modal fade" id="saveProjectModal" tabindex="-1" role="dialog" aria-hidden="true">
73-
<div class="modal-dialog modal-center" role="document">
79+
<div class="modal-dialog modal-near-full" role="document">
7480
<div class="modal-content">
7581
<div class="modal-header">
7682
<h2 class="modal-title">configure save</h2>
@@ -80,12 +86,18 @@ <h1 aria-hidden="true">×</h1>
8086
</div>
8187
<div class="modal-body p-4 funny_scrollbar_blue" id="result">
8288
<div class="row">
83-
<div class="col-4">
89+
<div class="col-7">
8490
<label class="labelBig">mission name :</label>
91+
<input class="labelBig" style="width: 100%" id="projectSaveName" type="text"
92+
class="form-control" placeholder="enter mission name">
93+
<br>
94+
<br>
95+
<label class="labelBig">description or notes :</label>
96+
<textarea class="labelBig" style="width: 100%" id="projectSaveNotes"
97+
style="resize: none;"></textarea>
8598
</div>
86-
<div class="col-8">
87-
<input class="labelBig" style="width: 100%" id="projectSaveName" type="text" class="form-control"
88-
placeholder="enter mission name">
99+
<div class="col-5">
100+
<image class="full_width_window_image" id="previewSaving"></image>
89101
</div>
90102
</div>
91103
</div>
@@ -152,7 +164,7 @@ <h3 class="labelBig">margin top</h3>
152164
</div>
153165
</div>
154166
<div class="col-6">
155-
<image id="mapRendered"></image>
167+
<image class="half_window_image" id="mapRendered"></image>
156168
</div>
157169
</div>
158170
</div>
@@ -172,9 +184,12 @@ <h3 class="labelBig">margin top</h3>
172184
<button class="blueButton" id="insideButton" onclick="loadBaseSetInside()">inside/outside</button>
173185
</div>
174186
<div class="sidenav funny_scrollbar_blue" id="baseSetOutside" style="visibility: ''">
187+
175188
<img src="assets/tiles/base/01A.png" set="baseSetOutside" orientation="0" single="yes" pieceType="tile"
176189
oncontextmenu="return false;" id="01A"
177190
style="position: absolute; cursor: move; width: 100%; z-index: -1; top: 20px; left: 0px;" onmap="no">
191+
192+
178193
<img src="assets/tiles/base/02A.png" set="baseSetOutside" orientation="0" single="yes" pieceType="tile"
179194
oncontextmenu="return false;" id="02A"
180195
style="position: absolute; cursor: move; width: 100%; z-index: -1; top: 235px; left: 0px;" onmap="no">
@@ -946,7 +961,7 @@ <h5 class="card-title" single="no" pieceType="text" draggable_trigger="true"></h
946961
</div>
947962
<div class="control_bar" id="control_bar" style="z-index: 0;">
948963
<!--<button class="craeteTextBoxButton" onclick="createTextBox()">insert text</button>-->
949-
<button class="blueButton" id="go_to_text_edit_button" onclick="goToTextEdit()">go to text edit</button>
964+
<button class="blueButton" onclick="goToExport()">go to text edit</button>
950965
<button class="blueButton" onclick="savePage()">save project</button>
951966
<button class="blueButton" onclick="loadSaveList()">load</button>
952967
<button class="blueButton" id="load_base_set_tiles" onclick="loadBaseSetOutside()">load base set</button>
@@ -956,7 +971,7 @@ <h5 class="card-title" single="no" pieceType="text" draggable_trigger="true"></h
956971
nerekhall</button>
957972
<button class="blueButton" onclick="loadTokens()">load tokes</button>
958973
<button class="blueButton" onclick="loadTextAreas()">load miscellaneous</button>
959-
974+
960975
</div>
961976

962977
</body>

index.js

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ const readFile = promisify(fs.readFile);
1212

1313
let win;
1414

15+
if (handleSquirrelEvent(app)) {
16+
// squirrel event handled and app will exit in 1000ms, so don't do anything else
17+
return;
18+
}
19+
1520
function createWindow () {
1621

1722
win = new BrowserWindow({
1823
width: 900,
19-
height: 600, icon : "icon.ico",
24+
height: 600, icon : "assets/icon.ico",
2025
webPreferences:{
2126
zoomFactor: 0.5,
2227
nodeIntegration: true
@@ -108,3 +113,72 @@ async function loadHTML(html){
108113
});
109114
document.body.appendChild(frag);
110115
};
116+
117+
function handleSquirrelEvent(application) {
118+
if (process.argv.length === 1) {
119+
return false;
120+
}
121+
122+
const ChildProcess = require('child_process');
123+
const path = require('path');
124+
125+
const appFolder = path.resolve(process.execPath, '..');
126+
const rootAtomFolder = path.resolve(appFolder, '..');
127+
const updateDotExe = path.resolve(path.join(rootAtomFolder, 'Update.exe'));
128+
const exeName = path.basename(process.execPath);
129+
130+
const spawn = function(command, args) {
131+
let spawnedProcess, error;
132+
133+
try {
134+
spawnedProcess = ChildProcess.spawn(command, args, {
135+
detached: true
136+
});
137+
} catch (error) {}
138+
139+
return spawnedProcess;
140+
};
141+
142+
const spawnUpdate = function(args) {
143+
return spawn(updateDotExe, args);
144+
};
145+
146+
const squirrelEvent = process.argv[1];
147+
switch (squirrelEvent) {
148+
case '--squirrel-install':
149+
case '--squirrel-updated':
150+
// Optionally do things such as:
151+
// - Add your .exe to the PATH
152+
// - Write to the registry for things like file associations and
153+
// explorer context menus
154+
155+
// Install desktop and start menu shortcuts
156+
spawnUpdate(['--createShortcut', exeName]);
157+
158+
setTimeout(application.quit, 1000);
159+
return true;
160+
161+
case '--squirrel-uninstall':
162+
// Undo anything you did in the --squirrel-install and
163+
// --squirrel-updated handlers
164+
165+
// Remove desktop and start menu shortcuts
166+
spawnUpdate(['--removeShortcut', exeName]);
167+
168+
setTimeout(application.quit, 1000);
169+
return true;
170+
171+
case '--squirrel-obsolete':
172+
// This is called on the outgoing version of your app before
173+
// we update to the new version - it's the opposite of
174+
// --squirrel-updated
175+
176+
application.quit();
177+
return true;
178+
}
179+
};
180+
181+
182+
183+
184+

0 commit comments

Comments
 (0)