Skip to content

Commit baf9a4a

Browse files
committed
Presentation mode is not complete, but it's ready for testing
1 parent 60bce48 commit baf9a4a

File tree

9 files changed

+53
-5
lines changed

9 files changed

+53
-5
lines changed

CREDITS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ i18n-node https://www.npmjs.com/package/i18n-node
1515
Atom Electron
1616
NodeJS
1717

18+
[Icons]
19+
Presentation icons made by EpicCoders and Freepik from www.flaticon.com
20+
1821
[HTML/CSS/JS]
1922
Twitter Bootstrap
2023
Split.js https://github.com/nathancahill/Split.js

css/index.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ body{
8383
margin-left:0;
8484
}
8585

86+
/**
87+
* Presentation modal
88+
*/
89+
.presentation-button{
90+
text-align: center;
91+
border-radius: 10px;
92+
padding-top: 20px;
93+
padding-bottom: 20px;
94+
}
95+
.presentation-button:hover{
96+
background-color: #f2f2f2;
97+
}
98+
.presentation-button img{
99+
width: 200px;
100+
}
101+
86102
/**
87103
* Editor and output
88104
*/

gfx/presentation/multi.png

2 KB
Loading

gfx/presentation/single.png

1.63 KB
Loading

index.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,21 @@ <h2 class="text-center">PHP Assistant <span id="version"></span></h2>
282282
<div class="modal-dialog">
283283
<div class="modal-content">
284284
<div class="modal-body">
285-
<button onclick="presentationSingle();">Single</button>
286-
<button onclick="presentationMulti();">Multi</button>
285+
286+
<!-- Choose presentation mode -->
287+
<div class="container-fluid">
288+
<div class="row">
289+
<div id="presentation-single-button" class="col-xs-6 presentation-button">
290+
<img src="gfx/presentation/single.png">
291+
<h2 data-string="Single Display Mode"></h2>
292+
</div>
293+
<div id="presentation-multi-button" class="col-xs-6 presentation-button">
294+
<img src="gfx/presentation/multi.png">
295+
<h2 data-string="Multi Display Mode"></h2>
296+
</div>
297+
</div>
298+
</div>
299+
287300
</div>
288301
<div class="modal-footer">
289302
<button type="button" class="btn btn-default" data-dismiss="modal" data-string="Close"></button>

js/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ function renderApp(refresh) {
118118

119119
$("*[data-event='sidebar-presentation']").click(checkPresentation); // Invoke checkPresentation();
120120

121+
// Presentation modal
122+
$("#presentation-single-button").click(presentationSingle);
123+
$("#presentation-multi-button").click(presentationMulti);
124+
121125
// Settings modal
122126
// "Save" button click
123127
$("#settings-save").click(saveSettings) // Invoke saveSettings()

js/presentation.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,8 @@ function multiLayoutOff() {
9494
ipc.send("asynchronous-message", "attach-output");
9595
$("*[data-event='sidebar-presentation']").removeClass("active");
9696
}
97+
98+
// Signal when output window is closed
99+
function outputClosed() {
100+
presentationEnd();
101+
}

locales/pt-BR.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
"Output": "Output",
7070
"Inscrease font size": "Aumentar tamanho da fonte",
7171
"Decrease font size": "Diminuir tamanho da fonte",
72-
"Presentation": "Presentation",
73-
"Try to open secondary window in another display": "Try to open secondary window in another display"
74-
}
72+
"Presentation": "Apresentação",
73+
"Try to open secondary window in another display": "Tentar abrir janela secundária em outro monitor",
74+
"Single Display Mode": "Modo Monitor Único",
75+
"Multi Display Mode": "Modo Múltiplos Monitores"
76+
}

main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ ipc.on('asynchronous-message', function(event, arg) {
161161

162162
outputWindow.loadURL('file://' + Path.join(__dirname, 'output.html'));
163163

164+
// We need to tell main window that output window was closed
165+
outputWindow.on('closed', function() {
166+
mainWindow.webContents.executeJavaScript('outputClosed();');
167+
});
168+
164169
// Debug
165170
if (debug)
166171
outputWindow.toggleDevTools();

0 commit comments

Comments
 (0)