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
89d5f937
Commit
89d5f937
authored
Jul 16, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve ip check
parent
6fc714bf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
27 deletions
+34
-27
src/audioplayer/audioPlayer.appcache
src/audioplayer/audioPlayer.appcache
+14
-5
src/audioplayer/index.html
src/audioplayer/index.html
+1
-1
src/audioplayer_bridge/audiogadget.js
src/audioplayer_bridge/audiogadget.js
+0
-7
src/audioplayer_playlist_online/index.html
src/audioplayer_playlist_online/index.html
+1
-1
src/audioplayer_playlist_online/playlist.js
src/audioplayer_playlist_online/playlist.js
+18
-13
No files found.
src/audioplayer/audioPlayer.appcache
View file @
89d5f937
CACHE MANIFEST
CACHE MANIFEST
# v1
# v1
.2
CACHE:
CACHE:
audioplayer.css
audioplayer.css
...
@@ -10,10 +10,14 @@ audioplayer.js
...
@@ -10,10 +10,14 @@ audioplayer.js
../audioplayer_control/index.html
../audioplayer_control/index.html
../audioplayer_control/control.js
../audioplayer_control/control.js
../audioplayer_control/control.css
../audioplayer_control/control.css
../audioplayer_playlist/index.html
../audioplayer_playlist_online/index.html
../audioplayer_playlist/playlist.js
../audioplayer_playlist_online/playlist.js
../audioplayer_playlist_offline/index.html
../audioplayer_playlist_offline/playlist.js
../audioplayer_playlist_local/index.html
../audioplayer_playlist_local/playlist.js
../audioplayer_upload/upload.js
../audioplayer_upload/upload.js
../audioplayer_upload/index.
js
../audioplayer_upload/index.
html
../lib/URI.js
../lib/URI.js
../lib/handlebars.min.js
../lib/handlebars.min.js
../lib/jio.js
../lib/jio.js
...
@@ -22,4 +26,9 @@ audioplayer.js
...
@@ -22,4 +26,9 @@ audioplayer.js
../lib/jquerymobile.js
../lib/jquerymobile.js
../lib/renderjs.min.js
../lib/renderjs.min.js
../lib/rsvp.min.js
../lib/rsvp.min.js
../lib/uritemplate.min.js
../lib/uritemplate.min.js
\ No newline at end of file
../lib/images/ajax-loader.gif
http://git.erp5.org/gitweb/dream.git/blob_plain/refs/heads/renderjs2:/dream/platform/src2/dream/mixin_promise.js
NETWORK:
*
\ No newline at end of file
src/audioplayer/index.html
View file @
89d5f937
<!DOCTYPE html>
<!DOCTYPE html>
<
!--html manifest="audioPlayer.appcache"--
>
<
html
manifest=
"audioPlayer.appcache"
>
<head>
<head>
<!-- renderjs -->
<!-- renderjs -->
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
...
...
src/audioplayer_bridge/audiogadget.js
View file @
89d5f937
...
@@ -47,16 +47,9 @@
...
@@ -47,16 +47,9 @@
.
declareMethod
(
'
getAttachment
'
,
function
()
{
.
declareMethod
(
'
getAttachment
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
getAttachment
.
apply
(
storage
,
arguments
)
return
storage
.
getAttachment
.
apply
(
storage
,
arguments
)
// XXX Where to put this &@! blob reading
.
then
(
function
(
response
)
{
.
then
(
function
(
response
)
{
return
response
.
data
;
return
response
.
data
;
//return jIO.util.readBlobAsText(response.data);
});
});
/*
.then(function (lala) {
console.log(lala.target.result);
return lala.target.result;
});*/
})
})
.
declareMethod
(
'
putAttachment
'
,
function
()
{
.
declareMethod
(
'
putAttachment
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
...
...
src/audioplayer_playlist_online/index.html
View file @
89d5f937
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<script
src=
"./playlist.js"
type=
"text/javascript"
></script>
<script
src=
"./playlist.js"
type=
"text/javascript"
></script>
<body>
<body>
<input
type=
"text"
class=
"inputIp"
placeholder=
"input ip: http://xxx.xxx.xxx.xxx:port/
xxx is between 0 ~ 255
"
/>
<input
type=
"text"
class=
"inputIp"
placeholder=
"input ip: http://xxx.xxx.xxx.xxx:port/
(xxx is between 0 ~ 255)
"
/>
<input
type=
"search"
class=
"research"
placeholder=
"research..."
/>
<input
type=
"search"
class=
"research"
placeholder=
"research..."
/>
...
...
src/audioplayer_playlist_online/playlist.js
View file @
89d5f937
...
@@ -81,14 +81,12 @@
...
@@ -81,14 +81,12 @@
tmp
.
length
+
"
music
"
);
tmp
.
length
+
"
music
"
);
})
})
.
fail
(
function
(
error
)
{
.
fail
(
function
(
error
)
{
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
if
(
ipValue
)
{
if
(
ipValue
)
{
gadget
.
__element
.
getElementsByClassName
(
'
info
'
)[
0
].
innerHTML
=
gadget
.
__element
.
getElementsByClassName
(
'
info
'
)[
0
].
innerHTML
=
"
network error
"
;
"
network error
"
;
}
return
gadget
.
displayThisTitle
(
"
online playlist:
"
+
"
0 music
"
);
}
}
return
gadget
.
displayThisTitle
(
"
online playlist:
"
+
"
0 music
"
);
});
});
})
})
.
declareMethod
(
'
startService
'
,
function
()
{
.
declareMethod
(
'
startService
'
,
function
()
{
...
@@ -118,15 +116,26 @@
...
@@ -118,15 +116,26 @@
var
info
=
g
.
__element
.
getElementsByClassName
(
'
info
'
)[
0
],
var
info
=
g
.
__element
.
getElementsByClassName
(
'
info
'
)[
0
],
http
,
http
,
port
,
port
,
portEnd
,
ipValue
=
ip
.
value
;
ipValue
=
ip
.
value
;
http
=
ipValue
.
indexOf
(
"
http
"
);
g
.
__element
.
getElementsByTagName
(
'
ul
'
)[
0
].
innerHTML
=
"
"
;
if
(
ipValue
.
indexOf
(
"
/
"
,
ipValue
.
length
-
1
)
===
-
1
)
{
info
.
innerHTML
=
"
not end with /
"
;
return
;
}
http
=
ipValue
.
indexOf
(
"
http://
"
);
ipValue
=
ipValue
.
substring
(
ipValue
.
indexOf
(
"
//
"
)
+
2
);
ipValue
=
ipValue
.
substring
(
ipValue
.
indexOf
(
"
//
"
)
+
2
);
port
=
ipValue
.
indexOf
(
"
:
"
);
port
=
ipValue
.
indexOf
(
"
:
"
);
portEnd
=
ipValue
.
indexOf
(
"
:/
"
);
if
(
port
!==
-
1
)
{
if
(
port
!==
-
1
)
{
ipValue
=
ipValue
.
substring
(
0
,
port
);
ipValue
=
ipValue
.
substring
(
0
,
port
);
}
}
if
(
http
===
-
1
)
{
if
(
http
===
-
1
)
{
info
.
innerHTML
=
"
please start ip with http
"
;
info
.
innerHTML
=
"
please start ip with http://
"
;
return
;
}
if
(
port
===
-
1
||
portEnd
!==
-
1
)
{
info
.
innerHTML
=
"
input port number
"
;
return
;
return
;
}
}
if
(
checkIp
(
ipValue
)
===
false
)
{
if
(
checkIp
(
ipValue
)
===
false
)
{
...
@@ -134,10 +143,6 @@
...
@@ -134,10 +143,6 @@
"
invalide ip: ip should like xxx.xxx.xxx.xxx(xxx is between 0 ~ 255)
"
;
"
invalide ip: ip should like xxx.xxx.xxx.xxx(xxx is between 0 ~ 255)
"
;
return
;
return
;
}
}
if
(
port
===
-
1
)
{
info
.
innerHTML
=
"
input port number
"
;
return
;
}
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
return
g
.
plCreateHttpStorage
(
ip
.
value
);
return
g
.
plCreateHttpStorage
(
ip
.
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