Ver código fonte

First Commit

François Gautrais 8 anos atrás
commit
283c1a9564
28 arquivos alterados com 2286 adições e 0 exclusões
  1. 12 0
      LICENSE
  2. 1 0
      README
  3. 4 0
      css/bootstrap.min.css
  4. 223 0
      css/cv.css
  5. 73 0
      css/cvgen.css
  6. 58 0
      cv.html
  7. 285 0
      cvgen.html
  8. 0 0
      data/cv.json
  9. 58 0
      demo.html
  10. BIN
      icons/audio.png
  11. 38 0
      icons/index.html
  12. BIN
      icons/package.png
  13. BIN
      icons/photo.jpg
  14. BIN
      icons/unknown.png
  15. BIN
      icons/video.png
  16. 1 0
      js/FileSaver.min.js
  17. 48 0
      js/background.js
  18. 5 0
      js/bootstrap.min.js
  19. 367 0
      js/content.js
  20. 344 0
      js/cv.js
  21. 121 0
      js/cvgen.js
  22. 326 0
      js/info.js
  23. 1 0
      js/jquery.min.js
  24. 145 0
      js/reglages.js
  25. 0 0
      js/trianglify.min.js
  26. 81 0
      server/archive.php
  27. 77 0
      server/download.php
  28. 18 0
      server/ping.php

+ 12 - 0
LICENSE

@@ -0,0 +1,12 @@
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

+ 1 - 0
README

@@ -0,0 +1 @@
+Copier le répertoire source (contenant ce fichier) vers l'arborescence de votre serveur Web.

Diferenças do arquivo suprimidas por serem muito extensas
+ 4 - 0
css/bootstrap.min.css


+ 223 - 0
css/cv.css

@@ -0,0 +1,223 @@
+
+body {
+    margin-bottom: 50px;
+    margin-right: 5%;
+    margin-left: 5%;
+}
+
+.title 
+{
+  background-color: transparent;
+  display: inline-block;
+  text-align: center;
+}
+
+.firstcontainer 
+{
+  background-color: rgba(120, 120, 120, 0.50);
+  border-radius: 10px;
+}
+
+.secondcontainer {
+  
+  margin-right: 80px;
+  margin-left: 80px;
+  margin-top: 10px;
+  margin-bottom: 20px;
+}
+.content {
+  padding-bottom: 60px;
+}
+
+
+
+
+.left-bar{
+  border-color:transparent;
+  padding: 0px;
+}
+
+.color-first {
+  background-color: #EEE;
+}
+
+.color-second {
+  background-color: #CCC;
+}
+
+.left-bar-ul {
+  margin-top: 0%;
+  margin-bottom: 0%;
+  margin-right: 0%;
+  margin-left: 0%;
+  background-color: transparent;
+}
+
+.left-bar-ul-2 {
+  margin-top: 0px;
+  margin-bottom: 10px;
+  padding-right: 10px;
+  padding-left: 10px;
+  border: 2px solid #ddd;
+  border-radius: 4px;
+}
+
+.cv-section {
+  background-color: #EEE;
+  margin-top: 0px;
+  margin-bottom: 10px;
+  margin-right: 0px;
+  margin-left: 0px;
+  border: 2px solid !important;
+  border-color: #EEE !important;
+  border-radius: 5px;
+}
+
+.cv-entry {
+  border-width: 1px;
+  margin-top: 0px;
+  margin-bottom: 0px;
+  margin-right: 0px;
+  margin-left: 0px;
+}
+
+.section-title {
+  text-align: center;
+  margin-top: 0px;
+  margin-bottom: 5px;
+  margin-right: 0px;
+  margin-left: 0px;
+}
+
+.cv-header {
+  position: relative;
+  padding-top: 10px;
+  
+}
+
+.cv-entry-dsec {
+  margin-bottom: 10px !important;
+  margin-left: 10px !important;
+  margin-right: 10px !important;
+  display: none;
+}
+
+.profiles {
+  padding-top: 30px;
+  padding-bottom: 30px;
+  margin-left: 30px;
+}
+
+.profiles-container{
+}
+
+.profiles-btn{
+  border-radius: 4px !important; 
+  margin-left:5px !important;
+  background-color: transparent !important;
+  color: black;
+  border-color: #EEE;
+}
+
+.profiles-ck{
+  margin-right: 2px;
+}
+
+
+.left-bar-value{
+  float: right;
+  text-align: right;
+}
+
+body > canvas {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: -10;
+}
+
+p {
+  font-size: 10px;
+}
+
+.main-entry {
+  background-color: transparent;
+  border: 1px;
+  border-radius: 5px;
+}
+
+.transparent {
+  background-color: transparent;
+}
+
+.li-icon{
+  margin-right: 5px;
+}
+
+
+@media (max-width: 978px) {
+    .container {
+      padding:0;
+      margin:0;
+    }
+
+    body {
+      padding:0;
+      margin: 5px;
+    }
+
+    .navbar-fixed-top, .navbar-fixed-bottom, .navbar-static-top {
+      margin-left: 0;
+      margin-right: 0;
+      margin-bottom:0;
+    }
+    
+    .content {
+      margin-left: 2%;
+      margin-right: 2%;
+    }
+    
+    .main{
+      margin-top: 40px;
+      padding: 0px;
+    }
+    
+    a{
+      font-size: 10px;
+    }
+    
+    .left-bar{
+      border-color:transparent;
+      padding-left: 10%;
+      padding-right: 10%;
+    }
+    
+    h1 {
+      font-size: 20px;
+    }
+    
+    
+    h2 {
+      font-size: 16px;
+    }
+    
+    
+    h3 {
+      font-size: 16px;
+    }
+    
+    .profiles {
+      padding-top: 30px;
+      padding-bottom: 30px;
+      margin-left: 20px;
+      margin-right: 30px;
+    }
+    
+    .secondcontainer {
+  
+      margin-right: 0px;
+      margin-left: 0px;
+      margin-top: 10px;
+      margin-bottom: 20px;
+    }
+}

+ 73 - 0
css/cvgen.css

@@ -0,0 +1,73 @@
+@font-face {
+    font-family: 'source_sans_probold';
+    src: url('fonts/sourcesanspro-bold-webfont.eot');
+}
+@font-face {
+    font-family: 'source_sans_probold';
+    src: url('fonts/sourcesanspro-bold-webfont.ttf') format('truetype');
+    font-weight: normal;
+    font-style: normal;
+}
+@font-face {
+    font-family: 'source_sans_proregular';
+    src: url('fonts/sourcesanspro-regular-webfont.eot');
+}
+@font-face {
+    font-family: 'source_sans_proregular';
+    src: url('fonts/sourcesanspro-regular-webfont.ttf') format('truetype');
+    font-weight: normal;
+    font-style: normal;
+}
+
+/* =================================================
+   2 - General
+   ================================================= */
+body {
+    font-family: 'Roboto', sans-serif;
+}
+
+body > canvas {
+    position: fixed;
+    top: 0;
+    left: 0;
+    z-index: -10;
+}
+
+.hidden {
+	display: none;
+}
+
+.form-entry{
+	margin-bottom: 10px;
+}
+
+li.active {
+    border-bottom:1px solid white;
+}
+
+.hsection {
+	background-color: rgba(176,176,176,0.64);
+	padding: 10px;
+	
+	border-radius: 5px;
+	border: 2px solid #EEE;
+}
+
+.container {
+	background-color: rgba(60,60,60,0.64);
+	margin-top: 5%;
+	margin-bottom: 5%;
+	padding-bottom: 15px;
+	padding-left: 15px;
+	padding-right: 15px;
+	border-radius: 5px;
+}
+
+.tab-pane-top {
+	background-color: rgba(60,60,60,0.64);
+	border-radius: 5px;
+}
+
+
+
+

+ 58 - 0
cv.html

@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <title></title>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+ <!--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
+  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script><!-->
+  
+  <link rel="stylesheet" href="css/bootstrap.min.css">
+  <link rel="stylesheet" href="css/cv.css">
+  
+  <script src="js/jquery.min.js"></script>
+  <script src="js/bootstrap.min.js"></script>
+  <script src="js/trianglify.min.js"></script>
+  <script src="js/cv.js"></script>
+  <script type="text/javascript" >
+    set_json_url("data/cv.json");
+  </script>
+</head>
+<body>
+<script type="text/javascript" src="js/background.js"></script>
+
+
+
+
+<main>
+  </div>
+    <div id="profilesroot" class="profiles"> </div>
+    <div class="firstcontainer">
+      
+      <div class="cv-header">
+        <div class="secondcontainer " id="title"></div>
+      </div>
+      
+      <div class="list-group secondcontainer content" >
+        <span class="row" id="rootnode">
+          <div class="col-md-3 col-sm-12  col-xs-12 left-bar" id="left-bar">
+            <div class="left-bar-ul-2 " id="image"> </div>
+          </div>    
+        
+        <!-- ------------------------------------------------------------------------------------------------------------------ -->
+    
+
+        
+        <!-- ------------------------------------------------------------------------------------------------------------------ -->
+        
+        
+         
+        
+        </span>
+      </div>
+    </div>
+</main>
+
+</body>
+</html>

