更新 'SrcJyPublic.js'

master
src48597962 7 months ago
parent f9b0853ca0
commit 50738bb829
  1. 29
      SrcJyPublic.js

@ -413,8 +413,10 @@ function selectSource() {
let tmpList = sourceList; let tmpList = sourceList;
hikerPop.setUseStartActivity(false); hikerPop.setUseStartActivity(false);
function getnames(list) {
let index = 0; let index = 0;
let names = sourceList.map((v,i) => { let names = list.map((v,i) => {
let vname = v.name; let vname = v.name;
if(v.url == sourceUrl && v.name==sourceName){ if(v.url == sourceUrl && v.name==sourceName){
index = i; index = i;
@ -422,6 +424,11 @@ function selectSource() {
} }
return vname; return vname;
}); });
return {names:names,index:index};
}
let index_names = getnames(sourceList);
let index = index_names.index;
let names = index_names.names;
let spen = 3; let spen = 3;
let inputBox; let inputBox;
let pop = hikerPop.selectBottomRes({ let pop = hikerPop.selectBottomRes({
@ -454,20 +461,22 @@ function selectSource() {
columns: 3, columns: 3,
title: "切换源分组", title: "切换源分组",
//position: groupnames.indexOf(sourceName), //position: groupnames.indexOf(sourceName),
click(a) { click(s) {
if(a.startsWith('[')){ if(s.startsWith('[')){
inputBox.setTitle('全部'); inputBox.setTitle('全部');
inputBox.setDefaultValue(a); inputBox.setDefaultValue(s);
sourceList = getGroupLists(sourceAllList, '全部'); sourceList = getGroupLists(sourceAllList, '全部');
tmpList = sourceList.filter(x => x.name.toLowerCase().includes(s.toLowerCase()));
names = getnames(tmpList).names;
names = names.filter(x => x.toLowerCase().includes(s.toLowerCase()));
}else{ }else{
inputBox.setTitle(a); inputBox.setTitle(s);
inputBox.setDefaultValue(""); inputBox.setDefaultValue("");
sourceList = getGroupLists(sourceAllList, a); sourceList = getGroupLists(sourceAllList, s);
}
tmpList = sourceList; tmpList = sourceList;
names = sourceList.map((v,i) => { names = getnames(tmpList).names;
return v.name; }
});
manage.list.length = 0; manage.list.length = 0;
names.forEach(x => { names.forEach(x => {
manage.list.push(x); manage.list.push(x);

Loading…
Cancel
Save