diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-07-01 19:28:12 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-07-01 19:28:12 +1000 |
| commit | 551fbe163b90cc1f318612c167fbdfe738dd7132 (patch) | |
| tree | 00286538d754fdf686751a3d4c1689d799ecd65e /src/components | |
| parent | c2b9a8b7a706cdca58dab7f4a980401e1c20a602 (diff) | |
Generate 3 reduced trees, keeping the original, and serve only those
Generate a 'trimmed' reduced tree instead of changing the original.
Generate an 'images-only' reduced tree, and use it as the default.
Combine 'picked' reduced tree code with that of other reduced trees.
Adapt server API to allow selecting between more than 2 trees.
Add client setting for selecting between 3 trees.
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/SearchModal.vue | 4 | ||||
| -rw-r--r-- | src/components/SettingsModal.vue | 15 | ||||
| -rw-r--r-- | src/components/TileInfoModal.vue | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index 2e8b9a2..4d39772 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -117,7 +117,7 @@ export default defineComponent({ // Get URL params to use for querying search-suggestions let urlParams = 'type=sugg&name=' + encodeURIComponent(input.value); urlParams += '&limit=' + this.uiOpts.searchSuggLimit; - urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : ''; + urlParams += '&tree=' + this.uiOpts.tree; // Query server, delaying/skipping if a request was recently sent this.pendingSuggReqParams = urlParams; this.pendingSuggInput = input.value; @@ -186,7 +186,7 @@ export default defineComponent({ } // Ask server for nodes in parent-chain, updates tolMap, then emits search event let urlParams = 'type=node&toroot=true&name=' + encodeURIComponent(tolNodeName); - urlParams += this.uiOpts.useReducedTree ? '&rtree=true' : ''; + urlParams += '&tree=' + this.uiOpts.tree; let responseObj: {[x: string]: TolNode} = await getServerResponse(urlParams); if (responseObj == null){ return; diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue index 16351c4..315ddb4 100644 --- a/src/components/SettingsModal.vue +++ b/src/components/SettingsModal.vue @@ -78,8 +78,15 @@ <div class="border rounded p-1"> <h2 class="text-center">Other</h2> <div> - <label> <input type="checkbox" v-model="uiOpts.useReducedTree" - @change="onSettingChg('UI', 'useReducedTree')"/> Use simplified tree </label> + <div>Tree to use</div> + <ul> + <li> <label> <input type="radio" v-model="uiOpts.tree" value="trimmed" + @change="onSettingChg('UI', 'tree')"/> Comprehensive </label> </li> + <li> <label> <input type="radio" v-model="uiOpts.tree" value="images" + @change="onSettingChg('UI', 'tree')"/> Visual </label> </li> + <li> <label> <input type="radio" v-model="uiOpts.tree" value="picked" + @change="onSettingChg('UI', 'tree')"/> Minimal </label> </li> + </ul> </div> <div> <label> <input type="checkbox" v-model="uiOpts.searchJumpMode" @@ -161,7 +168,7 @@ export default defineComponent({ } // Notify App this.$emit('setting-chg', optionType, option, - {relayout: optionType == 'LYT', reinit: optionType == 'UI' && option == 'useReducedTree'}); + {relayout: optionType == 'LYT', reinit: optionType == 'UI' && option == 'tree'}); // Possibly make saved-indicator appear/animate if (!this.saved){ this.saved = true; @@ -205,7 +212,7 @@ export default defineComponent({ // Restore default options let defaultLytOpts = getDefaultLytOpts(); let defaultUiOpts = getDefaultUiOpts(defaultLytOpts); - let needReinit = this.uiOpts.useReducedTree != defaultUiOpts.useReducedTree; + let needReinit = this.uiOpts.tree != defaultUiOpts.tree; Object.assign(this.lytOpts, defaultLytOpts); Object.assign(this.uiOpts, defaultUiOpts); // Notify App diff --git a/src/components/TileInfoModal.vue b/src/components/TileInfoModal.vue index 129e861..3593600 100644 --- a/src/components/TileInfoModal.vue +++ b/src/components/TileInfoModal.vue @@ -70,7 +70,7 @@ import CloseIcon from './icon/CloseIcon.vue'; import ExternalLinkIcon from './icon/ExternalLinkIcon.vue'; import {TolNode, TolMap} from '../tol'; import {LayoutNode, LayoutOptions} from '../layout'; -import {getServerResponse, getImagePath, DescInfo, ImgInfo, NodeInfo, InfoResponse, UiOptions} from '../lib'; +import {getImagePath, DescInfo, ImgInfo, NodeInfo, InfoResponse, UiOptions} from '../lib'; import {capitalizeWords} from '../util'; export default defineComponent({ |
