Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
videolan
vlc-gpu
Commits
ee9cedc7
Commit
ee9cedc7
authored
Nov 13, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "search as you type" to the HTTP interface.
parent
9f8aa0ff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
2 deletions
+36
-2
share/http-lua/dialogs/playlist
share/http-lua/dialogs/playlist
+9
-0
share/http-lua/images/reset.png
share/http-lua/images/reset.png
+0
-0
share/http-lua/js/functions.js
share/http-lua/js/functions.js
+14
-1
share/http-lua/requests/playlist.xml
share/http-lua/requests/playlist.xml
+13
-1
No files found.
share/http-lua/dialogs/playlist
View file @
ee9cedc7
...
...
@@ -88,6 +88,15 @@ This dialog needs the following dialogs to be fully functional: <none>
?>
</div>
</td>
<td
style=
'width: 30px'
></td>
<td>
<span
class=
"btn_text"
>
Live search:
</span>
<input
title=
"Live search"
type=
"text"
value=
"<?vlc if _G.search_key then print(search_key) else print('<search>') end ?>"
id=
"search"
onfocus=
"if( this.value == '<search>' ) this.value = ''"
onblur=
"if( this.value == '' ) reset_search()"
onchange=
"update_playlist_search(this.value)"
onkeyup=
"update_playlist_search(this.value)"
/>
<button
id=
"btn_search_reset"
onclick=
"reset_search()"
onmouseover=
"button_over(this);"
onmouseout=
"button_out(this);"
title=
"Reset search"
>
<img
src=
"images/reset.png"
alt=
"Reset"
/>
<span
class=
"btn_text"
>
Reset
</span>
</button>
</td>
</tr>
</table>
</div>
...
...
share/http-lua/images/reset.png
0 → 100644
View file @
ee9cedc7
215 Bytes
share/http-lua/js/functions.js
View file @
ee9cedc7
...
...
@@ -2,7 +2,7 @@
* functions.js: VLC media player web interface
*****************************************************************************
* Copyright (C) 2005-2006 the VideoLAN team
* $Id$
* $Id
: functions.js 21264 2007-08-19 17:48:28Z dionoea
$
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
...
...
@@ -395,6 +395,19 @@ function update_playlist()
{
loadXMLDoc
(
'
requests/playlist.xml
'
,
parse_playlist
);
}
function
update_playlist_search
(
key
)
{
loadXMLDoc
(
'
requests/playlist.xml?search=
'
+
encodeURIComponent
(
key
),
parse_playlist
)
}
function
reset_search
()
{
var
search
=
document
.
getElementById
(
'
search
'
)
if
(
search
)
{
search
.
value
=
'
<search>
'
update_playlist_search
(
''
)
}
}
/**********************************************************************
* Parse xml replies to XMLHttpRequests
...
...
share/http-lua/requests/playlist.xml
View file @
ee9cedc7
...
...
@@ -28,6 +28,7 @@ vim:syntax=lua
<
?vlc
--[[
<node
id=
"0"
name=
"Undefined"
ro=
"ro"
>
]]
function print_playlist(item)
if item.flags.disabled then return end
if item.children then
local name = vlc.convert_xml_special_chars(item.name)
print("
<node
id=
\""..tostring(item.id).."\"
name=
\""..name.."\"
ro=
\""..(item.flags.ro
and
"ro"
or
"rw").."\"
>
")
...
...
@@ -56,7 +57,18 @@ for cat,pl in pairs(p) do
print("
</node>
")
end
--]]
local p = vlc.playlist.get()
local p
if _GET["search"] then
if _GET["search"] ~= "" then
_G.search_key = _GET["search"]
else
_G.search_key = nil
end
local key = vlc.decode_uri(_GET["search"])
p = vlc.playlist.search(key)
else
p = vlc.playlist.get()
end
-- a(p) Uncomment to debug
print_playlist(p)
?>
...
...
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