Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
f5aec219
Commit
f5aec219
authored
Jan 18, 2019
by
Rob Stupay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search box nearly done - but not quite
parent
454778e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
2 deletions
+67
-2
plugin-manager-component.js
src/app/components/plugin-manager-component.js
+67
-2
No files found.
src/app/components/plugin-manager-component.js
View file @
f5aec219
...
@@ -40,7 +40,7 @@ class PluginManagerComponent {
...
@@ -40,7 +40,7 @@ class PluginManagerComponent {
render
()
{
render
()
{
this
.
views
.
activeMods
=
yo
`
this
.
views
.
activeMods
=
yo
`
<div id='activePlugs class=
${
css
.
activePlugins
}
>
<div id='activePlugs
'
class=
${
css
.
activePlugins
}
>
<h3>Active Modules</h3>
<h3>Active Modules</h3>
</div>
</div>
`
`
...
@@ -49,15 +49,20 @@ class PluginManagerComponent {
...
@@ -49,15 +49,20 @@ class PluginManagerComponent {
<h3>Inactive Modules</h3>
<h3>Inactive Modules</h3>
</div>
</div>
`
`
this
.
views
.
searchbox
=
yo
`
<input id='filter_plugins' placeholder='Search loaded plugins'>
`
var
rootView
=
yo
`
var
rootView
=
yo
`
<div id='pluginManager' class=
${
css
.
plugins_settings
}
>
<div id='pluginManager' class=
${
css
.
plugins_settings
}
>
<h2>Plugin Manager</h2>
<h2>Plugin Manager</h2>
<input placeholder="Search loaded plugins">
${
this
.
views
.
searchbox
}
${
this
.
views
.
activeMods
}
${
this
.
views
.
activeMods
}
${
this
.
views
.
inactiveMods
}
${
this
.
views
.
inactiveMods
}
</div>
</div>
`
`
this
.
views
.
searchbox
.
addEventListener
(
'keyup'
,
(
event
)
=>
{
this
.
filterPlugins
(
event
)
})
var
modulesActive
=
this
.
store
.
getActives
()
var
modulesActive
=
this
.
store
.
getActives
()
modulesActive
.
sort
(
function
(
a
,
b
)
{
modulesActive
.
sort
(
function
(
a
,
b
)
{
var
textA
=
a
.
profile
.
name
.
toUpperCase
()
var
textA
=
a
.
profile
.
name
.
toUpperCase
()
...
@@ -114,6 +119,66 @@ class PluginManagerComponent {
...
@@ -114,6 +119,66 @@ class PluginManagerComponent {
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
yo
.
update
(
this
.
views
.
root
,
this
.
render
())
}
}
}
}
filterPlugins
(
event
)
{
let
filterOn
=
event
.
target
.
value
.
toUpperCase
()
for
(
var
i
in
this
.
views
.
items
)
{
let
item
=
this
.
views
.
items
[
i
]
let
profileName
=
item
.
querySelector
(
'h3'
);
let
txtValue
=
profileName
.
textContent
||
profileName
.
innerText
;
// console.log('val: ' + txtValue)
// console.log('filter: ' + filterOn)
// if (txtValue.toUpperCase().indexOf(filterOn) > -1) {
// item.querySelector('div').style.display = ""
// } else {
// item.querySelector('div').style.display = "none"
// }
item
.
style
.
display
=
'none'
// console.log(`display ${item.querySelector('div').style.display}`)
}
// get the array of contained divs for active
// for (i = 0; i < li.length; i++) {
// a = li[i].getElementsByTagName("a")[0];
// txtValue = a.textContent || a.innerText;
// if (txtValue.toUpperCase().indexOf(filter) > -1) {
// li[i].style.display = "";
// } else {
// li[i].style.display = "none";
// }
// }
}
// now to the filter
// make an array of the profile.name
// check each element of the array to see if it contains the substring
// if it does push it into a new array
// assemble the object based on this array.
// filterPlugins () {
// var value = this.views.searchbox.value
// console.log ('msg ' + value)
// }
// if (e.keyCode === 27) {
// cancelListener()
// } else if (e.keyCode === 13) {
// e.preventDefault()
// okListener()
// }
// }
// document.getElementById('modal-background').addEventListener('click', cancelListener)
// .on("keyup", function() {
// var value = $(this).val().toLowerCase();
// $("#myTable tr").filter(function() {
// $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
// });
// });
}
}
module
.
exports
=
PluginManagerComponent
module
.
exports
=
PluginManagerComponent
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment