MCPcopy
hub / github.com/pyload/pyload / search

Function search

module/web/media/js/pyplex/settings.js:55–81  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

53 var pluginList = $('#plugins-list').data('plugin');
54
55 function search(query) {
56 var results = [];
57 if (query) {
58 pluginList.forEach(function(p) {
59 if (p[1].toLowerCase().startsWith(query.toLowerCase())) {
60 results.push(p);
61 }
62 })
63 } else {
64 results = pluginList;
65 }
66
67 pluginListPanel.empty();
68
69 if (results.length) {
70 results.forEach(function (p) {
71 resultTemplate.clone().find('.plugin-row')
72 .attr('id', 'plugin|'.concat(p[0]))
73 .text(p[1])
74 .removeAttr('class')
75 .click(thisObject.menuClick)
76 .end().appendTo(pluginListPanel);
77 });
78 } else {
79 pluginListPanel.append(noresultTemplate);
80 }
81 }
82
83 searchInput.attr('placeholder', "{{_('Name of plugin')}}");
84 searchInput.removeAttr('disabled');

Callers 1

settings.jsFile · 0.70

Calls 4

attrMethod · 0.80
pushMethod · 0.45
findMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected