@osfarm/itineraire-technique 1.1.17 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/editor.html +6 -2
  2. package/package.json +1 -1
package/editor.html CHANGED
@@ -52,7 +52,7 @@
52
52
  </button>
53
53
  <ul class="dropdown-menu">
54
54
  <li><a class="dropdown-item" href="#" onclick="showSaveAsModal()"><i class="fa fa-save" aria-hidden="true"></i> Enregistrer sous</a></li>
55
- <li><a class="dropdown-item" href="#" onclick="exportToJsonFile()"><i class="fa fa-download" aria-hidden="true"></i> Exporter</a></li>
55
+ <li><a class="dropdown-item" href="#" onclick="doExportToJsonFile()"><i class="fa fa-download" aria-hidden="true"></i> Exporter</a></li>
56
56
  </ul>
57
57
  </div>
58
58
  </div>
@@ -65,7 +65,7 @@
65
65
  <ul class="dropdown-menu">
66
66
  <li><a class="dropdown-item" href="#" onclick="importFromTestJson()"><i class="fa fa-lightbulb-o" aria-hidden="true"></i> Charger un exemple</a></li>
67
67
  </ul>
68
- </div><button type="button" onclick="exportToJsonFile()" class="btn btn-outline-primary primary-button me-2"><i class="fa fa-download" aria-hidden="true"></i> Exporter (JSON)</button>
68
+ </div><button type="button" onclick="doExportToJsonFile()" class="btn btn-outline-primary primary-button me-2"><i class="fa fa-download" aria-hidden="true"></i> Exporter (JSON)</button>
69
69
  </div>
70
70
 
71
71
  <button type="button" onclick="wipe(crops)" class="btn btn-outline-primary primary-button"><i class="fa fa-trash" aria-hidden="true"></i> Tout effacer</button>
@@ -1089,4 +1089,8 @@
1089
1089
  });
1090
1090
  }
1091
1091
 
1092
+ function doExportToJsonFile() {
1093
+ let jsonName = crops.title.replace(/\s+/g, '-').toLowerCase() + ".json";
1094
+ exportToJsonFile(crops, jsonName);
1095
+ }
1092
1096
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osfarm/itineraire-technique",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "description": "A visualisation tool to show agricultural technical itineraries based on Echarts",
5
5
  "main": "editor.html",
6
6
  "scripts": {