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
1d25262f
Commit
1d25262f
authored
May 22, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add show message gadget
parent
dd7729ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
src/audioplayer_log_message/index.html
src/audioplayer_log_message/index.html
+20
-0
src/audioplayer_log_message/log.js
src/audioplayer_log_message/log.js
+46
-0
No files found.
src/audioplayer_log_message/index.html
0 → 100644
View file @
1d25262f
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
show message
</title>
<!-- renderjs -->
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<!-- custom script -->
<script
src=
"./log.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
id =
"log"
>
</div>
</body>
</html>
src/audioplayer_log_message/log.js
0 → 100644
View file @
1d25262f
/*global window, rJS, RSVP, console, document, JSON */
/*jslint maxlen:80, nomen: true */
(
function
(
window
,
rJS
)
{
"
use strict
"
;
var
gk
=
rJS
(
window
),
logColor
=
0
,
arrayColor
=
[
"
white
"
,
"
cyan
"
];
function
logGetColor
()
{
logColor
=
(
logColor
+
1
)
%
arrayColor
.
length
;
return
arrayColor
[
logColor
];
}
gk
.
declareMethod
(
'
showMessage
'
,
function
(
msg
)
{
var
node
=
document
.
createElement
(
"
pre
"
);
node
.
setAttribute
(
"
style
"
,
"
background-color:
"
+
logGetColor
()
+
"
;margin:0;padding:0;
"
);
if
(
typeof
msg
===
"
string
"
)
{
node
.
textContent
+=
msg
;
}
else
{
node
.
textContent
+=
JSON
.
stringify
(
msg
,
null
,
"
"
);
}
this
.
log
.
appendChild
(
node
);
})
.
declareMethod
(
'
clear
'
,
function
()
{
this
.
log
.
innerHTML
=
""
;
});
gk
.
ready
(
function
(
g
)
{
g
.
log
=
g
.
__element
.
getElementsByTagName
(
'
div
'
)[
0
];
var
node
=
document
.
createElement
(
"
pre
"
);
node
.
setAttribute
(
"
style
"
,
"
background-color:
"
+
logGetColor
()
+
"
;margin:0;padding:0;
"
);
node
.
textContent
=
"
use for show message
"
;
g
.
log
.
appendChild
(
node
);
});
}(
window
,
rJS
));
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