+ 285 - 0
cvgen.html

@@ -0,0 +1,285 @@
+
+<!DOCTYPE html>
+<html lang="fr">
+<head>
+  <title></title>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+ <!--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
+  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script><!-->
+  
+  <link rel="stylesheet" href="css/bootstrap.min.css">
+  <link rel="stylesheet" href="css/cvgen.css">
+  
+  <script src="js/jquery.min.js"></script>
+  <script src="js/bootstrap.min.js"></script>
+  <script src="js/FileSaver.min.js"></script>
+  <script src="js/trianglify.min.js"></script>
+  <script src="js/reglages.js"></script>
+  <script src="js/info.js"></script>
+  <script src="js/content.js"></script>
+  <script src="js/cvgen.js"></script>
+  <script type="text/javascript" >
+  </script>
+</head>
+<body>
+<script type="text/javascript" src="js/background.js"></script>
+
+
+
+
+<main>
+	
+
+	
+	<div class="container">
+		<div>
+			<h2>Génération dynamique de CV</h2>
+			
+		</div>
+		
+		
+		
+		
+		<div>
+			<ul class="nav nav-tabs">
+				<li class="active"><a data-toggle="tab" class="tab-pane-top" href="#tab0">Réglages</a></li>
+				<li><a data-toggle="tab" class="tab-pane-top" href="#tab1">Informations générales</a></li>
+				<li><a data-toggle="tab" class="tab-pane-top" href="#tab2">Contenu</a></li>
+			</ul>
+			
+		</div>
+
+
+		<div class="tab-content">
+			
+			<div id="tab0" class="tab-pane active">
+				<h3>Réglages</h3>
+				<div class="form">
+					<div class="form-entry row">
+						<label class="control-label col-sm-2">Titre:</label>
+						<div class="col-sm-10">
+							<input type="text" class="form-control" id="input_0_titre" placeholder="Entrer le titre"></input>
+						</div>
+					</div>
+					
+					<div class="form-entry row">
+						<label class="control-label col-sm-2"> Photo: </label>
+						<div style="position:relative;" class="col-sm-10 row">
+								<div class="col-sm-4"><input type="file" id="input_0_file" onchange="reg_changefile()"></input></div>
+								<div class="col-sm-8"><input type="text" class="form-control" id="input_0_fileinput" placeholder="Chemin (depuis le serveur)"></input></div>
+							&nbsp;
+							<span class='label label-info' id="upload-file-info"></span>
+						</div>
+					</div>
+					
+					<div class="form-entry row">
+						<label class="control-label col-sm-2 "> Profils: </label>
+						<div class="col-sm-10 col-md-3">
+							<table id="input_0_prof_table">
+								<tr> <td> <h4><b>Id</b></h4> </td> <td><h4><b>Etiquette</b></h4></td> <td></td> </tr>
+								<tr id="input_0_prof_tr"> <td><input type='text' id='input_0_prof_id' placeholder="ID"></td> <td><input type='text' id='input_0_prof_label' placeholder="Etiquette"></input></td> <td><button class="btn btn-default glyphicon glyphicon-plus" onclick="add_form_profils()"></button></td></tr>
+							</table> 
+						</div>
+					</div>
+					
+				</div>
+			</div>
+			
+		
+			
+			
+			<div id="tab1" class="tab-pane">
+				<div style="padding-left: 15px;  padding-right: 15px;">
+					<h3>Informations générales</h3>
+					<div class="row" style="padding-left: 5px;">
+						<span class="list-group col-md-3" >
+							<div class="hsection">
+								<h4>Catégories</h4>
+								
+								<div class="row" style="padding-left:15px; padding-right:15px">
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-up" onclick="info_cat_up()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-down" onclick="info_cat_down()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-minus" onclick="info_cat_del()"></button></span>
+									<div class="col-md-12 row" style="padding-left:15px; padding-right:5px">
+										<span class="col-md-11 row" ><input  text="text" style="width: 100%" id="input_1_cat" placeholder="Nom de la catégorie"></input></span>
+										<span class="col-md-1"><button class="btn btn-default glyphicon glyphicon-arrow-down" onclick="info_cat_add()"></button></span>
+									</div>
+								</div>
+								
+								<div class="list-group" id="input_1_cat_list">
+								</div>
+								
+							</div>
+						</span>
+						
+						<span class="col-md-9 row" style="margin-left:15px; display:none" id="input_1_root">
+								<div class="hsection" style="padding-left: 20px; padding-right: 20px;">
+								<div class="row">
+									<span class="col-md-2"><h4>Catégorie</h4></span>
+									<span class="col-md-3"><input  text="text" id="input_1_cat_rename" placeholder="Nom de la catégorie"></input></span>
+									<span class="col-md-1"><button class="btn btn-default glyphicon glyphicon-ok" onclick="info_cat_rename()"></button></span>
+								</div>
+								
+								<div class="row">
+									<span class="col-md-2"><h4 style="float: left">Section</h4></span>
+									<span class="col-md-8"><h4>Contenu</h4></span>
+									<span class="col-md-1"><h4>Valider</h4></span>
+								</div>
+								<div id="input_1_kv_list">
+									
+								</div>
+							</div>
+							
+							<div class="row">
+								<div class="col-md-2" id="input_1_kv_list_add" ><button class="btn btn-default glyphicon glyphicon-plus" onclick="info_kv_add()"> Ajouter </button></div>
+							</div>
+						</span>	
+					</div>
+				</div>
+			</div>
+			
+			
+			<div id="tab2" class="tab-pane">
+				<div style="padding-left: 15px;">
+					<h3>Contenu</h3>
+					<div class="row" style="padding-left: 5px;">
+						
+						<!-- Sections --> 
+						<span class="list-group col-md-3" id="input_2_sect_root" >
+							<div class="hsection">
+								<h4>Sections</h4>
+								
+								<div class="row" style="padding-left:15px; padding-right:15px">
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-up" onclick="cont_sect_up()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-down" onclick="cont_sect_down()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-minus" onclick="cont_sect_del()"></button></span>
+									<div class="col-md-12 row" style="padding-left:15px; padding-right:5px">
+										<span class="col-md-11 row" ><input  text="text" style="width: 100%" id="input_2_sect" placeholder="Nom de la section"></input></span>
+										<span class="col-md-1"><button class="btn btn-default glyphicon glyphicon-arrow-down" onclick="cont_sect_add()"></button></span>
+									</div>
+								</div>
+							
+							
+								
+								<div class="list-group" id="input_2_sect_list">
+								</div>
+							</div>
+						</span>
+						
+						<!-- Items -->
+						<span class="list-group col-md-3" id="input_2_itm_root" style="display:none">
+							<div class="hsection">
+								<div class="row">
+									<span><label class="col-md-2 control-label">Nom:</label></span>
+									<span><input class="col-md-7" type="text" id="input_2_sect_rename" placeholder="Nom de la section"></input></span>
+									<span><button class="col-md-2 btn btn-default glyphicon glyphicon-ok" onclick="cont_sect_rename()"></button></span>
+								</div>
+								<h4>Items</h4>
+								<div class="row" style="padding-left:15px; padding-right:15px">
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-up" onclick="cont_itm_up()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-arrow-down" onclick="cont_itm_down()"></button></span>
+									<span><button class="col-md-4 btn btn-default glyphicon glyphicon-minus" onclick="cont_itm_del()"></button></span>
+									<div class="col-md-12 row" style="padding-left:15px; padding-right:5px; margin-top:5px">
+										<span><input class="col-md-9" type="text" id="input_2_itm" placeholder="Nom de l'item"></input></span>
+										<span><button class="col-md-2 btn btn-default glyphicon glyphicon-arrow-down" onclick="cont_itm_add()"></button></span>
+									</div>
+								</div>
+								<div class="list-group" id="input_2_itm_list">
+								</div>
+							</div>
+						</span>
+						
+						<!-- Contenu -->
+						<span class="list-group col-md-6" id="input_2_content_list" style="display:none">
+							<div class="hsection">
+								<div class="form-entry row ">
+									<label class="control-label col-sm-2">Nom:</label>
+									<div class="col-sm-8">
+										<input class="form-control" id="input_2_itm_rename" placeholder="Entrer le nom" type="text">
+									</div>
+									<span class="col-md-2"><button class="btn btn-default glyphicon glyphicon-ok" style="display: block; width: 100%;" onclick="cont_cont_rename()"></button></span>
+								</div>
+								
+								<div class="form-entry row">
+									<label class="control-label col-sm-2">Contenu:</label>
+									<div class="col-sm-10">
+										<input class="form-control" id="input_2_itm_title" placeholder="Entrer le titre" type="text">
+									</div>
+								</div>
+								
+								<div class="form-entry row">
+									<label class="control-label col-sm-2">Date:</label>
+									<div class="col-sm-10">
+										<input class="form-control" id="input_2_itm_date" placeholder="Entrer la date (facultatif)" type="text">
+									</div>
+								</div>
+								
+								<div class="form-entry row">
+									<label class="control-label col-sm-2">Lieu:</label>
+									<div class="col-sm-10">
+										<input class="form-control" id="input_2_itm_location" placeholder="Entrer le lieu (facultatif)" type="text">
+									</div>
+								</div>
+								
+								<div class="form-entry row">
+									<label class="control-label col-sm-2">Profils:</label>
+									<div class="col-sm-10" id="input_2_itm_profils_list">
+									</div>
+								</div>
+								
+								<div class="form-entry row">
+									<label class="control-label col-sm-2">Commentaire:</label>
+									<div class="col-sm-10">
+										<textarea class="form-control" rows="5"  id="input_2_itm_more" placeholder="Informations supplémentaires facultatives"></textarea>
+									</div>
+								</div>
+								
+								<div class="form-entry row">
+									<button class="btn btn-primary col-sm-2 col-md-offset-9" onclick="cont_cont_save()">Sauver</button>
+								</div>
+							</div>
+						</span>
+						
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="col-sm-1">
+			<button type="button" class="btn btn-default" onclick="test()">Exporter</button>
+		</div>
+		
+			<div class="col-sm-1" >
+				<button type="button" class="btn btn-default" id="button_open" onclick="load_json()">Importer</button>
+				<div id="input_open" class="hidden">
+					<form method="post" id="fileinfo"  onsubmit="return submitForm();">
+						<input type="file" name="uploadFile" class="btn btn-default"/>
+						<input type="submit" value="Importer" name="submit" class="btn btn-default"/>
+					</form>
+				</div>
+		</div>
+		
+		
+		<div class="col-sm-1 col-sm-offset-6" >
+				<button type="button" class="btn btn-default" id="button_distrib" onclick="toggle_distribe()">Distribuer</button>
+				<div id="input_open_image" class="hidden">
+					<form method="post" id="fileinfoimage"  onsubmit="return submitFormImage();">
+						<p class="btn btn-default">Photo de présentation:<input type="file" name="uploadFileImage" class="btn btn-default"/></p>
+						<input type="submit" value="Télécharger" name="submit" class="btn btn-default"/>
+					</form>
+				</div>
+		</div>
+		
+		<div class="col-sm-1" style="margin-left: 10px" >
+			<form method="get" action="server/download.php">
+				<button type="submit" class="btn btn-default" >Télécharger l'application</button>
+			</form>
+		</div>
+		
+		<a id="a1" class="hidden" download='cv.tar.gz'></a>
+	</div>
+</main>
+
+</body>
+</html>

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
data/cv.json


