-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
181 lines (161 loc) · 8.36 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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zText: Convertisseur en ligne Text vers 8xp</title>
<script src="FileSaver.min.js" async></script>
<script src="tivars_test.js" async></script>
<script src="pdf2text/pdf.js"></script>
<script src="pdf2text/functions.js"></script>
<script src="generator.js?new=4"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Geo' type='text/css'>
<link rel='stylesheet' href='style.css' type='text/css'>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<div class="reduced">
<h3 id="topTitle" style="display:none">zText: convertisseur pdf/texte => 8xp</h3>
<form id="convForm">
<section id="advancedCreator">
<p class="infos">Tape maintenant ton cours dans chaque partie, puis clique sur le bouton.</p>
<div class="step2"></div>
<div class="infos"></div>
</section>
<section id="simpleCreator">
<section id="viewerChoice">
Tu veux... un texte avec des :
<label class="radio-inline" title="Grosses lettres">
<input type="radio" name="whichViewer" value="smallViewer" checked> petites lettres
</label>
<label class="radio-inline" title="Petits lettres">
<input type="radio" name="whichViewer" value="largeViewer"> grosses lettres
</label>
.<br>
<i>(Chacun a des avantages et inconvénients : quantité/lisibilité...)</i>
</section>
<br>
<div class="hiddenWhenLargeViewer">
Tu souhaites organiser ton cours en plusieurs parties avec un menu ? <button id="toggleAdvanced" class="btn btn-success btn-xs">Clique-ici</button><br /><br />
Tu peux aussi charger le texte d'un fichier PDF :
<input type="file" id="pdfFile" onchange="handlePdf(this.files)"/>
<span class="loaderPdf" id="loaderPdf"></span>
<br /><br />
</div>
<div id="textareaWrapper">
<textarea id="myText0" title="Ton texte ici" name="myText0" placeholder="Écris ton texte dans cette zone" required></textarea>
</div>
</section>
<div class="row" style="text-align: center">
<div class="col-xs-12">
<label>
<input id="prgmName" type="text" pattern="^[a-zA-Z][a-zA-Z0-9]{0,7}$" maxlength="8" title="Caractères: A-Z, 0-9. Doit commencer par une lettre" value="TITRE" required/> ≤ 8 caract.
</label>
<button type="submit" id="genButton" class="btn btn-primary btn-sm" title="Télécharger le programme généré (fichier .8xp)">
<span class="glyphicon glyphicon-download-alt" aria-hidden="true"></span> Télécharger le .8xp
</button>
</div>
</div>
<p class="hiddenWhenLargeViewer">N'oublie pas d'également transférer <a href="https://tiplanet.org/modules/archives/download.php?id=1026785" target="_blank" download>le programme ZTEXT</a> sur ta calculatrice!</p>
<p class="hiddenWhenSmallViewer">N'oublie pas d'également transférer <a href="https://tiplanet.org/modules/archives/download.php?id=1052229" target="_blank" download>le programme STRVIEW</a> sur ta calculatrice!</p>
</form>
<br>
<h4>Calculatrice cible<span class="hiddenWhenLargeViewer"> et aperçu</span> :</h4>
<div>
<div class="choiceWrapper hiddenWhenLargeViewer">
<label class="radio-inline" title="TI-82 et 83 (vieux modèles)">
<input type="radio" name="target" value="83"> <img src="https://wiki.tiplanet.org/images/thumb/4/4d/TI-83.png/59px-TI-83.png"/>
</label>
</div>
<div class="choiceWrapper">
<label class="radio-inline" title="TI-82 Advanced et TI-83/84 Plus (SE)">
<input type="radio" name="target" value="82A"> <img src="https://wiki.tiplanet.org/images/thumb/e/e1/TI-82_Advanced.png/59px-TI-82_Advanced.png"/>
</label>
</div>
<div class="choiceWrapper">
<label class="radio-inline" title="TI-83 Premium CE / TI-84 Plus CE">
<input type="radio" name="target" value="83PCE"> <img src="https://i.imgur.com/VwKirhe.png"/>
</label>
</div>
<span id="chosenCalcName"></span>
<br>
<div class="hiddenWhenLargeViewer">
<br>
<div id="calcPreview">
<div class="statusBar">NORMAL FLOAT AUTO REAL RADIAN MP</div>
<div class="content"></div>
</div>
</div>
</div>
</div>
<p id="footer" class="text-right">
<small><i>Utilise le <a href="/forum/viewtopic.php?f=10&t=19901" target="_blank">lecteur</a> de Wistaro ou <a href="https://tiplanet.org/forum/viewtopic.php?f=10&t=19901&p=218752#p216988" target="_blank">celui</a> d'Anonyme0, et <a href="https://github.com/adriweb/tivars_lib_cpp" target="_blank">tivars_lib_cpp</a> d'Adriweb</i></small>
</p>
</div>
</div>
<script>
function inIframe() {
try {
return window.self !== window.top;
} catch (e) {
return true;
}
}
if (!inIframe()) {
$("#topTitle").show();
}
$("#viewerChoice input[name='whichViewer']").on('click', function()
{
window.whichViewer = $(this).val();
if (window.whichViewer === 'smallViewer')
{
$('.hiddenWhenLargeViewer').show();
$('.hiddenWhenSmallViewer').hide();
$('textarea').removeClass('withLargeViewer').removeAttr('cols');
} else {
$('.choiceWrapper input[value="83PCE"]').click();
$('.hiddenWhenLargeViewer').hide();
$('.hiddenWhenSmallViewer').show();
$('textarea').addClass('withLargeViewer').attr('cols', 26);
}
});
$("#toggleAdvanced").on('click', function(e)
{
e.preventDefault();
$("#simpleCreator, #advancedCreator").toggle();
setTimeout(startWizard, 100);
});
$("#convForm").on('submit', function(e)
{
e.preventDefault();
(window.whichViewer === 'smallViewer') ? generateCourseForSmallViewer() : generateCourseForLargeViewer();
return false;
});
$(".choiceWrapper input[type='radio']").on('change', function()
{
const calcInput = $(this);
chosenCalc = $(this).val();
$("#calcPreview").attr('class', 'calc' + chosenCalc);
$('textarea').attr('data-calc', chosenCalc);
$("#chosenCalcName").text(calcInput.parent().attr("title"));
})
.filter("[value='83PCE']").click(); /* initial/default value */
function registerPreviewHandler()
{
$("#myText0").on('keyup keypress blur change', function ()
{
let escaped = $("<div>").text($(this).val()).html();
escaped = escaped.replace(/\n/g, "<br>");
$("#calcPreview .content").html(escaped);
});
}
registerPreviewHandler();
</script>
</body>
</html>