mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:28:03 +02:00
goto client-side filtering (preliminary)
This commit is contained in:
parent
25ee948662
commit
f72f8c762b
3 changed files with 11 additions and 10 deletions
|
@ -33,7 +33,6 @@ Column {
|
||||||
property int stackedCardShadowHeight: 4;
|
property int stackedCardShadowHeight: 4;
|
||||||
property int labelSize: 20;
|
property int labelSize: 20;
|
||||||
|
|
||||||
property string metaverseServerUrl: ''; // FIXME loose this?
|
|
||||||
property string protocol: '';
|
property string protocol: '';
|
||||||
property string actions: 'snapshot';
|
property string actions: 'snapshot';
|
||||||
// sendToScript doesn't get wired until after everything gets created. So we have to queue fillDestinations on nextTick.
|
// sendToScript doesn't get wired until after everything gets created. So we have to queue fillDestinations on nextTick.
|
||||||
|
@ -63,10 +62,16 @@ Column {
|
||||||
};
|
};
|
||||||
listModelName: actions;
|
listModelName: actions;
|
||||||
listView: scroll;
|
listView: scroll;
|
||||||
|
searchFilter: filter.toUpperCase().split(/\s+/).filter(identity).join(' ');
|
||||||
|
searchItemTest: function (text, item) {
|
||||||
|
return searchFilter.split().every(function (word) {
|
||||||
|
return item.searchText.indexOf(word) >= 0;
|
||||||
|
});
|
||||||
|
}; //HRS FIXME remove when endpoint works.
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveUrl(url) {
|
function resolveUrl(url) {
|
||||||
return (url.indexOf('/') === 0) ? (metaverseServerUrl + url) : url;
|
return (url.indexOf('/') === 0) ? (Account.metaverseServerURL + url) : url;
|
||||||
}
|
}
|
||||||
function makeModelData(data) { // create a new obj from data
|
function makeModelData(data) { // create a new obj from data
|
||||||
// ListModel elements will only ever have those properties that are defined by the first obj that is added.
|
// ListModel elements will only ever have those properties that are defined by the first obj that is added.
|
||||||
|
@ -101,6 +106,9 @@ Column {
|
||||||
console.log('fixme makeModelData', JSON.stringify(fixme));
|
console.log('fixme makeModelData', JSON.stringify(fixme));
|
||||||
return fixme;
|
return fixme;
|
||||||
}
|
}
|
||||||
|
function identity(x) {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
/* FIXME
|
/* FIXME
|
||||||
property var allStories: [];
|
property var allStories: [];
|
||||||
property var placeMap: ({}); // Used for making stacks.
|
property var placeMap: ({}); // Used for making stacks.
|
||||||
|
@ -172,9 +180,6 @@ Column {
|
||||||
report('user stories');
|
report('user stories');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function identity(x) {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
function makeFilteredStoryProcessor() { // answer a function(storyData) that adds it to suggestions if it matches
|
function makeFilteredStoryProcessor() { // answer a function(storyData) that adds it to suggestions if it matches
|
||||||
var words = filter.toUpperCase().split(/\s+/).filter(identity);
|
var words = filter.toUpperCase().split(/\s+/).filter(identity);
|
||||||
function suggestable(story) {
|
function suggestable(story) {
|
||||||
|
|
|
@ -101,10 +101,10 @@ Item {
|
||||||
currentPageToRetrieve = -1;
|
currentPageToRetrieve = -1;
|
||||||
}
|
}
|
||||||
if (searchItemTest) {
|
if (searchItemTest) {
|
||||||
copyOfItems = copyOfItems.concat(processed);
|
|
||||||
if (searchFilter) {
|
if (searchFilter) {
|
||||||
processed = applySearchItemTest(processed);
|
processed = applySearchItemTest(processed);
|
||||||
}
|
}
|
||||||
|
copyOfItems = copyOfItems.concat(processed);
|
||||||
}
|
}
|
||||||
if (localSort) {
|
if (localSort) {
|
||||||
copyOfItems = copyOfItems.concat(processed);
|
copyOfItems = copyOfItems.concat(processed);
|
||||||
|
|
|
@ -34,7 +34,6 @@ StackView {
|
||||||
height: parent !== null ? parent.height : undefined
|
height: parent !== null ? parent.height : undefined
|
||||||
property int cardWidth: 212;
|
property int cardWidth: 212;
|
||||||
property int cardHeight: 152;
|
property int cardHeight: 152;
|
||||||
property string metaverseBase: addressBarDialog.metaverseServerUrl + "/api/v1/";
|
|
||||||
property var tablet: null;
|
property var tablet: null;
|
||||||
|
|
||||||
RootHttpRequest { id: http; }
|
RootHttpRequest { id: http; }
|
||||||
|
@ -322,7 +321,6 @@ StackView {
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
cardWidth: 312 + (2 * 4);
|
cardWidth: 312 + (2 * 4);
|
||||||
cardHeight: 163 + (2 * 4);
|
cardHeight: 163 + (2 * 4);
|
||||||
metaverseServerUrl: addressBarDialog.metaverseServerUrl;
|
|
||||||
labelText: 'HAPPENING NOW';
|
labelText: 'HAPPENING NOW';
|
||||||
actions: 'announcement';
|
actions: 'announcement';
|
||||||
filter: addressLine.text;
|
filter: addressLine.text;
|
||||||
|
@ -335,7 +333,6 @@ StackView {
|
||||||
cardWidth: 210;
|
cardWidth: 210;
|
||||||
cardHeight: 110 + messageHeight;
|
cardHeight: 110 + messageHeight;
|
||||||
messageHeight: 44;
|
messageHeight: 44;
|
||||||
metaverseServerUrl: addressBarDialog.metaverseServerUrl;
|
|
||||||
labelText: 'PLACES';
|
labelText: 'PLACES';
|
||||||
actions: 'concurrency';
|
actions: 'concurrency';
|
||||||
filter: addressLine.text;
|
filter: addressLine.text;
|
||||||
|
@ -349,7 +346,6 @@ StackView {
|
||||||
cardHeight: 75 + messageHeight + 4;
|
cardHeight: 75 + messageHeight + 4;
|
||||||
messageHeight: 32;
|
messageHeight: 32;
|
||||||
textPadding: 6;
|
textPadding: 6;
|
||||||
metaverseServerUrl: addressBarDialog.metaverseServerUrl;
|
|
||||||
labelText: 'RECENT SNAPS';
|
labelText: 'RECENT SNAPS';
|
||||||
actions: 'snapshot';
|
actions: 'snapshot';
|
||||||
filter: addressLine.text;
|
filter: addressLine.text;
|
||||||
|
|
Loading…
Reference in a new issue