+ 58 - 0
demo.html

@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <title></title>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+ <!--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
+  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script><!-->
+  
+  <link rel="stylesheet" href="css/bootstrap.min.css">
+  <link rel="stylesheet" href="css/cv.css">
+  
+  <script src="js/jquery.min.js"></script>
+  <script src="js/bootstrap.min.js"></script>
+  <script src="js/trianglify.min.js"></script>
+  <script src="js/cv.js"></script>
+  <script type="text/javascript" >
+    set_json_url("data/demo.json");
+  </script>
+</head>
+<body>
+<script type="text/javascript" src="js/background.js"></script>
+
+
+
+
+<main>
+  </div>
+    <div id="profilesroot" class="profiles"> </div>
+    <div class="firstcontainer">
+      
+      <div class="cv-header">
+        <div class="secondcontainer " id="title"></div>
+      </div>
+      
+      <div class="list-group secondcontainer content" >
+        <span class="row" id="rootnode">
+          <div class="col-md-3 col-sm-12  col-xs-12 left-bar" id="left-bar">
+            <div class="left-bar-ul-2 " id="image"> </div>
+          </div>    
+        
+        <!-- ------------------------------------------------------------------------------------------------------------------ -->
+    
+
+        
+        <!-- ------------------------------------------------------------------------------------------------------------------ -->
+        
+        
+         
+        
+        </span>
+      </div>
+    </div>
+</main>
+
+</body>
+</html>

BIN
icons/audio.png


+ 38 - 0
icons/index.html

@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <title>Bootstrap Example</title>
+  <meta charset="utf-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
+  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
+</head>
+<body>
+
+<div class="container">
+  <div class="jumbotron">
+    <h1>My First Bootstrap Page</h1>
+    <p>Resize this responsive page to see the effect!</p> 
+  </div>
+  <div class="row">
+    <div class="col-sm-4">
+      <h3>Column 1</h3>
+      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
+      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
+    </div>
+    <div class="col-sm-4">
+      <h3>Column 2</h3>
+      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
+      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
+    </div>
+    <div class="col-sm-4">
+      <h3>Column 3</h3>        
+      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
+      <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris...</p>
+    </div>
+  </div>
+</div>
+
+</body>
+</html>

BIN
icons/package.png


BIN
icons/photo.jpg


BIN
icons/unknown.png


BIN
icons/video.png


Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
js/FileSaver.min.js


+ 48 - 0
js/background.js

@@ -0,0 +1,48 @@
+
+function pickColor() {
+    //var fullChoices = ['YlGn','YlGnBu','GnBu','BuGn','PuBuGn','PuBu','BuPu','RdPu','PuRd','OrRd','YlOrRd','YlOrBr','Purples','Blues','Greens','Oranges','Reds','Greys','PuOr','BrBG','PRGn','PiYG','RdBu','RdGy','RdYlBu','Spectral','RdYlGn'];
+    var choices = ['YlGn','YlGnBu','GnBu','BuGn','PuBuGn','PuBu','BuPu','OrRd','YlOrRd','YlOrBr','Blues','Greens','Oranges','Reds','Greys','PuOr','BrBG','PRGn','RdBu','RdGy','RdYlBu','Spectral','RdYlGn'];
+    var i = Math.floor(Math.random() * choices.length );
+    return choices[i];
+};
+
+function initTrianglify() {
+    // set up the base pattern
+    var pattern = Trianglify({
+        width: window.innerWidth,
+        height: window.innerHeight,
+        cell_size: 20 + Math.random() * 50,
+        //x_colors: 'random',
+        x_colors: pickColor(),
+        y_colors: pickColor(),
+        variance: 0.33 + Math.random() * 2 / 3,
+    });
+    document.body.appendChild(pattern.canvas());
+    return pattern;
+};
+
+function updateTrianglify(pattern) {
+    pattern = pattern.data;
+    /* console.log(pattern.opts.height); */
+    pattern = Trianglify({
+        width: window.innerWidth,
+        height: window.innerHeight,
+        cell_size: pattern.opts.cell_size,
+        //x_colors: 'random',
+        x_colors: pattern.opts.x_colors,
+        y_colors: pattern.opts.y_colors,
+        variance: pattern.opts.variance,
+    });
+    $('canvas').remove();
+    document.body.appendChild(pattern.canvas());
+};
+
+/* We need to remember pattern, in order to modify it */
+var pattern = initTrianglify();
+var resizeTimer;
+
+$(window).resize(pattern, function(pattern) {
+        clearTimeout(resizeTimer);
+        resizeTimer = setTimeout(updateTrianglify(pattern), 500);
+    });
+$(window).resize(pattern, updateTrianglify);

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
js/bootstrap.min.js


+ 367 - 0
js/content.js

