jsHtml2Ods/demos/dev.html

102 lines
3.4 KiB
HTML
Raw Normal View History

2022-07-17 01:21:31 +02:00
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Exemple pour le développement</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<link href="dev.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../src/js/currency/Currency.js"></script>
<script type="text/javascript" src="../src/js/xmlwriter/XmlWriter.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.Elements.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.CellCounter.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.XmlWriter.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.Style.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.StyleManager.js"></script>
<script type="text/javascript" src="../src/js/opendocument/OpenDocument.OdsConverter.js"></script>
2022-07-27 17:04:18 +02:00
<script type="text/javascript" src="../src/js/Html2Ods.js"></script>
2022-07-17 01:21:31 +02:00
<script>
function fodsLink() {
let link = document.getElementById("link");
link.href = URL.createObjectURL(
2022-07-27 17:04:18 +02:00
Html2Ods.blob("table")
2022-07-17 01:21:31 +02:00
);
setTimeout(function () {
URL.revokeObjectURL(link.href);
}, 4E4); // 40s
return true;
}
function fodsContent() {
2022-07-27 17:04:18 +02:00
document.getElementById("text").innerText = Html2Ods.xml("table");
2022-07-17 01:21:31 +02:00
}
</script>
</head>
<body onload="fodsContent()">
<h1>Exemple pour le développement</h1>
<p>Le contenu du fichier .fods est affiché après la table</p>
<div>
2022-07-29 14:18:11 +02:00
<p><a href="blob:" download="test1.fods" id="link" onclick="fodsLink()">Version ODS</a></p>
2022-07-17 01:21:31 +02:00
<table id="table"
data-od-sheetname="Tableau de suivi"
data-od-currency="EUR"
data-od-fixed-rows="2"
data-od-fixed-columns="1">
<col data-od-style="Longue">
<colgroup>
2022-07-27 17:04:18 +02:00
<col data-od-style="Courte">
2022-07-17 01:21:31 +02:00
</colgroup>
2022-07-27 17:04:18 +02:00
<colgroup span="2" class="moyennecolonne">
2022-07-17 01:21:31 +02:00
</colgroup>
<thead>
<tr data-od-style="Entete">
<th colspan="3">Colonne 1</th>
<th rowspan="2">Colonne 3</th>
</tr>
<tr>
<th>Sous-colonne 1-1</th>
<th>Sous-colonne 1-2</th>
<th>Sous-colonne 1-3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cellule 1.1</td>
<td rowspan="2" id="test">Cellule <em>1.2</em>
<div class="hidden">
Caché par None
</div> Suite</td>
<td>Cellule 1.3
<div data-od-hidden="true">
Caché dans OD
</div> Test à des lignes vides </td>
2022-07-27 17:04:18 +02:00
<td data-od-style="Heritage">Cellule 1.4</td>
2022-07-17 01:21:31 +02:00
</tr>
<tr>
2022-07-27 17:04:18 +02:00
<td data-od-style="EncorePlusGrande">Cellule 2.1 (Très grande)</td>
2022-07-17 01:21:31 +02:00
<!--<td>Cellule 2.2</td>-->
<td data-od-style="Bold">Cellule 2.3</td>
<td data-od-type="number" class="grandecellule">-160</td>
</tr>
<tr>
2022-07-27 17:04:18 +02:00
<td colspan="2">Cellule 3.1</td>
<td data-od-type="currency" data-od-text="1250">1100 €</td>
2022-07-17 01:21:31 +02:00
<td data-od-type="currency" data-od-currency="USD" data-text="-1315" class="essai">-$2500</td>
2022-07-29 14:18:11 +02:00
</tr>
<tr>
<td data-od-type="date" data-od-text="2020-12-01">01/12/2020</td>
<td data-od-type="date" data-od-text="2021-01-11">11/01/2021</td>
</tr>
<tr>
<td>Exemple de correspondance de plusieurs classes</td>
<td class="class1">Classe 1</td>
<td class="class2">Classe 2</td>
</tr>
2022-07-17 01:21:31 +02:00
</tbody>
</table>
<pre id="text"></pre>
</div>
</body>
</html>