mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: jquery xhtml violations
This commit is contained in:
@@ -500,7 +500,7 @@ app.cacheBuster = null;
|
||||
titleObj.interval = setInterval(function () {
|
||||
var title = titleObj.titles[titleObj.titles.indexOf(window.document.title) ^ 1];
|
||||
if (title) {
|
||||
window.document.title = $('<div/>').html(title).text();
|
||||
window.document.title = $('<div></div>').html(title).text();
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
@@ -510,7 +510,7 @@ app.cacheBuster = null;
|
||||
clearInterval(titleObj.interval);
|
||||
}
|
||||
if (titleObj.titles[0]) {
|
||||
window.document.title = $('<div/>').html(titleObj.titles[0]).text();
|
||||
window.document.title = $('<div></div>').html(titleObj.titles[0]).text();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,7 +64,7 @@ define('forum/chats/search', ['components'], function (components) {
|
||||
'<i class="fa fa-circle status ' + userObj.status + '"></i> ' + userObj.username;
|
||||
}
|
||||
|
||||
var chatEl = $('<li component="chat/search/user" />')
|
||||
var chatEl = $('<li component="chat/search/user"></li>')
|
||||
.attr('data-uid', userObj.uid)
|
||||
.appendTo(chatsListEl);
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
||||
|
||||
result.find('*').each(function () {
|
||||
$(this).after('<!-- ' + nested.length + ' -->');
|
||||
nested.push($('<div />').append($(this)));
|
||||
nested.push($('<div></div>').append($(this)));
|
||||
});
|
||||
|
||||
result.html(result.html().replace(regex, function (match, p1) {
|
||||
|
||||
@@ -26,7 +26,7 @@ define('autocomplete', function () {
|
||||
|
||||
if (result && result.users) {
|
||||
var names = result.users.map(function (user) {
|
||||
var username = $('<div/>').html(user.username).text();
|
||||
var username = $('<div></div>').html(user.username).text();
|
||||
return user && {
|
||||
label: username,
|
||||
value: username,
|
||||
|
||||
@@ -121,7 +121,7 @@ define('chat', [
|
||||
};
|
||||
|
||||
module.onRoomRename = function (data) {
|
||||
var newTitle = $('<div/>').html(data.newName).text();
|
||||
var newTitle = $('<div></div>').html(data.newName).text();
|
||||
var modal = module.getModal(data.roomId);
|
||||
modal.find('[component="chat/room/name"]').text(newTitle);
|
||||
taskbar.update('chat', modal.attr('data-uuid'), {
|
||||
|
||||
@@ -46,7 +46,7 @@ define('iconSelect', ['benchpress'], function (Benchpress) {
|
||||
className: 'btn-primary',
|
||||
callback: function () {
|
||||
var iconClass = $('.bootbox .selected').attr('class');
|
||||
var categoryIconClass = $('<div/>').addClass(iconClass).removeClass('fa').removeClass('selected')
|
||||
var categoryIconClass = $('<div></div>').addClass(iconClass).removeClass('fa').removeClass('selected')
|
||||
.attr('class');
|
||||
|
||||
if (categoryIconClass) {
|
||||
|
||||
@@ -33,7 +33,7 @@ define('settings/sorted-list', ['benchpress', 'jqueryui'], function (benchpress)
|
||||
var modal = bootbox.confirm(formHtml, function (save) {
|
||||
if (save) {
|
||||
var itemUUID = utils.generateUUID();
|
||||
var form = $('<form class="" data-sorted-list-uuid="' + itemUUID + '" data-sorted-list-object="' + key + '" />');
|
||||
var form = $('<form class="" data-sorted-list-uuid="' + itemUUID + '" data-sorted-list-object="' + key + '"></form>');
|
||||
form.append(modal.find('form').children());
|
||||
|
||||
$('#content').append(form.hide());
|
||||
@@ -83,7 +83,7 @@ define('settings/sorted-list', ['benchpress', 'jqueryui'], function (benchpress)
|
||||
|
||||
var modal = bootbox.confirm(form, function (save) {
|
||||
if (save) {
|
||||
var form = $('<form class="" data-sorted-list-uuid="' + itemUUID + '" data-sorted-list-object="' + key + '" />');
|
||||
var form = $('<form class="" data-sorted-list-uuid="' + itemUUID + '" data-sorted-list-object="' + key + '"></form>');
|
||||
form.append(modal.find('form').children());
|
||||
|
||||
$('#content').find('[data-sorted-list-uuid="' + itemUUID + '"][data-sorted-list-object="' + key + '"]').remove();
|
||||
|
||||
@@ -153,7 +153,7 @@ define('taskbar', ['benchpress', 'translator'], function (Benchpress, translator
|
||||
translator.translate(data.options.title, function (taskTitle) {
|
||||
var title = $('<div></div>').text(taskTitle || 'NodeBB Task').html();
|
||||
|
||||
var taskbarEl = $('<li />')
|
||||
var taskbarEl = $('<li></li>')
|
||||
.addClass(data.options.className)
|
||||
.html('<a href="#"' + (data.options.image ? ' style="background-image: url(\'' + data.options.image + '\'); background-size: cover;"' : '') + '>' +
|
||||
(data.options.icon ? '<i class="fa ' + data.options.icon + '"></i> ' : '') +
|
||||
|
||||
4
public/vendor/bootbox/bootbox.js
vendored
4
public/vendor/bootbox/bootbox.js
vendored
@@ -464,7 +464,7 @@
|
||||
if (option.group) {
|
||||
// initialise group if necessary
|
||||
if (!groups[option.group]) {
|
||||
groups[option.group] = $("<optgroup/>").attr("label", option.group);
|
||||
groups[option.group] = $("<optgroup></optgroup>").attr("label", option.group);
|
||||
}
|
||||
|
||||
elem = groups[option.group];
|
||||
@@ -496,7 +496,7 @@
|
||||
// checkboxes have to nest within a containing element, so
|
||||
// they break the rules a bit and we end up re-assigning
|
||||
// our 'input' element to this container instead
|
||||
input = $("<div/>");
|
||||
input = $("<div></div>");
|
||||
|
||||
each(inputOptions, function(_, option) {
|
||||
var checkbox = $(templates.inputs[options.inputType]);
|
||||
|
||||
Reference in New Issue
Block a user