Skip to content

Commit

Permalink
Use let
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonXLF committed Apr 26, 2024
1 parent 9121367 commit 614a5c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions static/NamespaceLookupWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
OO.inheritClass(NamespaceLookupWidget, OO.ui.MenuTagMultiselectWidget);

NamespaceLookupWidget.prototype.clearMenu = function() {
var oldValues = this.getValue();
let oldValues = this.getValue();

this.clearItems();
this.getMenu().clearItems();
Expand All @@ -38,16 +38,16 @@ NamespaceLookupWidget.prototype.setDomain = function(domain) {
origin: '*',
formatversion: 2
}).then(function(res) {
var oldValues = this.getValue(),
let oldValues = this.getValue(),
options = [];

this.clearItems();
this.getMenu().clearItems();

for (var id in res.query.namespaces) {
for (let id in res.query.namespaces) {
if (id < 0) continue; // Ignore virtual namespaces

var info = res.query.namespaces[id];
let info = res.query.namespaces[id];

options.push({
data: info.id.toString(),
Expand Down
10 changes: 5 additions & 5 deletions static/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var projectLookup = OO.ui.infuse($('#project')),
let projectLookup = OO.ui.infuse($('#project')),
pageLookup = OO.ui.infuse($('#page'), {
domain: projectLookup.getDomain()
}),
Expand All @@ -13,11 +13,11 @@ var projectLookup = OO.ui.infuse($('#project')),
align: 'top'
}),
out = $('#out'),
request = undefined,
request,
currentSearch = location.search;

function submitForm(pushState) {
var params = {
let params = {
project: projectLookup.getValue(),
page: pageLookup.getValue(),
namespaces: namespacesSelect.getValue().join(',')
Expand Down Expand Up @@ -68,10 +68,10 @@ window.addEventListener('popstate', function() {
if (currentSearch === location.search) return;
currentSearch = location.search;

var params = {};
let params = {};

currentSearch.slice(1).split('&').forEach(param => {
var chunks = param.split('='),
let chunks = param.split('='),
key = chunks.shift(),
value = decodeURIComponent(chunks.join('='));

Expand Down

0 comments on commit 614a5c4

Please sign in to comment.