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
438a3530
Commit
438a3530
authored
Aug 20, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding basic jio history for chatbox gadget
parent
fb60f5d5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
7 deletions
+34
-7
dev/jabberclient_chatbox/jabberclient_chatbox.js
dev/jabberclient_chatbox/jabberclient_chatbox.js
+14
-4
src/jabberclient_chatbox/jabberclient_chatbox.js
src/jabberclient_chatbox/jabberclient_chatbox.js
+20
-3
No files found.
dev/jabberclient_chatbox/jabberclient_chatbox.js
View file @
438a3530
...
@@ -48,10 +48,16 @@
...
@@ -48,10 +48,16 @@
}).
c
(
"
body
"
).
t
(
content
).
toString
());
}).
c
(
"
body
"
).
t
(
content
).
toString
());
}
}
}
}
gadget_klass
.
ready
(
function
(
g
)
{
gadget_klass
.
declareAcquiredMethod
(
"
jio_put
"
,
"
jio_put
"
).
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
).
ready
(
function
(
g
)
{
return
g
.
jio_get
({
_id
:
"
chatbox_history
"
}).
push
(
function
(
response
)
{
return
JSON
.
parse
(
response
.
data
.
datas
);
}).
push
(
function
(
talks
)
{
g
.
props
=
{
g
.
props
=
{
talks
:
{}
talks
:
talks
};
};
});
}).
declareMethod
(
"
render
"
,
function
(
options
)
{
}).
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
messages
;
var
gadget
=
this
,
messages
;
this
.
props
.
jid
=
options
.
jid
;
this
.
props
.
jid
=
options
.
jid
;
...
@@ -86,6 +92,10 @@
...
@@ -86,6 +92,10 @@
this
.
props
.
talks
[
from
]
=
new
Talk
(
from
);
this
.
props
.
talks
[
from
]
=
new
Talk
(
from
);
}
}
this
.
props
.
talks
[
from
].
messages
.
push
(
message
);
this
.
props
.
talks
[
from
].
messages
.
push
(
message
);
this
.
jio_put
({
_id
:
"
chatbox_history
"
,
datas
:
JSON
.
stringify
(
this
.
props
.
talks
)
});
displayMessage
(
message
);
displayMessage
(
message
);
});
});
})(
$
,
rJS
,
Handlebars
);
})(
$
,
rJS
,
Handlebars
);
\ No newline at end of file
src/jabberclient_chatbox/jabberclient_chatbox.js
View file @
438a3530
...
@@ -68,10 +68,21 @@
...
@@ -68,10 +68,21 @@
}
}
gadget_klass
gadget_klass
.
declareAcquiredMethod
(
'
jio_put
'
,
'
jio_put
'
)
.
declareAcquiredMethod
(
'
jio_get
'
,
'
jio_get
'
)
.
ready
(
function
(
g
)
{
.
ready
(
function
(
g
)
{
return
g
.
jio_get
({
"
_id
"
:
"
chatbox_history
"
})
.
push
(
function
(
response
)
{
return
JSON
.
parse
(
response
.
data
.
datas
);
})
.
push
(
function
(
talks
)
{
g
.
props
=
{
g
.
props
=
{
talks
:
{}
talks
:
talks
};
};
});
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
...
@@ -125,6 +136,12 @@
...
@@ -125,6 +136,12 @@
this
.
props
.
talks
[
from
]
=
new
Talk
(
from
);
this
.
props
.
talks
[
from
]
=
new
Talk
(
from
);
}
}
this
.
props
.
talks
[
from
].
messages
.
push
(
message
);
this
.
props
.
talks
[
from
].
messages
.
push
(
message
);
this
.
jio_put
({
"
_id
"
:
"
chatbox_history
"
,
"
datas
"
:
JSON
.
stringify
(
this
.
props
.
talks
)
});
displayMessage
(
message
);
displayMessage
(
message
);
});
});
...
...
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