Skip to content

Commit

Permalink
User configuration move to note template
Browse files Browse the repository at this point in the history
- In order to make customizable part of program configuration more user-friendly - move the mentioned configuration into note template to be able to open it from any device and easily modify the available properties
  • Loading branch information
helitopia authored and Illia Harkusha committed Aug 13, 2024
1 parent 02ea995 commit 8802791
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 25 deletions.
26 changes: 1 addition & 25 deletions src/media/experimental_assets/_ug-interactive_map_config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
/**
* Customizable user properties
*/
function getUserConfig() {
let configObj = {};
configObj.commonFeatures = {
interactiveEnabled: "true",
interactiveMobileEnabled: "true",
autoAnswerEnabled: "true",
toolTipEnabled: "false",
};
configObj.commonColors = {
region: "#fdfbe5",
selectedRegion: "#e7f3ea",
incorrectRegionHighlight: "#c02637",
correctRegionHighlight: "#329446",
background: "#b3dff5",
border: "#757674",
tooltipBackground: "#fdfbe5",
tooltipText: "#000000"
};
return configObj;
}

/**
* Overall configuration. Includes validated user properties
* and core properties - program auxiliary data. Should not
* be modified unless the author understands what they are doing
*/
function getMapConfig() {
let userConfig = getUserConfig()
let userConfig = JSON.parse(sessionStorage.getItem("userConfig"));
let configObj = {};
configObj.commonConfig = {
interactiveEnabled: true,
Expand Down
21 changes: 21 additions & 0 deletions src/note_models/templates/Country - Map [Experimental].html
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
<script>
sessionStorage.setItem("userConfig",
JSON.stringify({
commonFeatures: {
interactiveEnabled: "true",
interactiveMobileEnabled: "true",
autoAnswerEnabled: "true",
toolTipEnabled: "false",
},
commonColors: {
region: "#fdfbe5",
selectedRegion: "#e7f3ea",
incorrectRegionHighlight: "#c02637",
correctRegionHighlight: "#329446",
background: "#b3dff5",
border: "#757674",
tooltipBackground: "#fdfbe5",
tooltipText: "#000000"
}
}));
</script>
<div class="value value--top">{{Country}}</div>
<hr>

Expand Down

0 comments on commit 8802791

Please sign in to comment.