Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
8bce8679
Commit
8bce8679
authored
Jul 08, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ip configure
parent
6b500761
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
34 deletions
+47
-34
src/audioplayer/audioplayer.js
src/audioplayer/audioplayer.js
+10
-10
src/audioplayer_playlist/index.html
src/audioplayer_playlist/index.html
+10
-6
src/audioplayer_playlist/playlist.js
src/audioplayer_playlist/playlist.js
+27
-18
No files found.
src/audioplayer/audioplayer.js
View file @
8bce8679
...
...
@@ -52,6 +52,15 @@
.
allowPublicAcquisition
(
"
plDisablePage
"
,
function
()
{
disablePage
(
this
);
})
.
allowPublicAcquisition
(
"
plCreateHttpStorage
"
,
function
(
list
)
{
return
this
.
getDeclaredGadget
(
"
online
"
)
.
push
(
function
(
gadget
)
{
return
gadget
.
createJio
(
{
"
type
"
:
"
http
"
,
"
database
"
:
list
[
0
]}
);
});
})
.
allowPublicAcquisition
(
"
displayThisPage
"
,
function
(
param_list
)
{
// Hey, I want to display this page
return
this
.
aq_pleasePublishMyState
(
param_list
[
0
]);
...
...
@@ -104,16 +113,7 @@
rJS
(
window
)
.
ready
(
function
(
g
)
{
return
g
.
getDeclaredGadget
(
"
online
"
)
.
push
(
function
(
gadget
)
{
return
gadget
.
createJio
(
{
"
type
"
:
"
http
"
,
"
database
"
:
"
http://192.168.242.63:8080/
"
}
);
})
.
push
(
function
()
{
return
g
.
getDeclaredGadget
(
"
localhost
"
);
})
return
g
.
getDeclaredGadget
(
"
localhost
"
)
.
push
(
function
(
gadget
)
{
return
gadget
.
createJio
(
{
"
type
"
:
"
http
"
,
...
...
src/audioplayer_playlist/index.html
View file @
8bce8679
...
...
@@ -22,6 +22,10 @@
<script
src=
"./playlist.js"
type=
"text/javascript"
></script>
<body>
<div
data-role=
"collapsible"
data-collapsed-icon=
"gear"
data-expanded-icon=
"minus"
>
<h1>
online mode ip
</h1>
<input
type=
"text"
class=
"inputIp"
placeholder=
"http://xxx.xxx.xxx.xx:port/"
/>
</div>
<input
type=
"search"
class=
"research"
placeholder=
"research..."
/>
...
...
@@ -32,11 +36,11 @@
<div
data-role=
"footer"
data-position=
"fixed"
data-theme=
"b"
>
<div
data-role=
"navbar"
>
<div
data-role=
"navbar"
>
<ul>
<li><a
data-role=
"button"
class=
"offline"
data-icon=
"
arrow-l
"
>
offline
</a></li>
<li><a
data-role=
"button"
class=
"localhost"
data-icon=
"
arrow-r
"
>
localhost
</a></li>
<li><a
data-role=
"button"
class=
"online"
data-icon=
"
arrow-r
"
>
online
</a></li>
<li><a
data-role=
"button"
class=
"offline"
data-icon=
"
search
"
>
offline
</a></li>
<li><a
data-role=
"button"
class=
"localhost"
data-icon=
"
search
"
>
localhost
</a></li>
<li><a
data-role=
"button"
class=
"online"
data-icon=
"
search
"
>
online
</a></li>
</ul>
</div>
<!-- /navbar -->
</div>
<!-- /footer -->
...
...
src/audioplayer_playlist/playlist.js
View file @
8bce8679
/*global window, rJS, RSVP, console, jQuery, $, JSON, Handlebars,
promise
EventListener, RegExp */
loop
EventListener, RegExp */
/*jslint maxlen:80, nomen: true */
(
function
(
window
,
rJS
,
$
,
Handlebars
,
promise
EventListener
)
{
(
function
(
window
,
rJS
,
$
,
Handlebars
,
loop
EventListener
)
{
"
use strict
"
;
var
gk
=
rJS
(
window
),
rows_template_source
=
gk
.
__template_element
...
...
@@ -12,6 +12,7 @@
gk
.
declareAcquiredMethod
(
"
allDocs
"
,
"
allDocs
"
)
.
declareAcquiredMethod
(
"
displayThisPage
"
,
"
displayThisPage
"
)
.
declareAcquiredMethod
(
"
displayThisTitle
"
,
"
displayThisTitle
"
)
.
declareAcquiredMethod
(
"
plCreateHttpStorage
"
,
"
plCreateHttpStorage
"
)
.
declareAcquiredMethod
(
"
plEnablePage
"
,
"
plEnablePage
"
)
.
declareAcquiredMethod
(
"
pleaseRedirectMyHash
"
,
"
pleaseRedirectMyHash
"
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
...
...
@@ -43,13 +44,14 @@
return
gadget
.
allDocs
({
"
include_docs
"
:
true
});
})
.
push
(
function
(
e
)
{
var
tmp
=
[]
,
var
tmp
=
e
.
data
.
rows
,
i
,
j
,
exp
;
if
(
options
.
id
!==
undefined
&&
options
.
id
!==
"
offline
"
&&
options
.
id
!==
"
localhost
"
&&
options
.
id
!==
"
online
"
)
{
tmp
=
[];
for
(
i
=
0
,
j
=
0
;
i
<
e
.
data
.
rows
.
length
;
i
+=
1
)
{
exp
=
new
RegExp
(
options
.
id
,
"
i
"
);
if
(
e
.
data
.
rows
[
i
].
doc
.
title
.
search
(
exp
)
!==
-
1
)
{
...
...
@@ -57,22 +59,22 @@
j
+=
1
;
}
}
e
.
data
.
rows
=
tmp
;
gadget
.
id
=
options
.
id
;
}
list
.
innerHTML
=
rows_template
({
"
rows
"
:
e
.
data
.
rows
"
rows
"
:
tmp
});
$
(
list
).
listview
(
"
refresh
"
);
})
.
fail
(
function
(
error
)
{
document
.
getElementsByTagName
(
'
body
'
)[
0
].
textContent
=
JSON
.
stringify
(
error
)
;
"
network error: ip maybe not set
"
;
});
})
.
declareMethod
(
'
startService
'
,
function
()
{
var
g
=
this
,
research
=
g
.
__element
.
getElementsByClassName
(
'
research
'
)[
0
];
research
=
g
.
__element
.
getElementsByClassName
(
'
research
'
)[
0
],
ip
=
g
.
__element
.
getElementsByClassName
(
'
inputIp
'
)[
0
];
if
(
g
.
id
!==
undefined
)
{
research
.
value
=
g
.
id
;
}
...
...
@@ -81,14 +83,21 @@
return
g
.
plEnablePage
();
})
.
push
(
function
()
{
return
promiseEventListener
(
research
,
"
change
"
,
false
);
})
.
push
(
function
(
e
)
{
return
RSVP
.
any
([
loopEventListener
(
research
,
"
change
"
,
false
,
function
()
{
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
g
.
displayThisPage
({
page
:
"
playlist
"
,
id
:
research
.
value
});
})
.
push
(
function
(
url
)
{
window
.
location
=
url
;
});
});
}(
window
,
rJS
,
jQuery
,
Handlebars
,
promiseEventListener
));
}),
loopEventListener
(
ip
,
"
change
"
,
false
,
function
()
{
return
g
.
plCreateHttpStorage
(
ip
.
value
);
})
]);
//any
});
//rsvp
});
//startService
}(
window
,
rJS
,
jQuery
,
Handlebars
,
loopEventListener
));
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