Help make libraries admin easier.

namespaces
Frode Petterson 2014-09-24 16:24:56 +02:00
parent 3442954971
commit d359ce52ca
2 changed files with 20 additions and 5 deletions

View File

@ -36,9 +36,18 @@ var H5PLibraryList= H5PLibraryList || {};
$.each (libraries.listData, function (index, library) { $.each (libraries.listData, function (index, library) {
var $libraryRow = H5PUtils.createTableRow([ var $libraryRow = H5PUtils.createTableRow([
library.title, library.title,
library.numContent, {
library.numContentDependencies, text: library.numContent,
library.numLibraryDependencies, class: 'h5p-admin-center'
},
{
text: library.numContentDependencies,
class: 'h5p-admin-center'
},
{
text: library.numLibraryDependencies,
class: 'h5p-admin-center'
},
'<div class="h5p-admin-buttons-wrapper">\ '<div class="h5p-admin-buttons-wrapper">\
<button class="h5p-admin-upgrade-library"></button>\ <button class="h5p-admin-upgrade-library"></button>\
<button class="h5p-admin-view-library" title="' + t.viewLibrary + '"></button>\ <button class="h5p-admin-view-library" title="' + t.viewLibrary + '"></button>\

View File

@ -16,7 +16,7 @@ var H5PUtils = H5PUtils || {};
$.each(headers, function (index, value) { $.each(headers, function (index, value) {
if (!(value instanceof Object)) { if (!(value instanceof Object)) {
value = { value = {
text: value html: value
}; };
} }
@ -38,7 +38,13 @@ var H5PUtils = H5PUtils || {};
var $tr = $('<tr></tr>'); var $tr = $('<tr></tr>');
$.each(rows, function (index, value) { $.each(rows, function (index, value) {
$tr.append('<td>' + value + '</td>'); if (!(value instanceof Object)) {
value = {
html: value
};
}
$('<td/>', value).appendTo($tr);
}); });
return $tr; return $tr;