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
587b48f2
Commit
587b48f2
authored
Jul 08, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change use of requestAnimationFrame
parent
8bce8679
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
12 deletions
+36
-12
src/audioplayer/audioplayer.js
src/audioplayer/audioplayer.js
+7
-1
src/audioplayer_bridge/audiogadget.js
src/audioplayer_bridge/audiogadget.js
+3
-0
src/audioplayer_control/control.js
src/audioplayer_control/control.js
+22
-11
src/audioplayer_upload/upload.js
src/audioplayer_upload/upload.js
+4
-0
No files found.
src/audioplayer/audioplayer.js
View file @
587b48f2
...
...
@@ -72,7 +72,7 @@
})
.
allowPublicAcquisition
(
"
plGive
"
,
function
(
param_list
)
{
if
(
this
.
save
===
undefined
)
{
return
0
;
return
this
.
save
;
}
return
this
.
save
[
param_list
[
0
]];
})
...
...
@@ -88,6 +88,12 @@
return
jio_gadget
.
post
.
apply
(
jio_gadget
,
param_list
);
});
})
.
allowPublicAcquisition
(
"
invalideJioSave
"
,
function
(
param_list
)
{
return
this
.
getDeclaredGadget
(
storageType
(
this
.
storageType
))
.
push
(
function
(
jio_gadget
)
{
return
jio_gadget
.
invalideJioSave
.
apply
(
jio_gadget
,
param_list
);
});
})
.
allowPublicAcquisition
(
"
jio_putAttachment
"
,
function
(
param_list
)
{
return
this
.
getDeclaredGadget
(
storageType
(
this
.
storageType
))
.
push
(
function
(
jio_gadget
)
{
...
...
src/audioplayer_bridge/audiogadget.js
View file @
587b48f2
...
...
@@ -13,6 +13,9 @@
.
declareMethod
(
'
createJio
'
,
function
(
jio_options
)
{
this
.
state_parameter_dict
.
jio_storage
=
jIO
.
createJIO
(
jio_options
);
})
.
declareMethod
(
'
invalideJioSave
'
,
function
(
jio_options
)
{
this
.
save
=
{};
})
.
declareMethod
(
'
allDocs
'
,
function
()
{
var
storage
=
this
.
state_parameter_dict
.
jio_storage
,
that
=
this
;
...
...
src/audioplayer_control/control.js
View file @
587b48f2
...
...
@@ -90,12 +90,28 @@
}
function
promiseRequestAnimation
(
callback
)
{
var
animationId
;
var
animationId
,
callback_promise
;
function
canceller
()
{
window
.
cancelAnimationFrame
(
animationId
);
if
(
callback_promise
!==
undefined
)
{
callback_promise
.
cancel
();
}
}
function
resolver
(
resolve
)
{
animationId
=
window
.
requestAnimationFrame
(
callback
);
//xxx
function
resolver
(
resolve
,
reject
)
{
function
tmp
()
{
callback_promise
=
new
RSVP
.
Queue
()
.
push
(
function
()
{
callback
();
animationId
=
window
.
requestAnimationFrame
(
tmp
);
})
.
push
(
undefined
,
function
(
error
)
{
canceller
();
reject
(
error
);
});
}
animationId
=
window
.
requestAnimationFrame
(
tmp
);
}
return
new
RSVP
.
Promise
(
resolver
,
canceller
);
}
...
...
@@ -122,9 +138,6 @@
gradient
.
addColorStop
(
0
,
'
#f00
'
);
that
.
audio
.
play
();
drawFrame
=
function
()
{
if
(
that
.
audio
.
duration
!==
0
)
{
bar_context
.
max
=
that
.
audio
.
duration
;
}
array
=
getFFTValue
(
that
);
canvasCtx
.
clearRect
(
0
,
0
,
cwidth
,
cheight
);
step
=
Math
.
round
(
array
.
length
/
meterNum
);
...
...
@@ -139,7 +152,6 @@
meterWidth
,
cheight
);
//the meter
}
return
promiseRequestAnimation
(
drawFrame
);
};
return
promiseRequestAnimation
(
drawFrame
);
}
...
...
@@ -161,13 +173,11 @@
return
g
.
plGive
(
"
type
"
);
})
.
push
(
function
(
value
)
{
g
.
filter
.
type
=
value
;
g
.
filter
.
type
=
value
||
0
;
return
g
.
plGive
(
"
value
"
);
})
.
push
(
function
(
value
)
{
if
(
value
===
0
)
{
value
=
5000
;
}
value
=
value
||
5000
;
g
.
filter
.
frequency
.
value
=
value
;
})
.
push
(
function
()
{
...
...
@@ -222,6 +232,7 @@
return
promiseEventListener
(
g
.
audio
,
"
loadedmetadata
"
,
false
);
})
.
push
(
function
()
{
bar_context
.
max
=
g
.
audio
.
duration
;
return
g
.
plEnablePage
();
})
.
push
(
function
()
{
...
...
src/audioplayer_upload/upload.js
View file @
587b48f2
...
...
@@ -10,6 +10,7 @@
.
declareAcquiredMethod
(
"
displayThisTitle
"
,
"
displayThisTitle
"
)
.
declareAcquiredMethod
(
"
plEnablePage
"
,
"
plEnablePage
"
)
.
declareAcquiredMethod
(
"
plDisablePage
"
,
"
plDisablePage
"
)
.
declareAcquiredMethod
(
"
invalideJioSave
"
,
"
invalideJioSave
"
)
.
declareMethod
(
"
render
"
,
function
()
{
return
this
.
displayThisTitle
(
"
upload
"
);
})
...
...
@@ -66,6 +67,9 @@
.
push
(
function
()
{
return
g
.
plDisablePage
();
})
.
push
(
function
()
{
return
g
.
invalideJioSave
();
})
.
push
(
function
()
{
length
=
input_context
.
files
.
length
;
for
(
i
=
0
;
i
<
length
;
i
+=
1
)
{
...
...
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