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
aefceeff
Commit
aefceeff
authored
May 23, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added jabber login gadget
parent
70063366
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
1 deletion
+128
-1
Gruntfile.js
Gruntfile.js
+12
-1
src/jabber_login/index.html
src/jabber_login/index.html
+37
-0
src/jabber_login/jabber_login.css
src/jabber_login/jabber_login.css
+10
-0
src/jabber_login/jabber_login.js
src/jabber_login/jabber_login.js
+69
-0
No files found.
Gruntfile.js
View file @
aefceeff
...
...
@@ -98,7 +98,9 @@ module.exports = function (grunt) {
"
<%= global_config.dest %>/presentation_editor/presentation_editor.css
"
:
"
<%= global_config.src %>/presentation_editor/presentation_editor.css
"
,
"
<%= global_config.dest %>/presentation_viewer/presentation_viewer.css
"
:
"
<%= global_config.src %>/presentation_viewer/presentation_viewer.css
"
"
<%= global_config.src %>/presentation_viewer/presentation_viewer.css
"
,
"
<%= global_config.dest %>/jabber_login/jabber_login.css
"
:
"
<%= global_config.src %>/jabber_login/jabber_login.css
"
}
}
},
...
...
@@ -291,6 +293,11 @@ module.exports = function (grunt) {
src
:
'
https://svg-edit.googlecode.com/files/svg-edit-2.6.zip
'
,
relative_dest
:
'
lib/svg-edit-2.6
'
,
dest
:
'
<%= global_config.tmp %>/svgedit.zip
'
},
strophejs
:
{
src
:
'
https://raw.github.com/strophe/strophe.im/gh-pages/strophejs/downloads/strophejs-1.1.3.zip
'
,
relative_dest
:
'
lib/strophejs-1.1.3/strophe.min.js
'
,
dest
:
'
<%= global_config.tmp %>/strophejs.zip
'
}
// qunit: {
// all: ['test/index.html']
...
...
@@ -320,6 +327,10 @@ module.exports = function (grunt) {
svgedit
:
{
src
:
'
<%= global_config.tmp %>/svgedit.zip
'
,
dest
:
'
<%= global_config.dest %>/lib/
'
},
strophejs
:
{
src
:
'
<%= global_config.tmp %>/strophejs.zip
'
,
dest
:
'
<%= global_config.dest %>/lib/
'
}
},
...
...
src/jabber_login/index.html
0 → 100644
View file @
aefceeff
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title>
Jabber login gadget
</title>
<link
rel=
"stylesheet"
href=
"../<%= curl.jquerymobilecss.relative_dest %>"
>
<link
rel=
"stylesheet"
href=
"jabber_login.css"
>
<script
src=
"../<%= curl.jquery.relative_dest %>"
></script>
<script
src=
"../<%= curl.jquerymobilejs.relative_dest %>"
></script>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
></script>
<script
src=
"../<%= curl.strophejs.relative_dest %>"
></script>
<script
src=
"jabber_login.js"
></script>
</head>
<body>
<div
class=
"login-box ui-corner-all ui-shadow"
>
<h3
class=
"title"
>
Log in to your jabber account:
&
nbsp
</h3><br/>
<form
class=
"login-form"
data-ajax=
"false"
>
<div
class=
"ui-field-contain"
>
<input
type=
"url"
name=
"server"
placeholder=
"Jabber server url"
value=
"https://mail.tiolive.com/chat/http-bind/"
required
>
</div>
<div
class=
"ui-field-contain"
>
<input
type=
"text"
name=
"jid"
placeholder=
"Jabber ID"
required
>
</div>
<div
class=
"ui-field-contain"
>
<input
type=
"password"
name=
"passwd"
placeholder=
"Password"
required
>
</div>
<fieldset
class=
"ui-btn-inline"
>
<input
type=
"submit"
value=
"Log In"
>
</fieldset>
</form>
</div>
</body>
</html>
src/jabber_login/jabber_login.css
0 → 100644
View file @
aefceeff
.login-box
{
margin
:
0
auto
;
max-width
:
35ch
!important
;
text-align
:
center
;
padding
:
1%
;
}
.login-box
form
{
margin
:
1%
;
}
\ No newline at end of file
src/jabber_login/jabber_login.js
0 → 100644
View file @
aefceeff
/*global window, rJS, Strophe, $, $iq, XMLSerializer, DOMParser*/
(
function
(
$
,
Strophe
,
rJS
)
{
"
use strict
"
;
var
serializeXML
=
function
(
xml
)
{
return
(
new
XMLSerializer
()).
serializeToString
(
xml
);
},
parseXML
=
function
(
xmlString
)
{
return
new
DOMParser
()
.
parseFromString
(
xmlString
,
'
text/xml
'
)
.
children
[
0
];
};
rJS
(
window
)
.
declareAcquiredMethod
(
'
connected
'
,
'
connected
'
)
.
declareAcquiredMethod
(
'
disconnected
'
,
'
disconnected
'
)
.
declareAcquiredMethod
(
'
receive
'
,
'
receive
'
)
.
declareMethod
(
'
getJID
'
,
function
()
{
return
Strophe
.
getBareJidFromJid
(
this
.
connection
.
jid
);
})
.
declareMethod
(
'
send
'
,
function
(
xmlString
)
{
return
this
.
connection
.
send
(
parseXML
(
xmlString
));
})
.
declareMethod
(
'
disconnect
'
,
function
()
{
if
(
this
.
connection
)
{
return
this
.
connection
.
disconnect
();
}
})
.
ready
(
function
(
g
)
{
function
initInputs
()
{
g
.
connection
.
xmlInput
=
function
(
body
)
{
[].
forEach
.
call
(
body
.
children
,
function
(
child
)
{
g
.
receive
(
serializeXML
(
child
));
});
};
}
function
initConnection
(
params
)
{
g
.
connection
=
new
Strophe
.
Connection
(
params
.
server
);
g
.
connection
.
connect
(
params
.
jid
,
params
.
passwd
,
function
(
status
)
{
if
(
status
===
Strophe
.
Status
.
CONNECTED
)
{
initInputs
();
g
.
connected
();
}
else
if
(
status
===
Strophe
.
Status
.
DISCONNECTED
)
{
g
.
disconnected
();
}
});
window
.
connection
=
g
.
connection
;
// for debug purpose
}
$
(
document
).
on
(
'
submit
'
,
'
form.login-form
'
,
function
(
e
)
{
var
params
=
{};
$
(
this
).
serializeArray
().
forEach
(
function
(
elem
)
{
params
[
elem
.
name
]
=
elem
.
value
;
});
initConnection
(
params
);
return
false
;
});
});
}(
$
,
Strophe
,
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