@@ -0,0 +1,367 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+var sect_count=0;
+var sect_active=-1;
+var cont_sect=[];
+
+var sect_count=0;
+var itm_count=0;
+var itm_active=-1;
+var cont_tmpids=0;
+var itm_tmpids=0;
+
+// ------------------------------------------------
+// Sections
+// ------------------------------------------------
+
+function cont_get_sect_index(id)
+{
+	var i;
+	for(i=0; i<cont_sect.length; i++)
+		if(cont_sect[i].id == id)
+			return i;
+	return 0;
+}
+
+function cont_sect_show()
+{
+	var sect = cont_get_sect_index(sect_active);
+	var i;
+	$('#input_2_sect_rename').val(cont_sect[sect].title);
+	$('#input_2_itm_list').empty();
+	for(i=0; i<cont_sect[sect].sections.length; i++)
+	{
+		cont_itm_add(cont_sect[sect].sections[i]);
+	}
+}
+
+function cont_sect_select(x)
+{
+	var y = false;
+	if(x==sect_active) return;
+	$("#input_2_sect_list a").removeClass("active");
+	$("#input_2_sect_"+x).addClass('active');
+	if(sect_active==-1) y=true;
+	sect_active=x;
+	
+	cont_sect_show();
+	
+	$('#input_2_content_list').hide();
+	$('#input_2_itm_root').hide();
+	$('#input_2_itm_root').show(400);
+}
+
+function cont_sect_up()
+{
+	if(sect_active<0) return 0;
+	var i;
+	for(i=1; i<cont_sect.length; i++)
+	{
+		if(cont_sect[i].id==sect_active)
+		{
+			var x = $('#input_2_sect_'+cont_sect[i].id);
+			x.remove();
+			x.insertBefore('#input_2_sect_'+cont_sect[i-1].id);
+			
+			var a = cont_sect[i];
+			cont_sect[i]=cont_sect[i-1];
+			cont_sect[i-1]=a;
+			
+			break;
+		}
+	}
+}
+
+
+function cont_sect_down()
+{
+	if(sect_active<0) return 0;
+	var i;
+	for(i=0; i<cont_sect.length-1; i++)
+	{
+		if(cont_sect[i].id==sect_active)
+		{
+			var x = $('#input_2_sect_'+cont_sect[i].id);
+			x.remove();
+			x.insertAfter('#input_2_sect_'+cont_sect[i+1].id);
+			
+			
+			var a = cont_sect[i];
+			cont_sect[i]=cont_sect[i+1];
+			cont_sect[i+1]=a;
+			
+			break;
+		}
+	}
+}
+
+function cont_sect_del()
+{
+	if(sect_count<0) return;
+	var x = cont_get_sect_index(sect_active);
+	
+	$('#input_2_sect_'+sect_active).remove();
+	cont_sect.splice(x, 1);
+	
+	
+	sect_active=-1;
+	$('#input_2_itm_root').hide(400);
+	$('#input_2_content_list').hide(400);
+}
+
+function cont_sect_add(obj)
+{
+	obj = (typeof obj === 'undefined') ? null : obj;
+	sect_count++;
+	var id;
+	if(obj==null)
+	{
+		id=sect_count;
+		text=$("#input_2_sect").val();
+		cont_sect.push({ "id" : id, "title" : $("#input_2_sect").val(), sections : [] });
+	}else
+	{
+		id=cont_tmpids++;
+		text=obj.title;
+		obj.id=id;
+	}
+	
+	var o = $('<a class="list-group-item" onclick="cont_sect_select('+id+')" id="input_2_sect_'+id+'">'+ text +'</a>');
+	$('#input_2_sect_list').append(o);
+	$("#input_2_sect").val("");
+}
+
+
+function cont_sect_rename()
+{
+	console.log(JSON.stringify(cont_sect));
+	var i = cont_get_sect_index(sect_active);
+	$("#input_2_sect_"+sect_active).html($('#input_2_sect_rename').val());
+	cont_sect[i].title=$('#input_2_sect_rename').val();
+	console.log(JSON.stringify(cont_sect));
+	console.log("\n\n");
+}
+
+// ------------------------------------------------
+// Items
+// ------------------------------------------------
+
+function cont_get_itm_index(sect, id)
+{
+	var i;
+	for(i=0; i<cont_sect[sect].sections.length; i++)
+		if(cont_sect[sect].sections[i].id == id)
+			return i;
+	return 0;
+}
+
+function cont_itm_show()
+{
+	var sect = cont_get_sect_index(sect_active);
+	var itm = cont_get_itm_index(sect, itm_active);
+	var i;
+	$('#input_2_itm_rename').val(cont_sect[sect].title);
+	
+	$("#input_2_itm_rename").val(cont_sect[sect].sections[itm].name);
+	$("#input_2_itm_title").val(cont_sect[sect].sections[itm].content);
+	$("#input_2_itm_date").val(cont_sect[sect].sections[itm].date);
+	$("#input_2_itm_location").val(cont_sect[sect].sections[itm].location);
+	$("#input_2_itm_more").val(cont_sect[sect].sections[itm].more);
+	
+	$('#input_2_itm_profils_list').empty();
+	var reg = get_regs();
+	for(i=0; i<reg.profiles.length; i++)
+	{
+		var state = "";
+		var j;
+		if(cont_sect[sect].sections[itm].profiles)
+			for(j=0; j<cont_sect[sect].sections[itm].profiles.length; j++)
+			{
+				if(cont_sect[sect].sections[itm].profiles[j] == reg.profiles[i][0])
+				{
+					state="checked='true'";
+					break;
+				}
+			}
+		
+		$('#input_2_itm_profils_list').append($('<div><label class="btn btn-primary profiles-btn"><input class="profiles-ck" '+state+' autocomplete="off" id="input_2_prof_'+reg.profiles[i][0]
+						+'" type="checkbox">'+reg.profiles[i][1]+'</label></div>'));
+		
+	}	
+}
+
+function cont_itm_select(x)
+{
+	var y = false;
+	if(x==itm_active) return;
+	$("#input_2_itm_list a").removeClass("active");
+	$("#input_2_itm_"+x).addClass('active');
+	if(itm_active==-1) y=true;
+	itm_active=x;
+	cont_itm_show();
+	$('#input_2_content_list').hide();
+	$('#input_2_content_list').show(400);
+}
+
+function cont_itm_up()
+{
+	if(itm_active<0) return 0;
+	var i;
+	var sect = cont_get_sect_index(itm_active);
+	console.log(JSON.stringify(cont_sect));
+	for(i=1; i<cont_sect[sect].sections.length; i++)
+	{
+		if(cont_sect[sect].sections[i].id==itm_active)
+		{
+			var x = $('#input_2_itm_'+cont_sect[sect].sections[i].id);
+			x.remove();
+			x.insertBefore('#input_2_itm_'+cont_sect[sect].sections[i-1].id);
+			
+			var a = cont_sect[sect].sections[i];
+			cont_sect[sect].sections[i]=cont_sect[sect].sections[i-1];
+			cont_sect[sect].sections[i-1]=a;
+			
+			break;
+		}
+	}
+}
+
+
+function cont_sect_down()
+{
+	if(sect_active<0) return 0;
+	var i;
+	for(i=0; i<cont_sect.length-1; i++)
+	{
+		if(cont_sect[i].id==sect_active)
+		{
+			var x = $('#input_2_sect_'+cont_sect[i].id);
+			x.remove();
+			x.insertAfter('#input_2_sect_'+cont_sect[i+1].id);
+			
+			
+			var a = cont_sect[i];
+			cont_sect[i]=cont_sect[i+1];
+			cont_sect[i+1]=a;
+			
+			break;
+		}
+	}
+}
+
+function cont_itm_del()
+{
+	if(itm_active<0) return;
+	var x = cont_get_sect_index(sect_active);
+	var y = cont_get_sect_index(x, itm_active);
+	
+	$('#input_2_itm_'+itm_active).remove();
+	cont_sect[x].sections.splice(y, 1);
+	
+	itm_active=-1;
+	$('#input_2_content_list').hide(400);
+}
+
+function cont_itm_add(obj)
+{
+	obj = (typeof obj === 'undefined') ? null : obj;
+	
+	itm_count++;
+	
+	var id;
+	if(obj==null)
+	{
+		id=itm_count;
+		text=$("#input_2_itm").val();
+	}else
+	{
+		id=itm_tmpids++;
+		text=obj.name;
+		obj.id=id;
+	}
+	
+	var sect = cont_get_sect_index(sect_active);
+	var o = $('<a class="list-group-item" onclick="cont_itm_select('+id+')" id="input_2_itm_'+id+'">'+ text+'</a>');
+	$('#input_2_itm_list').append(o)
+	if(obj==null) cont_sect[sect].sections.push({"id" : id, "name" :text, "content" : "", "date" : "", "more" : "", "location" : "", "date" : "", "profiles" : [] });
+	$("#input_2_itm").val("");
+}
+
+
+// ---------------------------------
+// Contenu
+// ---------------------------------
+function cont_cont_rename()
+{
+	var sect = cont_get_sect_index(sect_active);
+	var itm = cont_get_itm_index(sect, itm_active);
+	
+	cont_sect[sect].sections[itm].name=$("#input_2_itm_rename").val();
+	$("#input_2_itm_"+itm_active).html($("#input_2_itm_rename").val());
+}
+
+function cont_cont_save()
+{
+	var sect = cont_get_sect_index(sect_active);
+	var itm = cont_get_itm_index(sect, itm_active);
+	var i;
+	var reg = get_regs();
+	
+	cont_sect[sect].sections[itm].name=$("#input_2_itm_rename").val();
+	cont_sect[sect].sections[itm].content=$("#input_2_itm_title").val();
+	cont_sect[sect].sections[itm].date=$("#input_2_itm_date").val();
+	cont_sect[sect].sections[itm].location=$("#input_2_itm_location").val();
+	cont_sect[sect].sections[itm].more=$("#input_2_itm_more").val();
+	$('#input_2_content_list').hide(400);
+	$("#input_2_itm_list a").removeClass("active");
+	cont_sect[sect].sections[itm].profiles=[];
+	for(i=0; i<reg.profiles.length; i++)
+	{
+		if( $('#input_2_prof_'+reg.profiles[i][0]+":checked").val() == "on" )
+		{
+			cont_sect[sect].sections[itm].profiles.push(reg.profiles[i][0]);
+		}
+	}
+	
+	itm_active=-1;
+}
+
+
+function cont_open(main)
+{
+	var i;
+	cont_tmpids=0;
+	itm_tmpids=1;
+	$('#input_2_sect_list').empty();
+	
+	cont_sect=JSON.parse( JSON.stringify( main ));
+	for(i=0; i<cont_sect.length; i++)
+		cont_sect_add(cont_sect[i]);
+		
+	$('#input_2_itm_root').hide();
+	$('#input_2_content_list').hide();
+	$("#input_2_itm_list a").removeClass("active");
+	$("#input_2_sect_list a").removeClass("active");
+	sect_active=-1;
+}
+
+
+function get_conts()
+{
+	return cont_sect;
+}
+

