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
cee5666a
Commit
cee5666a
authored
Jul 28, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve indexeddb get/set
parent
38d20eed
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
130 additions
and
85 deletions
+130
-85
dev/audioplayer/audioplayer.js
dev/audioplayer/audioplayer.js
+6
-0
dev/audioplayer_bridge/audiogadget.js
dev/audioplayer_bridge/audiogadget.js
+3
-0
dev/audioplayer_control/control.js
dev/audioplayer_control/control.js
+14
-17
dev/audioplayer_playlist_offline/playlist.js
dev/audioplayer_playlist_offline/playlist.js
+1
-1
dev/audioplayer_upload/upload.js
dev/audioplayer_upload/upload.js
+2
-2
dev/lib/jio.js
dev/lib/jio.js
+69
-38
src/audioplayer/audioplayer.js
src/audioplayer/audioplayer.js
+8
-0
src/audioplayer_bridge/audiogadget.js
src/audioplayer_bridge/audiogadget.js
+4
-0
src/audioplayer_control/control.js
src/audioplayer_control/control.js
+15
-20
src/audioplayer_playlist_offline/playlist.js
src/audioplayer_playlist_offline/playlist.js
+1
-0
src/audioplayer_upload/upload.js
src/audioplayer_upload/upload.js
+3
-3
src/audioplayer_video_control/control.js
src/audioplayer_video_control/control.js
+4
-2
src/audioplayer_video_control/index.html
src/audioplayer_video_control/index.html
+0
-2
No files found.
dev/audioplayer/audioplayer.js
View file @
cee5666a
...
...
@@ -120,6 +120,12 @@
return
jio_gadget
.
remove
.
apply
(
jio_gadget
,
param_list
);
});
}
}).
allowPublicAcquisition
(
"
jio_removeAttachment
"
,
function
(
param_list
)
{
if
(
this
.
storageType
===
0
)
{
return
this
.
getDeclaredGadget
(
storageType
(
this
.
storageType
)).
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
removeAttachment
.
apply
(
jio_gadget
,
param_list
);
});
}
}).
allowPublicAcquisition
(
"
displayThisTitle
"
,
function
(
param_list
)
{
var
header
=
this
.
__element
.
getElementsByTagName
(
"
h1
"
)[
0
];
header
.
innerHTML
=
param_list
[
0
];
...
...
dev/audioplayer_bridge/audiogadget.js
View file @
cee5666a
...
...
@@ -50,6 +50,9 @@
}).
declareMethod
(
"
remove
"
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
remove
.
apply
(
storage
,
arguments
);
}).
declareMethod
(
"
removeAttachment
"
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
removeAttachment
.
apply
(
storage
,
arguments
);
}).
declareMethod
(
"
put
"
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
put
.
apply
(
storage
,
arguments
);
...
...
dev/audioplayer_control/control.js
View file @
cee5666a
...
...
@@ -122,22 +122,13 @@
}).
push
(
function
(
value
)
{
value
=
value
||
5
e3
;
g
.
filter
.
frequency
.
value
=
value
;
}).
push
(
function
()
{
g
.
currentId
=
options
.
id
;
return
g
.
jio_get
({
_id
:
options
.
id
});
}).
push
(
function
(
result
)
{
var
share_context
=
g
.
__element
.
getElementsByClassName
(
"
share
"
)[
0
];
share_context
.
href
=
"
https://twitter.com/intent/tweet?hashtags=MusicPlayer&text=
"
+
encodeURI
(
result
.
data
.
title
);
g
.
length
=
Object
.
keys
(
result
.
data
.
_attachment
).
length
;
return
g
.
displayThisTitle
(
options
.
action
+
"
:
"
+
result
.
data
.
title
);
}).
push
(
function
()
{
return
g
.
allDocs
({
include_docs
:
true
});
}).
push
(
function
(
e
)
{
var
list
=
e
.
data
.
rows
,
id
,
index
,
control
=
"
control
"
;
var
list
=
e
.
data
.
rows
,
id
,
index
=
0
,
control
=
"
control
"
;
if
(
list
.
length
===
1
)
{
id
=
g
.
currentId
;
}
else
{
...
...
@@ -158,6 +149,15 @@
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
=
url
;
g
.
index
=
0
;
g
.
id
=
options
.
id
;
return
g
.
jio_get
({
_id
:
options
.
id
});
}).
push
(
function
(
result
)
{
var
share_context
=
g
.
__element
.
getElementsByClassName
(
"
share
"
)[
0
];
share_context
.
href
=
"
https://twitter.com/intent/tweet?hashtags=MusicPlayer&text=
"
+
encodeURI
(
result
.
data
.
title
);
g
.
length
=
Object
.
keys
(
result
.
data
.
_attachment
).
length
;
return
g
.
displayThisTitle
(
options
.
action
+
"
:
"
+
result
.
data
.
title
);
}).
push
(
function
()
{
return
g
.
jio_getAttachment
({
_id
:
options
.
id
,
_attachment
:
"
enclosure0
"
...
...
@@ -172,12 +172,10 @@
}).
push
(
undefined
,
function
(
error
)
{
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
window
.
location
=
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
;
if
(
error
.
status
===
404
&&
error
.
method
===
"
getAttachment
"
)
{
return
g
.
jio_remove
({
_id
:
error
.
id
});
}
}
});
}
}).
declareMethod
(
"
startService
"
,
function
()
{
...
...
@@ -215,7 +213,6 @@
_id
:
g
.
id
,
_attachment
:
"
enclosure
"
+
g
.
index
}).
then
(
function
(
blob
)
{
console
.
log
(
g
.
index
);
return
jIO
.
util
.
readBlobAsArrayBuffer
(
blob
);
}).
then
(
function
(
e
)
{
g
.
fin
=
true
;
...
...
@@ -229,7 +226,7 @@
});
}),
loopEventListener
(
g
.
audio
,
"
ended
"
,
false
,
function
()
{
if
(
loop
)
{
g
.
audio
.
load
()
;
g
.
audio
.
currentTime
=
0
;
g
.
audio
.
play
();
}
else
{
window
.
location
=
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
;
...
...
dev/audioplayer_playlist_offline/playlist.js
View file @
cee5666a
...
...
@@ -4,7 +4,7 @@
(
function
(
window
,
rJS
,
$
,
Handlebars
,
loopEventListener
)
{
"
use strict
"
;
var
gk
=
rJS
(
window
),
rows_template_source
=
gk
.
__template_element
.
getElementById
(
"
rows-template
"
).
innerHTML
,
rows_template
=
Handlebars
.
compile
(
rows_template_source
);
gk
.
declareAcquiredMethod
(
"
allDocs
"
,
"
allDocs
"
).
declareAcquiredMethod
(
"
jio_remove
"
,
"
jio_remove
"
).
declareAcquiredMethod
(
"
displayThisPage
"
,
"
displayThisPage
"
).
declareAcquiredMethod
(
"
displayThisTitle
"
,
"
displayThisTitle
"
).
declareAcquiredMethod
(
"
plEnablePage
"
,
"
plEnablePage
"
).
declareAcquiredMethod
(
"
pleaseRedirectMyHash
"
,
"
pleaseRedirectMyHash
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
gk
.
declareAcquiredMethod
(
"
allDocs
"
,
"
allDocs
"
).
declareAcquiredMethod
(
"
jio_remove
"
,
"
jio_remove
"
).
declareAcquiredMethod
(
"
jio_removeAttachment
"
,
"
jio_removeAttachment
"
).
declareAcquiredMethod
(
"
displayThisPage
"
,
"
displayThisPage
"
).
declareAcquiredMethod
(
"
displayThisTitle
"
,
"
displayThisTitle
"
).
declareAcquiredMethod
(
"
plEnablePage
"
,
"
plEnablePage
"
).
declareAcquiredMethod
(
"
pleaseRedirectMyHash
"
,
"
pleaseRedirectMyHash
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
list
=
gadget
.
__element
.
getElementsByTagName
(
"
ul
"
)[
0
];
return
new
RSVP
.
Queue
().
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
displayThisPage
({
...
...
dev/audioplayer_upload/upload.js
View file @
cee5666a
...
...
@@ -21,7 +21,7 @@
var
g
=
this
,
input_context
=
g
.
__element
.
getElementsByTagName
(
"
input
"
)[
0
],
info_context
=
g
.
__element
.
getElementsByClassName
(
"
info
"
)[
0
],
queue
,
uploaded
=
0
,
post
,
length
;
info_context
.
innerHTML
=
"
<ul>
"
;
function
putAll
(
id
,
index
,
file
)
{
var
blobLength
=
2
e6
,
size
=
blobLength
*
(
index
+
1
),
blob
;
var
blobLength
=
4
e6
,
size
=
blobLength
*
(
index
+
1
),
blob
;
if
(
size
>
file
.
size
)
{
blob
=
file
.
slice
(
blobLength
*
index
,
file
.
size
);
}
else
{
...
...
@@ -67,7 +67,7 @@
return
putAll
(
id
,
0
,
input_context
.
files
[
uploaded
]);
}).
fail
(
function
(
error
)
{
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
info_context
.
innerHTML
+=
input_context
.
files
[
uploaded
].
name
+
"
failed : storage maybe insufficient
"
;
info_context
.
innerHTML
+=
input_context
.
files
[
uploaded
].
name
+
"
"
+
error
.
target
.
error
.
name
;
//xxx
g
.
plEnablePage
();
return
g
.
jio_remove
({
...
...
dev/lib/jio.js
View file @
cee5666a
...
...
@@ -9283,9 +9283,16 @@ function sequence(thens) {
}
}
function
transactionEnd
(
transaction
)
{
var
resolver
;
resolver
=
function
(
resolve
,
reject
)
{
transaction
.
onabort
=
reject
;
transaction
.
oncomplete
=
function
()
{
resolve
(
"
end
"
);
};
};
return
new
RSVP
.
Promise
(
resolver
);
}
/**
* get a data from a store object
* @param {ObjectStore} store The objectstore
...
...
@@ -9313,8 +9320,12 @@ function sequence(thens) {
function
removeIndexedDB
(
store
,
id
)
{
function
resolver
(
resolve
,
reject
)
{
var
request
=
store
[
"
delete
"
](
id
);
request
.
onerror
=
reject
;
request
.
onsuccess
=
resolve
;
request
.
onerror
=
function
(
e
)
{
reject
(
"
remove error
"
);
};
request
.
onsuccess
=
function
(
e
){
resolve
(
request
.
result
);
};
}
return
new
RSVP
.
Promise
(
resolver
);
}
...
...
@@ -9382,18 +9393,19 @@ function sequence(thens) {
//create an id in attachment si necessary
if
(
researchResult
.
result
===
undefined
)
{
return
putIndexedDB
(
researchResult
.
store
,
{
"
_id
"
:
metadata
.
_id
});
}
else
{
return
end
(
result
);
}
})
.
push
(
function
()
{
return
transactionEnd
(
transaction
);
})
.
push
(
function
()
{
return
end
(
result
);
})
.
push
(
undefined
,
function
(
error
)
{
// Check if transaction is ongoing, if so, abort it
if
(
transaction
!==
undefined
)
{
transaction
.
abort
();
}
//
if (transaction !== undefined) {
//
transaction.abort();
//
}
if
(
global_db
!==
undefined
)
{
global_db
.
close
();
}
...
...
@@ -9441,13 +9453,16 @@ function sequence(thens) {
if
(
result
.
_attachment
)
{
meta
.
_attachment
=
result
.
_attachment
;
}
return
transactionEnd
(
transaction
);
})
.
push
(
function
()
{
return
({
"
data
"
:
meta
});
})
.
push
(
undefined
,
function
(
error
)
{
// Check if transaction is ongoing, if so, abort it
if
(
transaction
!==
undefined
)
{
transaction
.
abort
();
}
//
if (transaction !== undefined) {
//
transaction.abort();
//
}
if
(
global_db
!==
undefined
)
{
global_db
.
close
();
}
...
...
@@ -9468,6 +9483,14 @@ function sequence(thens) {
transaction
,
global_db
,
queue
=
new
RSVP
.
Queue
();
function
tmp
(
index
,
array
,
store
)
{
return
removeIndexedDB
(
store
,
[
param
.
_id
,
array
[
index
]])
.
then
(
function
(
e
)
{
if
(
index
<
array
.
length
-
1
)
{
return
tmp
(
index
+
1
,
array
,
store
);
}
});
};
return
queue
.
push
(
function
()
{
return
openIndexedDB
(
jio_storage
.
_database_name
);
})
...
...
@@ -9491,15 +9514,10 @@ function sequence(thens) {
})
.
push
(
function
(
result
)
{
if
(
result
.
_attachment
)
{
var
i
,
l
,
key
,
array
,
func
,
store
;
var
array
,
store
;
array
=
Object
.
keys
(
result
.
_attachment
);
store
=
transaction
.
objectStore
(
"
blob
"
);
for
(
i
=
0
,
l
=
array
.
length
;
i
<
l
;
i
+=
1
)
{
key
=
array
[
i
];
//delete blob
func
=
removeIndexedDB
(
store
,
[
param
.
_id
,
key
]);
queue
.
push
(
func
);
}
return
tmp
(
0
,
array
,
store
);
}
})
.
push
(
function
()
{
...
...
@@ -9507,14 +9525,17 @@ function sequence(thens) {
//delete attachment
return
removeIndexedDB
(
store
,
param
.
_id
);
})
.
push
(
function
()
{
return
transactionEnd
(
transaction
);
})
.
push
(
function
()
{
return
({
"
status
"
:
204
});
})
.
push
(
undefined
,
function
(
error
)
{
// Check if transaction is ongoing, if so, abort it
if
(
transaction
!==
undefined
)
{
transaction
.
abort
();
}
//
if (transaction !== undefined) {
//
transaction.abort();
//
}
if
(
global_db
!==
undefined
)
{
global_db
.
close
();
}
...
...
@@ -9762,14 +9783,18 @@ function sequence(thens) {
return
putIndexedDB
(
store
,
{
"
_id
"
:
metadata
.
_id
,
"
_attachment
"
:
metadata
.
_attachment
,
"
blob
"
:
metadata
.
_blob
},
readResult
);
}).
push
(
function
()
{
})
.
push
(
function
()
{
return
transactionEnd
(
transaction
);
})
.
push
(
function
()
{
return
{
"
status
"
:
204
};
})
.
push
(
undefined
,
function
(
error
)
{
// Check if transaction is ongoing, if so, abort it
if
(
transaction
!==
undefined
)
{
transaction
.
abort
();
}
//
if (transaction !== undefined) {
//
transaction.abort();
//
}
if
(
global_db
!==
undefined
)
{
global_db
.
close
();
}
...
...
@@ -9872,15 +9897,18 @@ function sequence(thens) {
delete
result
.
_attachment
[
param
.
_attachment
];
var
store
=
transaction
.
objectStore
(
"
attachment
"
);
return
putIndexedDB
(
store
,
result
);
})
.
push
(
function
()
{
return
transactionEnd
(
transaction
);
})
.
push
(
function
()
{
return
({
"
status
"
:
204
});
})
.
push
(
undefined
,
function
(
error
)
{
// Check if transaction is ongoing, if so, abort it
if
(
transaction
!==
undefined
)
{
transaction
.
abort
();
}
//
if (transaction !== undefined) {
//
transaction.abort();
//
}
if
(
global_db
!==
undefined
)
{
global_db
.
close
();
}
...
...
@@ -9979,13 +10007,16 @@ decodeURI, encodeURI*/
result
=
result
.
substring
(
index
+
7
);
index
=
result
.
indexOf
(
"
\"
>
"
);
url
=
result
.
substring
(
0
,
index
);
if
(
url
.
indexOf
(
"
.mp3
"
)
===
-
1
&&
url
.
indexOf
(
"
.webm
"
)
===
-
1
)
{
if
(
url
.
indexOf
(
"
.mp3
"
)
===
-
1
&&
url
.
indexOf
(
"
.mp4
"
)
===
-
1
&&
url
.
indexOf
(
"
.webm
"
)
===
-
1
)
{
result
=
result
.
substring
(
index
+
2
);
}
else
{
if
(
url
.
indexOf
(
"
.webm
"
)
!==
-
1
)
{
type
=
"
video/webm
"
;
if
(
url
.
indexOf
(
"
.mp4
"
)
!==
-
1
)
{
type
=
"
video/mp4
"
;
}
else
if
(
url
.
indexOf
(
"
.webm
"
)
!==
-
1
)
{
type
=
"
audio/webm
"
}
else
{
type
=
"
audio/mp3
"
type
=
"
audio/mp3
"
;
}
name
=
decodeURI
(
url
);
rows
.
push
({
...
...
src/audioplayer/audioplayer.js
View file @
cee5666a
...
...
@@ -140,6 +140,14 @@
});
}
})
.
allowPublicAcquisition
(
"
jio_removeAttachment
"
,
function
(
param_list
)
{
if
(
this
.
storageType
===
0
)
{
return
this
.
getDeclaredGadget
(
storageType
(
this
.
storageType
))
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
removeAttachment
.
apply
(
jio_gadget
,
param_list
);
});
}
})
.
allowPublicAcquisition
(
"
displayThisTitle
"
,
function
(
param_list
)
{
var
header
=
this
.
__element
.
getElementsByTagName
(
"
h1
"
)[
0
];
header
.
innerHTML
=
param_list
[
0
];
...
...
src/audioplayer_bridge/audiogadget.js
View file @
cee5666a
...
...
@@ -64,6 +64,10 @@
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
remove
.
apply
(
storage
,
arguments
);
})
.
declareMethod
(
'
removeAttachment
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
removeAttachment
.
apply
(
storage
,
arguments
);
})
.
declareMethod
(
'
put
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
;
return
storage
.
put
.
apply
(
storage
,
arguments
);
...
...
src/audioplayer_control/control.js
View file @
cee5666a
...
...
@@ -178,19 +178,7 @@
.
push
(
function
(
value
)
{
value
=
value
||
5000
;
g
.
filter
.
frequency
.
value
=
value
;
})
.
push
(
function
()
{
g
.
currentId
=
options
.
id
;
return
g
.
jio_get
({
"
_id
"
:
options
.
id
});
})
.
push
(
function
(
result
)
{
var
share_context
=
g
.
__element
.
getElementsByClassName
(
"
share
"
)[
0
];
share_context
.
href
=
"
https://twitter.com/intent/tweet?hashtags=MusicPlayer&text=
"
+
encodeURI
(
result
.
data
.
title
);
g
.
length
=
Object
.
keys
(
result
.
data
.
_attachment
).
length
;
return
g
.
displayThisTitle
(
options
.
action
+
"
:
"
+
result
.
data
.
title
);
})
.
push
(
function
()
{
return
g
.
allDocs
({
"
include_docs
"
:
true
});
...
...
@@ -198,7 +186,7 @@
.
push
(
function
(
e
)
{
var
list
=
e
.
data
.
rows
,
id
,
index
,
index
=
0
,
control
=
"
control
"
;
if
(
list
.
length
===
1
)
{
id
=
g
.
currentId
;
...
...
@@ -219,6 +207,18 @@
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
=
url
;
g
.
index
=
0
;
g
.
id
=
options
.
id
;
return
g
.
jio_get
({
"
_id
"
:
options
.
id
});
})
.
push
(
function
(
result
)
{
var
share_context
=
g
.
__element
.
getElementsByClassName
(
"
share
"
)[
0
];
share_context
.
href
=
"
https://twitter.com/intent/tweet?hashtags=MusicPlayer&text=
"
+
encodeURI
(
result
.
data
.
title
);
g
.
length
=
Object
.
keys
(
result
.
data
.
_attachment
).
length
;
return
g
.
displayThisTitle
(
options
.
action
+
"
:
"
+
result
.
data
.
title
);
})
.
push
(
function
()
{
return
g
.
jio_getAttachment
({
"
_id
"
:
options
.
id
,
"
_attachment
"
:
"
enclosure0
"
});
})
...
...
@@ -234,11 +234,8 @@
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
window
.
location
=
g
.
__element
.
getElementsByClassName
(
"
next
"
)[
0
].
href
;
if
((
error
.
status
===
404
)
&&
(
error
.
method
===
"
getAttachment
"
))
{
return
g
.
jio_remove
({
"
_id
"
:
error
.
id
});
}
}
});
}
})
...
...
@@ -293,7 +290,6 @@
return
g
.
jio_getAttachment
({
"
_id
"
:
g
.
id
,
"
_attachment
"
:
"
enclosure
"
+
g
.
index
})
.
then
(
function
(
blob
)
{
console
.
log
(
g
.
index
);
return
jIO
.
util
.
readBlobAsArrayBuffer
(
blob
);
})
.
then
(
function
(
e
)
{
...
...
@@ -302,7 +298,6 @@
});
}),
loopEventListener
(
mute_context
,
"
click
"
,
false
,
function
()
{
mute_context
.
innerHTML
=
g
.
gain
.
gain
.
value
?
"
mute on
"
:
"
mute off
"
;
...
...
@@ -312,7 +307,7 @@
loopEventListener
(
g
.
audio
,
"
ended
"
,
false
,
function
()
{
if
(
loop
)
{
g
.
audio
.
load
()
;
g
.
audio
.
currentTime
=
0
;
g
.
audio
.
play
();
}
else
{
window
.
location
=
g
.
__element
...
...
src/audioplayer_playlist_offline/playlist.js
View file @
cee5666a
...
...
@@ -11,6 +11,7 @@
rows_template
=
Handlebars
.
compile
(
rows_template_source
);
gk
.
declareAcquiredMethod
(
"
allDocs
"
,
"
allDocs
"
)
.
declareAcquiredMethod
(
"
jio_remove
"
,
"
jio_remove
"
)
.
declareAcquiredMethod
(
"
jio_removeAttachment
"
,
"
jio_removeAttachment
"
)
.
declareAcquiredMethod
(
"
displayThisPage
"
,
"
displayThisPage
"
)
.
declareAcquiredMethod
(
"
displayThisTitle
"
,
"
displayThisTitle
"
)
.
declareAcquiredMethod
(
"
plEnablePage
"
,
"
plEnablePage
"
)
...
...
src/audioplayer_upload/upload.js
View file @
cee5666a
...
...
@@ -40,7 +40,7 @@
length
;
info_context
.
innerHTML
=
"
<ul>
"
;
function
putAll
(
id
,
index
,
file
)
{
var
blobLength
=
2
000000
,
var
blobLength
=
4
000000
,
size
=
blobLength
*
(
index
+
1
),
blob
;
if
(
size
>
file
.
size
)
{
...
...
@@ -96,8 +96,8 @@
.
fail
(
function
(
error
)
{
if
(
!
(
error
instanceof
RSVP
.
CancellationError
))
{
info_context
.
innerHTML
+=
input_context
.
files
[
uploaded
].
name
+
"
failed : storage maybe insufficient
"
;
input_context
.
files
[
uploaded
].
name
+
"
"
+
error
.
target
.
error
.
name
;
//xxx
g
.
plEnablePage
();
return
g
.
jio_remove
({
"
_id
"
:
id
});
...
...
src/audioplayer_video_control/control.js
View file @
cee5666a
...
...
@@ -49,7 +49,7 @@
.
push
(
function
(
e
)
{
var
list
=
e
.
data
.
rows
,
id
,
index
,
index
=
0
,
control
=
"
control
"
;
if
(
list
.
length
===
1
)
{
id
=
g
.
currentId
;
...
...
@@ -96,6 +96,9 @@
.
declareMethod
(
"
startService
"
,
function
()
{
var
g
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
g
.
plEnablePage
();
})
.
push
(
function
()
{
return
RSVP
.
any
([
loopEventListener
(
g
.
sourceBuffer
,
"
updateend
"
,
false
,
function
()
{
...
...
@@ -111,7 +114,6 @@
return
g
.
jio_getAttachment
({
"
_id
"
:
g
.
id
,
"
_attachment
"
:
"
enclosure
"
+
g
.
index
})
.
then
(
function
(
blob
)
{
console
.
log
(
g
.
index
);
return
jIO
.
util
.
readBlobAsArrayBuffer
(
blob
);
})
.
then
(
function
(
e
)
{
...
...
src/audioplayer_video_control/index.html
View file @
cee5666a
...
...
@@ -29,8 +29,6 @@
<div
data-role=
"footer"
data-position=
"fixed"
data-theme=
"b"
>
<div
data-role=
"navbar"
>
<ul>
<li><a
data-role=
"button"
class=
"mute"
data-icon=
"info"
>
mute off
</a></li>
<li><a
data-role=
"button"
class=
"command"
data-icon=
"gear"
>
stop
</a></li>
<li><a
data-role=
"button"
class=
"next"
data-icon=
"arrow-r"
>
next(random)
</a></li>
<li><a
data-role=
"button"
class=
"share"
data-icon=
"star"
target=
"_blank"
>
share
</a></li>
</ul>
...
...
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