mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 14:34:09 +00:00
Decouple skin settings from skin json to localsettings
This commit is contained in:
parent
c466ed8314
commit
0c780cd470
|
@ -205,13 +205,10 @@ window.WMTypeAhead = function(appendTo, searchInput) { // eslint-disable-line no
|
||||||
script = document.createElement('script');
|
script = document.createElement('script');
|
||||||
script.id = 'api_opensearch';
|
script.id = 'api_opensearch';
|
||||||
|
|
||||||
console.log("Created API script");
|
|
||||||
|
|
||||||
// Removed description prop
|
// Removed description prop
|
||||||
// TODO: Use text extract or PCS for description
|
// TODO: Use text extract or PCS for description
|
||||||
|
|
||||||
callbackIndex = window.callbackStack.addCallback(window.portalOpensearchCallback);
|
callbackIndex = window.callbackStack.addCallback(window.portalOpensearchCallback);
|
||||||
console.log("Called callback index");
|
|
||||||
|
|
||||||
searchQuery = {
|
searchQuery = {
|
||||||
action: 'query',
|
action: 'query',
|
||||||
|
@ -231,8 +228,6 @@ window.WMTypeAhead = function(appendTo, searchInput) { // eslint-disable-line no
|
||||||
|
|
||||||
script.src = hostname + serialize(searchQuery);
|
script.src = hostname + serialize(searchQuery);
|
||||||
docHead.appendChild(script);
|
docHead.appendChild(script);
|
||||||
|
|
||||||
console.log("Query script loaded");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// END loadQueryScript
|
// END loadQueryScript
|
||||||
|
@ -287,8 +282,6 @@ window.WMTypeAhead = function(appendTo, searchInput) { // eslint-disable-line no
|
||||||
pageDescription = '',
|
pageDescription = '',
|
||||||
i;
|
i;
|
||||||
|
|
||||||
console.log("Called Template String");
|
|
||||||
|
|
||||||
for (i = 0; i < suggestions.length; i++) {
|
for (i = 0; i < suggestions.length; i++) {
|
||||||
|
|
||||||
if (!suggestions[i]) {
|
if (!suggestions[i]) {
|
||||||
|
@ -402,42 +395,24 @@ window.WMTypeAhead = function(appendTo, searchInput) { // eslint-disable-line no
|
||||||
templateDOMString,
|
templateDOMString,
|
||||||
listEl;
|
listEl;
|
||||||
|
|
||||||
console.log("Defined vars in OpensearchCallback");
|
|
||||||
|
|
||||||
return function(xhrResults) {
|
return function(xhrResults) {
|
||||||
|
|
||||||
console.log("Returned xhrResults");
|
|
||||||
|
|
||||||
window.callbackStack.deletePrevCallbacks(callbackIndex);
|
window.callbackStack.deletePrevCallbacks(callbackIndex);
|
||||||
|
|
||||||
console.log("Deleted Prev Callbacks");
|
|
||||||
|
|
||||||
if (document.activeElement !== searchEl) {
|
if (document.activeElement !== searchEl) {
|
||||||
|
|
||||||
console.log("Not search El");
|
|
||||||
console.log(searchEl);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Yes search El");
|
|
||||||
|
|
||||||
suggestions = (xhrResults.query && xhrResults.query.pages) ?
|
suggestions = (xhrResults.query && xhrResults.query.pages) ?
|
||||||
xhrResults.query.pages : [];
|
xhrResults.query.pages : [];
|
||||||
|
|
||||||
console.log("before item in suggestions");
|
|
||||||
|
|
||||||
for (item in suggestions) {
|
for (item in suggestions) {
|
||||||
result = suggestions[item];
|
result = suggestions[item];
|
||||||
orderedResults[result.index - 1] = result;
|
orderedResults[result.index - 1] = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("after item in suggestions");
|
|
||||||
|
|
||||||
templateDOMString = generateTemplateString(orderedResults);
|
templateDOMString = generateTemplateString(orderedResults);
|
||||||
|
|
||||||
console.log("Generated Template String");
|
|
||||||
|
|
||||||
ssActiveIndex.setMax(orderedResults.length);
|
ssActiveIndex.setMax(orderedResults.length);
|
||||||
ssActiveIndex.clear();
|
ssActiveIndex.clear();
|
||||||
|
|
||||||
|
@ -452,8 +427,6 @@ window.WMTypeAhead = function(appendTo, searchInput) { // eslint-disable-line no
|
||||||
addEvent(listEl, 'mouseenter', toggleActiveClass.bind(this, listEl, typeAheadItems));
|
addEvent(listEl, 'mouseenter', toggleActiveClass.bind(this, listEl, typeAheadItems));
|
||||||
addEvent(listEl, 'mouseleave', toggleActiveClass.bind(this, listEl, typeAheadItems));
|
addEvent(listEl, 'mouseleave', toggleActiveClass.bind(this, listEl, typeAheadItems));
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Added mouse events");
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"CitizenThemeColor": "#11151d",
|
"CitizenThemeColor": "#11151d",
|
||||||
"CitizenEnablePreconnect": true,
|
"CitizenEnablePreconnect": false,
|
||||||
"CitizenPreconnectOrigin": "https://www.google-analytics.com",
|
"CitizenPreconnectOrigin": "",
|
||||||
"CitizenEnableManifest": true,
|
"CitizenEnableManifest": true,
|
||||||
"CitizenManifestThemeColor": "#11151d",
|
"CitizenManifestThemeColor": "#11151d",
|
||||||
"CitizenManifestBackgroundColor": "#fff"
|
"CitizenManifestBackgroundColor": "#fff"
|
||||||
|
|
Loading…
Reference in a new issue