+ 344 - 0
js/cv.js

@@ -0,0 +1,344 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+var profiles_list = { "list" : [] };
+/*
+ * {
+ *  "list" 		 : ["profile1", "profile2" , "profile3", "profile4"],
+ * 	"profile1" : true, 
+ *  "profile2" : true, 
+ *  "profile3" : true, 
+ *  "profile4" : true
+ * }
+ */
+
+var json_url = "Not set"
+
+var sections_list = { "list" : []};
+
+var item_profiles_list = {};
+/* 
+ *  {
+ * 		"#obj" : ["profile1", "profile2"],
+ * 		"#obj2" : ["profile3", "profile4"]
+ *	}
+ */
+
+var item_list = [];
+/*
+ * ["#item1", "#item2", "#item3", "#item4"]
+ */
+ 
+function isEntryVisbile(elem)
+{
+	return item_profiles_list[elem+"-visible"];
+}
+
+function isSectionEmpty(id)
+{
+	var entries = sections_list[id];
+	console.log("Section '"+id+"'");
+	for ( var e in entries )
+	{
+		//console.log("\t "+entries[e]+" : "+isEntryVisbile(entries[e]));
+		if(isEntryVisbile(entries[e])) return false;
+	}
+	return true;
+}
+ 
+function chk_button_callback(evt)
+{
+	profiles_list[evt.data]=!profiles_list[evt.data];
+	for (var i in item_list)
+	{
+		var profiles = item_profiles_list[item_list[i]];
+		var sum = 0.
+		for (var j in profiles)
+		{
+			for ( var k in profiles_list.list)
+			{
+				if(profiles_list[profiles_list.list[k]] && profiles[j] == profiles_list.list[k])
+					sum++;
+			}
+		}
+		if (sum==0 && $.inArray("__profiles_all__", profiles))
+		{
+			$(item_list[i]).hide(400);
+			item_profiles_list[item_list[i]+"-visible"]=false;
+		}
+		else
+		{
+			$(item_list[i]).show(400);
+			item_profiles_list[item_list[i]+"-visible"]=true;
+		}
+	}
+	for (var s in sections_list.list )
+	{
+		if(isSectionEmpty(sections_list.list[s]))
+			$(sections_list.list[s]).hide(400);
+		else
+			$(sections_list.list[s]).show(400);
+			
+	}
+}
+
+
+function build_profile(id)
+{
+	var r = jQuery("<label class='btn btn-primary profiles-btn col-md-3 col-sm-5  col-xs-12'></label>");
+	var b = jQuery("<input class='profiles-ck' type='checkbox' checked='true' autocomplete='off' id='"+id[0]+"'> "+id[1]+"</input>");
+	b.on('change', null, id[0], chk_button_callback);
+	r.append(b);
+	return r;
+}
+
+
+function build_profiles(obj)
+{
+	var r = jQuery("<div class='row '></div>");
+	//var rr = jQuery("<div class='btn-group' data-toggle='buttons'></div>");
+	var rrr = jQuery("<div class='input-group col-md-11  col-sm-12  col-xs-12 ' ></div>");
+	//------------------
+	var  rr = jQuery("<div class='input-group-btn  profiles-container row'></div>");
+	//------------------
+	if(obj.profiles!=null)
+	{
+		r.append(jQuery("<h4 class='col-md-1  col-sm-12  col-xs-12 '> Profiles:</h4>"));
+		rrr.append(rr);
+		if(Array.isArray(obj.profiles))
+		{
+			for ( p in obj.profiles)
+			{
+				rr.append(build_profile(obj.profiles[p]));
+				profiles_list.list.push(obj.profiles[p][0]);
+				profiles_list.list.push(obj.profiles[p][0]);
+				profiles_list[obj.profiles[p][0]]=true;
+			}
+		}else
+		{
+			rr.append(build_profile(obj.profiles[p]));
+			profiles_list.list.push(obj.profiles[0]);
+			profiles_list.list.push(obj.profiles[0]);
+			profiles_list[obj.profiles[0]]=true;
+		}
+		
+		r.append(rrr);
+	}
+	return r;
+}
+
+function build_leftbar_section(obj)
+{
+	var r = jQuery("<div class=\"list-group-item left-bar-ul-2 color-second\"></div>");
+	r.append(jQuery("<h2>"+obj.title+"</h2>"));
+	var rr = jQuery("<table style='width:100%'></table> ");
+	r.append(rr);
+	for( var s in obj.content )
+	{
+		var rrr = jQuery("<tr></tr>");
+		if(obj.content[s].length==1)
+			rrr.append("<th><p>"+obj.content[s][0]+"</p></th>");
+		else
+		{
+			if(obj.content[s][0]=="Age")
+			{
+				var ageDifMs = Date.now() - obj.content[s][1]*1000;
+				var ageDate = new Date(ageDifMs);
+				rrr.append("<th><p><b>"+obj.content[s][0]+":</b></p></th> <th><p class='left-bar-value'>"+(ageDate.getUTCFullYear()-1970)+" ans</p></th>");
+			}
+			else 
+			{
+				rrr.append("<th><p><b>"+obj.content[s][0]+":</b></p></th> <th><p class='left-bar-value'>"+obj.content[s][1]+"</p></th>");
+			}
+		}
+		rr.append(rrr);
+	}
+	return r;
+}
+
+function build_leftbar(obj)
+{
+	var r = jQuery("<div class=\"list-group left-bar-ul color-first\" ></div>");
+	for (o in obj.leftbar)
+		r.append(build_leftbar_section(obj.leftbar[o]));
+	return r;
+}
+
+function build_image(path)
+{
+	var r = jQuery("<img></img>");
+	r.attr("src", path);
+	r.attr("style", 'width: 100%;');
+	r.addClass("img-responsive img-rounded");
+	r.attr("alt", "Ma photo");
+	return r;
+}
+
+function build_title(title)
+{
+	var r = jQuery("<h1 align='center'></h1>");
+	r.append(title);
+	document.title = title;
+	return r;
+}
+
+function toggle_main(id,i, j)
+{
+	var obj = $(id);
+	var down = id[0]+"do_"+id.substring(5, id.length);
+	var right = id[0]+"ri_"+id.substring(5, id.length);
+	obj.toggle(400);
+	$(down).toggle();
+	$(right).toggle();
+}
+
+
+function build_main_entry(obj, i, j)
+{
+	var root = jQuery("<div></div>");
+	var r = jQuery("<a class=\"list-group-item  cv-entry \
+	 color-first\" id='entry_"+i+"_"+j+"'  onclick=\"toggle_main('#div_"+i+"_"+j+"', "+i+", "+j+")\"></a>");
+	var table = $('<table style="width: 100%"></table>');
+	var tr1 = $('<tr></tr>');
+	table.append(tr1);
+	r.append(table);
+	
+	
+	if(obj.more != null && obj.more.length>0)
+	{
+		var td1=$('<td rowspan="2" style="width: 15px"> </td>');
+		td1.append(jQuery("<span class='glyphicon glyphicon-menu-right li-icon' id='ri_"+i+"_"+j+"'></span>"));
+		td1.append(jQuery("<span class='glyphicon glyphicon-menu-down li-icon' id='do_"+i+"_"+j+"' style='display:none'></span>"));
+		tr1.append(td1);
+	}
+	
+	tr1.append('<td rowspan="2" pull-left ><h4 style="font-weight: 900;	font-size: 16px;" >'+obj.content+'</h4></td>'); 
+	var td2 = $('<td class="pull-right small cv-entry-info" rowspan="2"  style="font-size: 11px;font-style: italic;"><td>');
+  var ita = $('<i></i>');
+  td2.append(ita);
+	if(obj.date) ita.append($('<div align="right">'+obj.date+'</div>'));
+  if(obj.location) ita.append($('<div align="right">'+obj.location+'</div>'));
+  tr1.append(td2);
+	
+	/*
+	
+	r.append(obj.content+"<br>");
+	*/
+	item_list.push("#entry_"+i+"_"+j);
+	item_profiles_list["#entry_"+i+"_"+j]=[];
+	sections_list["#section_"+i].push("#entry_"+i+"_"+j);
+	if(obj.profiles!=null)
+	{
+		if(Array.isArray(obj.profiles))
+		{
+			for (var pro in obj.profiles)
+				item_profiles_list["#entry_"+i+"_"+j].push(obj.profiles[pro]);
+				item_profiles_list["#entry_"+i+"_"+j+"-visible"]=true;
+		}else
+			item_profiles_list["#entry_"+i+"_"+j].push(obj.profiles);
+			item_profiles_list["#entry_"+i+"_"+j+"-visible"]=true;
+	}else item_profiles_list["#entry_"+i+"_"+j].push("__profiles_all__");
+	
+	root.append(r);
+	if(obj.more != null && obj.more.length>0)
+	{
+		var d = jQuery("<div class=\"list-group-item  cv-entry-dsec \
+			color-second\" id=\"div_"+i+"_"+j+"\" onclick=\"\"></div>");
+		if(Array.isArray(obj.more))
+		{
+			for(m in obj.more)
+			{
+				d.append(obj.more[m]+"<br>");
+			}
+		}
+		else 
+		{
+			d.append(obj.more);
+		}
+		root.append(d);
+	}
+	return root;
+}
+
+function build_main_section(obj, i)
+{
+	var r = jQuery("<li class=\"list-group-item cv-section transparent\" style=\"border: medium none;\" id='section_"+i+"'></li>");
+	r.append(jQuery("<h3 class=\"section-title\">"+obj.title+"</h3>"));
+	sections_list["#section_"+i]=[];
+	sections_list.list.push("#section_"+i);
+	for ( var entry in obj.sections)
+		r.append(build_main_entry(obj.sections[entry], i, entry));
+	return r;
+}
+
+function build_main(obj)
+{
+	var r = jQuery("<div class=\"col-md-9 main-entry  col-sm-12  col-xs-12 main\"></div>");
+	for ( var section in obj.main)
+		r.append(build_main_section(obj.main[section], section));
+	return r;
+}
+
+function insert_data(obj)
+{
+	$("#rootnode").append(build_main(obj));
+	$("#title").append(build_title(obj.title));
+	$("#image").append(build_image(obj.photo));
+	$("#left-bar").append(build_leftbar(obj));
+	$("#profilesroot").append(build_profiles(obj));
+}
+
+function getContentYaml(url)
+{
+	var strReturn = "";
+	jQuery.ajax({
+    url: url,
+    success: function(html) {
+      strReturn = html;
+    },
+    async:false
+  });
+  return YAML.parse(strReturn);
+}
+
+function getContentJson(url)
+{
+	var strReturn = "";
+	jQuery.ajax({
+    url: url,
+    success: function(html) {
+      strReturn = html;
+    },
+    async:false
+  });
+  return strReturn;
+}
+
+function onReady()
+{
+	var x = getContentJson(json_url);
+	insert_data(x);
+}
+
+function set_json_url(url)
+{
+	json_url=url;
+}
+
+$( document ).ready(onReady);
+
+
+

