Skip to content

Commit

Permalink
feat: new development switches
Browse files Browse the repository at this point in the history
  • Loading branch information
alex4401 committed Jul 24, 2024
1 parent c7d2199 commit 41f1a0c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
9 changes: 9 additions & 0 deletions css/components/RuntimeListUpdates.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[data-component="RuntimeListUpdates"] {
display: flex;
flex-direction: column;
align-items: flex-end;
}
[data-component="RuntimeListUpdates"] > span {
font-size: 0.9em;
opacity: 0.7;
}
5 changes: 5 additions & 0 deletions defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export default function () {

isRedirectDisabled: false,
disabledWikis: [],

// Developer settings - subject to change
useTabRedirect: !supportsDNR(),
useRuntimeLists: false,
rtListLastSyncTime: 0,
ffUseOptimisedSearchCore: false,

// Legacy search engine settings - this should be migrated and dropped in 1.7.0
searchMode: 'rewrite',
Expand Down
4 changes: 3 additions & 1 deletion js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from './util.js';
import SearchFilterSettings from './popup/SearchFilterSettings.js';
import WikiList from './popup/WikiList.js';
import RuntimeListUpdates from './popup/RuntimeListUpdates.js';
import * as DeclarativeSettings from './popup/DeclarativeSettings.js';


Expand Down Expand Up @@ -74,7 +75,8 @@ const RTW = {
initialiseComponents() {
const registry = {
SearchFilterSettings,
WikiList
WikiList,
RuntimeListUpdates,
};
for ( const element of document.querySelectorAll( '[data-component]' ) ) {
const compId = element.getAttribute( 'data-component' );
Expand Down
18 changes: 18 additions & 0 deletions js/popup/RuntimeListUpdates.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {
createDomElement,
getMessage
} from "../util.js";


export default class RuntimeListUpdates {
static initialise( container ) {
createDomElement( 'button', {
text: '[PH]Update now',
appendTo: container,
} );
createDomElement( 'span', {
text: 'Last updated: 99 seconds ago',
appendTo: container,
} );
}
}
20 changes: 20 additions & 0 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link rel="stylesheet" href="css/core.css" type="text/css" />
<link rel="stylesheet" href="css/popup.css" type="text/css" />
<link rel="stylesheet" href="css/components/WikiList.css" type="text/css" />
<link rel="stylesheet" href="css/components/RuntimeListUpdates.css" type="text/css" />
</head>
<body>
<div id="area-top">
Expand Down Expand Up @@ -71,6 +72,25 @@ <h5>Hidden options</h5>
data-off="false" />
<label for="useTabRedirect">Use legacy redirection method</label>
</div>
<div>
<input type="checkbox" id="ffUseOptimisedSearchCore"
data-component="DeclarativeSettings"
data-key="ffUseOptimisedSearchCore"
data-on="true"
data-off="false" />
<label for="ffUseOptimisedSearchCore">Use in-dev optimised search module core</label>
</div>
<div>
<input type="checkbox" id="useRuntimeLists"
data-component="DeclarativeSettings"
data-key="useRuntimeLists"
data-on="true"
data-off="false" />
<label for="useRuntimeLists">[PH]Allow use of runtime lists</label>
</div>
<div data-component="RuntimeListUpdates">
<!-- This will be filled in by JavaScript -->
</div>
</div>
</section>

Expand Down

0 comments on commit 41f1a0c

Please sign in to comment.