Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cribjs-editor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
cribjs-editor
Commits
5ac5981d
Commit
5ac5981d
authored
Jul 28, 2020
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
URL-List Add basic Filter
parent
7a3c9ed0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
11 deletions
+38
-11
gadget/gadget_cribjs_page_url_list.html
gadget/gadget_cribjs_page_url_list.html
+6
-4
gadget/gadget_cribjs_page_url_list.js
gadget/gadget_cribjs_page_url_list.js
+32
-7
No files found.
gadget/gadget_cribjs_page_url_list.html
View file @
5ac5981d
...
...
@@ -18,7 +18,12 @@
<div
class=
"nav_content url_list container"
>
<form
class=
"crib-url-list-content"
>
<h3>
URL List
</h3>
<button
type=
"submit"
name=
"list-contents"
class=
"btn btn-default"
>
Refresh
</button>
<div
class=
"form-group"
>
<label>
Search:
<input
name=
"search-pattern"
class=
"search-pattern form-control"
type=
"text"
size=
"50"
value=
""
>
</label>
<button
type=
"submit"
name=
"list-contents"
class=
"btn btn-default"
>
Search
</button>
</div>
<table
class=
"table table-striped table-condensed"
>
<thead>
<tr>
...
...
@@ -32,9 +37,6 @@
<tbody>
</tbody>
</table>
<div>
<button
type=
"submit"
name=
"list-contents"
class=
"btn btn-default"
>
Refresh
</button>
</div>
</form>
</div>
</body>
...
...
gadget/gadget_cribjs_page_url_list.js
View file @
5ac5981d
...
...
@@ -4,24 +4,29 @@
"
use strict
"
;
function
displayURLList
(
gadget
,
event
)
{
var
url_list
;
var
url_list
=
{},
pattern
=
gadget
.
props
.
element
.
querySelector
(
"
.search-pattern
"
).
value
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
gadget
.
crib_sw_allDocs
();
})
.
push
(
function
(
data
)
{
var
promise_list
=
[],
tmp_url_list
=
[],
url
;
if
(
data
.
hasOwnProperty
(
"
urls
"
))
{
url_list
=
data
.
urls
;
tmp_
url_list
=
data
.
urls
;
}
else
{
url_list
=
data
;
tmp_
url_list
=
data
;
}
for
(
url
in
url_list
)
{
if
(
url_list
.
hasOwnProperty
(
url
))
{
for
(
url
in
tmp_url_list
)
{
if
(
tmp_url_list
.
hasOwnProperty
(
url
))
{
if
(
!
pattern
||
(
pattern
&&
url
.
indexOf
(
pattern
)
!=
-
1
))
{
url_list
[
url
]
=
""
;
promise_list
.
push
(
gadget
.
getUrlFor
({
page
:
'
editor
'
,
url
:
url
}));
}
}
}
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
url_link_list
)
{
...
...
@@ -92,6 +97,9 @@
})
.
declareAcquiredMethod
(
"
crib_sw_allDocs
"
,
"
crib_sw_allDocs
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
setSetting
"
,
"
setSetting
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
;
if
(
options
===
undefined
)
...
...
@@ -99,6 +107,17 @@
gadget
.
props
.
options
=
options
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
if
(
options
.
pattern
!==
undefined
)
{
return
gadget
.
setSetting
(
"
editor-pattern
"
,
options
.
pattern
)
.
push
(
function
()
{
return
options
.
pattern
;
});
}
return
gadget
.
getSetting
(
"
editor-pattern
"
,
""
);
})
.
push
(
function
(
pattern
)
{
gadget
.
props
.
element
.
querySelector
(
"
.search-pattern
"
,
options
.
pattern
)
.
value
=
pattern
;
return
displayURLList
(
gadget
,
undefined
);
})
.
push
(
function
()
{
...
...
@@ -116,7 +135,13 @@
gadget
.
props
.
element
.
querySelector
(
"
.crib-url-list-content
"
),
'
submit
'
,
false
,
function
(
event
)
{
displayURLList
(
gadget
,
event
);
}
function
(
event
)
{
gadget
.
redirect
({
page
:
"
url_list
"
,
pattern
:
gadget
.
props
.
element
.
querySelector
(
"
.search-pattern
"
)
.
value
});
}
);
});
});
...
...
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