+ 121 - 0
js/cvgen.js

@@ -0,0 +1,121 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+function onReady()
+{
+	construct_reglages();
+}
+
+
+function generate()
+{
+	var reg = get_regs();
+	reg.leftbar=get_cats();
+	reg.main=get_conts();
+	return reg;
+}
+
+
+
+
+function test()
+{
+	console.log(JSON.stringify(generate()));
+	//send_post(generate());
+	var blob = new Blob([JSON.stringify(generate())], {type: "application/*"});
+	saveAs(blob, "cv.json");
+}
+
+function fill_ui(data)
+{
+	if(typeof data == "string") data=JSON.parse(data);
+	info_open(data.leftbar);
+	regs_open(data);
+	cont_open(data.main);
+	load_json();
+}
+
+function submitForm() 
+{
+		console.log("submit event");
+		var fd = new FormData(document.getElementById("fileinfo"));
+		//fd.append("label", "WEBUPLOAD");
+		$.ajax({
+			url: "server/ping.php",
+			type: "POST",
+			data: fd,
+			processData: false,  // tell jQuery not to process the data
+			contentType: false   // tell jQuery not to set contentType
+		}).done(function( data ) {
+				fill_ui(data);
+		});
+		return false;
+}
+
+
+function submitFormImage() 
+{
+		console.log("submit event image");
+		var obj = generate();
+		var fd = new FormData(document.getElementById("fileinfoimage"));
+		fd.append("json", JSON.stringify(obj));
+		fd.append("img", "cv/"+obj.photo);
+		$.ajax({
+			url: "server/archive.php",
+			type: "POST",
+			data: fd,
+			processData: false, 
+			contentType: false, 
+			async: false
+		}).done(function( data ) {
+				var a = document.getElementById('a1');
+				a.href = "data:application/x-tgz;base64,"+data;
+				a.click();
+		});
+		return false;
+}
+
+function load_json()
+{
+	if($('#button_open').html()=="Importer")
+	{
+		$('#button_open').html("Annuler");
+		$('#input_open').removeClass('hidden');
+	}
+	else
+	{
+		$('#button_open').html("Importer");
+		$('#input_open').addClass('hidden');
+	}
+}
+
+
+function toggle_distribe()
+{
+	if($('#button_distrib').html()=="Distribuer")
+	{
+		$('#button_distrib').html("Annuler");
+		$('#input_open_image').removeClass('hidden');
+	}
+	else
+	{
+		$('#button_distrib').html("Distribuer");
+		$('#input_open_image').addClass('hidden');
+	}
+}
+
+
+$( document ).ready(onReady);

+ 326 - 0
js/info.js

@@ -0,0 +1,326 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+var cat_count=0;
+var cat_active=-1;
+var info_cats=[];
+
+
+var tmpids;
+var kv_count=0;
+
+function print()
+{
+	var x = "[";
+	var i;
+	for(i=0; i<info_cats.length; i++)
+	{
+		x+=" "+info_cats[i].id;
+	}
+	console.log(x+" ]");
+}
+
+function info_open(list)
+{
+	var i;
+	tmpids=0;
+	info_cats=[];
+	$('#input_1_cat_list').empty();
+	for(i=0; i<list.length; i++)
+		info_cat_add(i, list[i]);
+		
+	$('#input_1_root').hide();
+	$("#input_1_cat_list a").removeClass("active");
+	cat_active=-1;
+}
+
+
+function info_get_active_cat_index(cat)
+{
+	if(cat<0) return -1;
+	var i;
+	for(i=0; i<info_cats.length; i++)
+	{
+		if(info_cats[i].id==cat)
+		{
+			return i;
+		}
+	}
+}
+
+function info_cat_active(x)
+{
+	var y = false;
+	$("#input_1_cat_list a").removeClass("active");
+	$("#input_1_cat_"+x).addClass('active');
+	if(cat_active==-1) y=true;
+	cat_active=x;
+	info_kv_show();
+	$('#input_1_root').hide();
+	$('#input_1_root').show(400);
+}
+
+function info_cat_up()
+{
+	if(cat_active<0) return 0;
+	var i;
+	for(i=1; i<info_cats.length; i++)
+	{
+		if(info_cats[i].id==cat_active)
+		{
+			var x = $('#input_1_cat_'+info_cats[i].id);
+			x.remove();
+			x.insertBefore('#input_1_cat_'+info_cats[i-1].id);
+			
+			
+			var a = info_cats[i];
+			info_cats[i]=info_cats[i-1];
+			info_cats[i-1]=a;
+			
+			break;
+		}
+	}
+	print();
+}
+
+function info_cat_down()
+{
+	if(cat_active<0) return 0;
+	var i;
+	for(i=0; i<info_cats.length-1; i++)
+	{
+		if(info_cats[i].id==cat_active)
+		{
+			
+			var x = $('#input_1_cat_'+info_cats[i].id);
+			x.remove();
+			x.insertAfter('#input_1_cat_'+info_cats[i+1].id);
+			
+			
+			var a = info_cats[i];
+			info_cats[i]=info_cats[i+1];
+			info_cats[i+1]=a;
+			
+			break;
+		}
+	}
+	print();
+}
+
+function info_cat_del()
+{
+	var i;
+	if(cat_active<0) return 0;
+	for(i=0; i<info_cats.length; i++)
+	{
+		if(info_cats[i].id==cat_active)
+		{
+			$('#input_1_cat_'+info_cats[i].id).remove();
+			info_cats.splice(i, 1);
+			break;
+		}
+	}
+	
+	
+	cat_active=-1;
+	$('#input_1_root').hide(400);
+	print();
+}
+
+function info_cat_add(i, obj)
+{
+	obj = (typeof obj === 'undefined') ? null : obj;
+	i = (typeof i === 'undefined') ? -1 : i;
+	
+	cat_count++;
+	
+	var n;
+	var val;
+	var text;
+	if(obj==null)
+	{
+		n=cat_count;
+		text=$('#input_1_cat').val();
+		val=[];
+	}
+	else
+	{
+		n=i;
+		text=obj.title;
+		val=obj.content;
+		var j;
+		for(j=0; j<val.length; j++)
+		{
+			val[j].unshift(tmpids++);
+		}
+	} 
+	
+	var o = $('<a onclick="info_cat_active('+n+')" class="list-group-item" id="input_1_cat_'+n+'"></a>');
+	o.append($('<h4 class="list-group-item-heading">'+text+'</h4>'));
+	info_cats.push({ "title" : text, "id" :  n, "content" : val});
+	
+	$('#input_1_cat_list').append(o);
+	$('#input_1_cat').val("");
+}
+
+
+
+
+function info_cat_rename()
+{
+	if(cat_active<0) return;
+	var cat = info_get_active_cat_index(cat_active);
+	var text = $('#input_1_cat_rename').val();
+	$("#input_1_cat_"+cat_active).html($('<h4 class="list-group-item-heading">'+text+'</h4>'));
+	info_cats[cat].title=text;
+}
+
+
+// [index, key, value]
+
+function info_get_kv_index(icat, kv)
+{
+	if(icat<0) return;
+	var i;
+	for( i=0; i<info_cats[icat].content.length; i++)
+		if(info_cats[icat].content[i][0]==kv)
+			return i;
+	return -1;
+}
+
+function info_kv_valid(index)
+{
+	if(cat_active<0) return;
+	var cat = info_get_active_cat_index(cat_active);
+	var kv = info_get_kv_index(cat, index);
+	var isValid = $('#input_1_kv_valid_'+index).hasClass('glyphicon-ok');
+	var key = isValid ? $('#input_1_key_'+index).val() : $('#input_1_key_'+index).html();
+	var value = isValid ? $('#input_1_value_'+index).val() : $('#input_1_value_'+index).html();
+	var kp =  $('#input_1_key_'+index).parent();
+	var vp = $('#input_1_value_'+index).parent();
+	
+	kp.empty();
+	vp.empty();
+	
+	if(isValid)
+	{
+		if(kv<0)
+		{
+			info_cats[cat].content.push([index, 
+																	key, 
+																	value]);
+			
+		}else
+		{
+			info_cats[cat].content[kv]=[index, 
+																	key, 
+																	value] ;
+		}
+		
+		
+		kp.append($('<span><h4  class="col-md-2" id="input_1_key_'+index+'" >'+key+'</h4></span>'));
+		vp.append($('<span><h4 class="col-md-8" id="input_1_value_'+index+'">'+value+'</h4></span>'));
+		
+		$('#input_1_kv_valid_'+index).removeClass('glyphicon-ok');
+		$('#input_1_kv_valid_'+index).addClass('glyphicon-pencil');
+	}else
+	{
+		kp.append($('<span><input  text="text" class="col-md-2" id="input_1_key_'+index+'" value="'+key+'" placeholder="Intitulé"></input></span>'));
+		vp.append($('<span><input  text="text" class="col-md-8" id="input_1_value_'+index+'" value="'+value+'" placeholder="Description (facultatif)"></input></span>'));
+	
+		
+		$('#input_1_kv_valid_'+index).removeClass('glyphicon-pencil');
+		$('#input_1_kv_valid_'+index).addClass('glyphicon-ok');
+	}
+	
+	
+	console.log("KV Valid: val='"+JSON.stringify(info_cats[cat].content)+"'");
+	
+	
+}
+
+function info_kv_del(index)
+{
+	if(cat_active<0) return;
+	var cat = info_get_active_cat_index(cat_active);
+	var kv = info_get_kv_index(cat, index);
+	if(kv<0)
+	{
+		$('#input_1_kv_'+index).remove();
+		return;
+	}
+	
+	
+	$('#input_1_kv_'+info_cats[cat].content[kv][0]).remove();
+	info_cats[cat].content.splice(kv, 1);
+}
+
+function info_kv_add(i, k, v)
+{
+	i = (typeof i === 'undefined') ? -1 : i;
+	k = (typeof k === 'undefined') ? '' : k;
+	v = (typeof v === 'undefined') ? '' : v;
+	console.log("i="+i+", v="+k+", v="+v); 
+	if(cat_active<0) return;
+	var nb;
+	
+	if(i<0) nb=(kv_count++);
+	else 
+	{
+		if(i>kv_count) kv_count=i;
+		nb=i;
+	}
+	console.log("N="+nb);
+	var disable=(i==-1)?"":"disabled=true";
+	var o = $("<div id='input_1_kv_"+nb+"' class='row'></div>");
+	
+	if(i==-1)o.append($('<span><input  text="text" class="col-md-2" id="input_1_key_'+nb+'" value="'+k+'" placeholder="Intitulé" '+disable+'></input></span>'));
+	else o.append($('<span><h4  class="col-md-2" id="input_1_key_'+nb+'" >'+k+'</h4></span>'));
+	
+	if(i==-1)o.append($('<span><input  text="text" class="col-md-8" id="input_1_value_'+nb+'" value="'+v+'" placeholder="Description (facultatif)" '+disable+'></input></span>'));
+	else o.append($('<span><h4 class="col-md-8" id="input_1_value_'+nb+'">'+v+'</h4></span>'));
+	
+	if(i==-1) o.append($('<span><button class="col-md-1 btn btn-default glyphicon glyphicon-ok" onclick="info_kv_valid('+nb+')" id="input_1_kv_valid_'+nb+'"></button></span>'));
+	else o.append($('<span><button class="col-md-1 btn btn-default glyphicon glyphicon-pencil" onclick="info_kv_valid('+nb+')" id="input_1_kv_valid_'+nb+'"></button></span>'));
+	o.append($('<span><button class="col-md-1 btn btn-default glyphicon glyphicon-minus" onclick="info_kv_del('+nb+')"></button></span>'));
+	
+	$('#input_1_kv_list').append(o);
+}
+
+
+function info_kv_show()
+{
+	var cat = info_get_active_cat_index(cat_active);
+	var i;
+	$('#input_1_kv_list').empty();
+	$('#input_1_cat_rename').val($($("#input_1_cat_"+cat_active).html()).html());
+	for(i=0; i<info_cats[cat].content.length; i++)
+	{
+		info_kv_add(info_cats[cat].content[i][0],info_cats[cat].content[i][1],info_cats[cat].content[i][2]);
+	}
+	
+}
+
+
+function get_cats()
+{
+	var ic= JSON.parse(JSON.stringify(info_cats));
+	var i,j;
+	for(i=0; i< info_cats.length; i++)
+		for(j=0; j<info_cats[i].content.length; j++)
+			ic[i].content[j].splice(0,1);
+	
+	return ic;
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 1 - 0
js/jquery.min.js


+ 145 - 0
js/reglages.js

@@ -0,0 +1,145 @@
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+var profils_created=0;
+var regs={ "title" : "", "photo":"",  "profiles" : [] };
+var profiles_list_id=[];
+const authorized_profile_id="azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN-_.";
+const authorized_profile_label="azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN-_.";
+
+var reg_tmpid;
+
+function check_profil_id(id)
+{
+	var i;
+	if(id.length<1) 
+	{
+		alert("Veuillez remplir le champ ID");
+		return false;
+	}
+	for(i=0; i<id.length; i++)
+		if(authorized_profile_id.indexOf(id[i])<0)
+		{
+			alert("Caractère '"+id[i]+"' non autorisé dans le champ ID");
+			return false;
+		}
+	
+	return true;
+}
+
+
+function check_profil_label(id)
+{
+	var i;
+	if(id.length<1) 
+	{
+		alert("Veuillez remplir le champ Label");
+		return false;
+	}
+	for(i=0; i<id.length; i++)
+		if(authorized_profile_id.indexOf(id[i])<0)
+		{
+			alert("Caractère '"+id[i]+"' non autorisé dans le champ ID");
+			return false;
+		}
+		
+	return true;
+}
+
+
+
+function delete_profil(index)
+{
+	$("#input_0_prof_"+index).remove();
+	profiles_list_id = jQuery.grep(profiles_list_id, function(value) {
+		return value != index;
+	});
+}
+
+function add_form_profils(k, v)
+{
+	k = (typeof k === 'undefined') ? null : k;
+	v = (typeof v === 'undefined') ? null : v;
+	
+	if( (k==null && v==null) && (!check_profil_id($('#input_0_prof_id').val()) || !check_profil_label($('#input_0_prof_label').val())) )return;
+	profils_created++;
+	
+	var n;
+	
+	if(k==null)
+	{
+		n=profils_created;
+		k=$('#input_0_prof_id').val();
+		v=$('#input_0_prof_label').val();
+	}
+	else
+	{
+		n=reg_tmpid++;
+	}
+	
+	
+	var o = $("<tr id='input_0_prof_"+n+"'></tr>");
+	o.append($("<td id='input_0_prof_id_"+n+"'>"+k+"</td>"));
+	o.append($("<td id='input_0_prof_label_"+n+"'>"+v+"</td>"));
+	o.append($("<td><button class='btn btn-default glyphicon glyphicon-minus' onclick='delete_profil("+n+")'></button></td>"));
+	o.insertBefore("#input_0_prof_tr");
+	$('#input_0_prof_id').val("");
+	$('#input_0_prof_label').val("");
+	profiles_list_id.push(n);
+}
+
+function construct_reglages()
+{
+	//build_form_profils_input().insertBefore("#input_0_profils_list_add")
+}
+
+
+function regs_open(data)
+{
+	var i;
+	reg_tmpid=0;
+	
+	for(i=0; i<profiles_list_id.length; i++)
+		$('#input_0_prof_id_'+profiles_list_id[i]).parent().remove();
+	profiles_list_id=[];
+	
+	regs=JSON.parse(JSON.stringify(data));
+	for(i=0; i<regs.profiles.length; i++)
+		add_form_profils(regs.profiles[i][0], regs.profiles[i][1]);
+	$('#input_0_prof_id').val("");
+	$('#input_0_prof_label').val("");
+	$('#input_0_titre').val(data.title);
+	$('#input_0_fileinput').val(data.photo);
+}
+
+
+function reg_changefile()
+{
+	$('#input_0_fileinput').val( "icons/"+$('#input_0_file').val() );
+}
+
+function get_regs()
+{
+	var i;
+	regs.title=$('#input_0_titre').val();
+	regs.photo=$('#input_0_fileinput').val();
+	regs.profiles=[];
+	for(i=0; i<profiles_list_id.length; i++)
+		regs.profiles.push( [$('#input_0_prof_id_'+profiles_list_id[i]).html(), $('#input_0_prof_label_'+profiles_list_id[i]).html()] );
+	
+	return regs;
+}
+
+

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
js/trianglify.min.js


+ 81 - 0
server/archive.php

@@ -0,0 +1,81 @@
+<?php
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+$file = '/tmp/cv.tar';
+$json = '/tmp/json';
+
+try {
+    $a = new PharData($file);
+		file_put_contents ($json, $_POST['json']);
+    $a->addFile('../cv.html', 'cv/cv.html');
+    $a->addFile('../demo.html', 'cv/demo.html');
+    $a->addFile('../js/cv.js', 'cv/js/cv.js');
+    $a->addFile('../cvgen.html', 'cv/cvgen.html');
+    $a->addFile('../js/reglages.js', 'cv/js/reglages.js');
+    $a->addFile('../js/cvgen.js', 'cv/js/cvgen.js');
+    $a->addFile('../js/info.js', 'cv/js/info.js');
+    $a->addFile('../js/content.js', 'cv/js/content.js');
+    
+    
+    
+    $a->addFile('../server/ping.php', 'cv/server/ping.php');
+    $a->addFile('../server/archive.php', 'cv/server/archive.php');
+    $a->addFile('../server/download.php', 'cv/server/download.php');
+    
+    $a->addFile('../js/bootstrap.min.js', 'cv/js/bootstrap.min.js');
+    $a->addFile('../js/jquery.min.js', 'cv/js/jquery.min.js');
+    $a->addFile('../js/trianglify.min.js', 'cv/js/trianglify.min.js');
+    $a->addFile('../js/background.js', 'cv/js/background.js');
+    
+    $a->addFile('../css/bootstrap.min.css', 'cv/css/bootstrap.min.css');
+    $a->addFile('../css/cv.css', 'cv/css/cv.css');
+    $a->addFile('../css/cvgen.css', 'cv/css/cvgen.css');
+    
+    $a->addFile($json, 'cv/data/cv.json');
+    $a->addFile('../README', 'cv/README');
+    
+    
+    $a->addFile('../data/demo.json', 'cv/data/demo.json');
+    $a->addFile('../icons/johndoe.jpg', 'cv/icons/johndoe.jpg');$a->addFile('../LICENSE', 'cv/LICENSE');
+    
+    
+    $a->addFile($_FILES['uploadFileImage']['tmp_name'], $_POST['img']);
+    
+    $a->compress(Phar::GZ);
+} catch (Exception $e) {
+}
+
+$file= $file. ".gz";
+if (file_exists($file)) {
+		$b64 = base64_encode(file_get_contents($file));
+    header('Content-Description: File Transfer');
+    header('Content-Type: application/x-tgz');
+    header('Content-Disposition: attachment; filename='.basename($file));
+    header('Content-Transfer-Encoding: binary');
+    header('Content-Length: ' . /*filesize($file)*/ strlen($b64));
+    ob_clean();
+    flush();
+    
+    ob_get_clean();
+    echo $b64;
+    ob_end_flush();
+    
+    unlink($file);
+    exit;
+}
+?>
+

+ 77 - 0
server/download.php

@@ -0,0 +1,77 @@
+<?php
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+$file = '/tmp/cvgen.tar';
+
+try {
+    $a = new PharData($file);
+    $a->addFile('../cv.html', 'cv/cv.html');
+    $a->addFile('../demo.html', 'cv/demo.html');
+    $a->addFile('../cvgen.html', 'cv/cvgen.html');
+    $a->addFile('../js/cv.js', 'cv/js/cv.js');
+    $a->addFile('../js/reglages.js', 'cv/js/reglages.js');
+    $a->addFile('../js/cvgen.js', 'cv/js/cvgen.js');
+    $a->addFile('../js/info.js', 'cv/js/info.js');
+    $a->addFile('../js/content.js', 'cv/js/content.js');
+    
+    $a->addFile('../server/ping.php', 'cv/server/ping.php');
+    $a->addFile('../server/archive.php', 'cv/server/archive.php');
+    $a->addFile('../server/download.php', 'cv/server/download.php');
+    
+    $a->addFile('../js/bootstrap.min.js', 'cv/js/bootstrap.min.js');
+    $a->addFile('../js/jquery.min.js', 'cv/js/jquery.min.js');
+    $a->addFile('../js/trianglify.min.js', 'cv/js/trianglify.min.js');
+    $a->addFile('../js/background.js', 'cv/js/background.js');
+    
+    $a->addFile('../css/bootstrap.min.css', 'cv/css/bootstrap.min.css');
+    $a->addFile('../css/cv.css', 'cv/css/cv.css');
+    $a->addFile('../css/cvgen.css', 'cv/css/cvgen.css');
+    
+    
+    $a->addFile('../data/demo.json', 'cv/data/demo.json');
+    $a->addFile('../icons/johndoe.jpg', 'cv/icons/johndoe.jpg');
+    
+    $a->addFile('../README', 'cv/README');
+    $a->addFile('../LICENSE', 'cv/LICENSE');
+    
+    
+    $a->compress(Phar::GZ);
+} catch (Exception $e) {
+  
+}
+
+
+$file= $file. ".gz";
+echo "A\n";
+if (file_exists($file)) {
+    header('Content-Description: File Transfer');
+    header('Content-Type: application/x-tgz');
+    header('Content-Disposition: attachment; filename='.basename($file));
+    header('Content-Transfer-Encoding: binary');
+    header('Content-Length: ' . filesize($file));
+    ob_clean();
+    flush();
+    
+    ob_get_clean();
+    readfile($file);
+    ob_end_flush();
+    
+    unlink($file);
+    exit;
+}
+?>
+

+ 18 - 0
server/ping.php

@@ -0,0 +1,18 @@
+
+<?php
+/*
+ * This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+  readfile($_FILES["uploadFile"]["tmp_name"]);
+?>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff