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
75d7758a
Commit
75d7758a
authored
Aug 20, 2014
by
Thibaut Frain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xmpp server is now an url parameter
parent
05e29c21
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
26 deletions
+45
-26
dev/jabberclient/jabberclient.js
dev/jabberclient/jabberclient.js
+10
-7
dev/jabberclient_connection/index.html
dev/jabberclient_connection/index.html
+2
-4
dev/jabberclient_connection/jabberclient_connection.js
dev/jabberclient_connection/jabberclient_connection.js
+8
-4
src/jabberclient/jabberclient.js
src/jabberclient/jabberclient.js
+11
-4
src/jabberclient_connection/index.html
src/jabberclient_connection/index.html
+2
-4
src/jabberclient_connection/jabberclient_connection.js
src/jabberclient_connection/jabberclient_connection.js
+12
-3
No files found.
dev/jabberclient/jabberclient.js
View file @
75d7758a
...
...
@@ -90,10 +90,14 @@
return
this
.
getDeclaredGadget
(
"
contactlist
"
).
push
(
function
(
contactlist_gadget
)
{
return
contactlist_gadget
.
messagesAreRead
(
jid
[
0
]);
});
}).
allowPublicAcquisition
(
"
renderConnection
"
,
function
()
{
return
this
.
aq_pleasePublishMyState
(
{
}).
allowPublicAcquisition
(
"
renderConnection
"
,
function
(
options
)
{
var
new_options
=
{
page
:
"
connection
"
}).
push
(
this
.
pleaseRedirectMyHash
.
bind
(
this
));
};
if
(
options
[
0
].
server
!==
undefined
)
{
new_options
.
server
=
options
[
0
].
server
;
}
return
this
.
aq_pleasePublishMyState
(
new_options
).
push
(
this
.
pleaseRedirectMyHash
.
bind
(
this
));
}).
ready
(
function
(
g
)
{
g
.
props
=
{};
$
(
"
[data-role='header']
"
).
toolbar
();
...
...
@@ -124,14 +128,13 @@
}).
push
(
function
(
is_connected
)
{
// default page
if
(
options
.
page
===
undefined
)
{
return
gadget
.
aq_pleasePublishMyState
({
page
:
"
contactlist
"
}).
push
(
gadget
.
pleaseRedirectMyHash
.
bind
(
gadget
));
options
.
page
=
"
contactlist
"
;
return
gadget
.
aq_pleasePublishMyState
(
options
).
push
(
gadget
.
pleaseRedirectMyHash
.
bind
(
gadget
));
}
if
(
!
is_connected
&&
options
.
page
!==
"
connection
"
)
{
gadget
.
props
.
came_from
=
options
;
return
gadget
.
getDeclaredGadget
(
"
connection
"
).
push
(
function
(
connection_gadget
)
{
return
connection_gadget
.
tryAutoConnect
();
return
connection_gadget
.
tryAutoConnect
(
options
);
});
}
return
gadget
.
getDeclaredGadget
(
options
.
page
).
push
(
function
(
g
)
{
...
...
dev/jabberclient_connection/index.html
View file @
75d7758a
...
...
@@ -17,11 +17,9 @@
<script
class=
"login-template"
type=
"text/x-handlebars-template"
>
<
div
class
=
"
login-box ui-corner-all ui-shadow
"
>
<
h3
>
Status
:
Not
connected
<
/h3><br/
>
<
h3
>
Status
:
Not
connected
<
/h3
>
<
h5
>
XMPP
Server
:
&
nbsp
{{
server
}}
<
/h5
>
<
form
class
=
"
login-form
"
data
-
ajax
=
"
false
"
>
<
div
class
=
"
ui-field-contain
"
>
<
input
type
=
"
url
"
name
=
"
server
"
placeholder
=
"
Jabber server url
"
value
=
"
{{server}}
"
required
>
<
/div
>
<
div
class
=
"
ui-field-contain
"
>
<
input
type
=
"
text
"
name
=
"
jid
"
placeholder
=
"
Jabber ID
"
value
=
"
{{jid}}
"
required
>
<
/div
>
...
...
dev/jabberclient_connection/jabberclient_connection.js
View file @
75d7758a
...
...
@@ -99,7 +99,7 @@
}
function
showLogin
(
gadget
,
options
)
{
var
params
=
{
server
:
"
https://mail.tiolive.com/chat/http-bind/
"
server
:
options
.
server
};
return
new
RSVP
.
Queue
().
push
(
function
()
{
if
(
options
&&
options
.
authfail
)
{
...
...
@@ -126,16 +126,20 @@
return
this
.
props
.
connection
.
send
(
parseXML
(
xmlString
));
}).
declareMethod
(
"
logout
"
,
function
()
{
logout
(
this
);
}).
declareAcquiredMethod
(
"
renderConnection
"
,
"
renderConnection
"
).
declareMethod
(
"
tryAutoConnect
"
,
function
()
{
}).
declareAcquiredMethod
(
"
renderConnection
"
,
"
renderConnection
"
).
declareMethod
(
"
tryAutoConnect
"
,
function
(
options
)
{
var
params
=
JSON
.
parse
(
sessionStorage
.
getItem
(
"
connection_params
"
));
if
(
params
!==
null
&&
typeof
params
===
"
object
"
&&
Object
.
keys
(
params
).
length
===
3
)
{
this
.
manageService
(
connectionListener
(
this
,
params
));
}
else
{
return
this
.
renderConnection
();
return
this
.
renderConnection
(
options
);
}
}).
ready
(
function
(
g
)
{
g
.
props
=
{};
}).
declareMethod
(
"
render
"
,
function
(
options
)
{
}).
declareAcquiredMethod
(
"
pleaseRedirectMyHash
"
,
"
pleaseRedirectMyHash
"
).
declareAcquiredMethod
(
"
getHash
"
,
"
getHash
"
).
declareMethod
(
"
render
"
,
function
(
options
)
{
if
(
options
.
server
===
undefined
)
{
options
.
server
=
"
https://mail.tiolive.com/chat/http-bind/
"
;
return
this
.
getHash
(
options
).
push
(
this
.
pleaseRedirectMyHash
.
bind
(
this
));
}
if
(
this
.
props
.
connection
&&
this
.
props
.
connection
.
authenticated
)
{
return
showLogout
(
this
);
}
...
...
src/jabberclient/jabberclient.js
View file @
75d7758a
...
...
@@ -135,8 +135,14 @@
});
})
.
allowPublicAcquisition
(
'
renderConnection
'
,
function
()
{
return
this
.
aq_pleasePublishMyState
({
page
:
"
connection
"
})
.
allowPublicAcquisition
(
'
renderConnection
'
,
function
(
options
)
{
var
new_options
=
{
page
:
"
connection
"
};
if
(
options
[
0
].
server
!==
undefined
)
{
new_options
.
server
=
options
[
0
].
server
;
}
return
this
.
aq_pleasePublishMyState
(
new_options
)
.
push
(
this
.
pleaseRedirectMyHash
.
bind
(
this
));
})
...
...
@@ -183,7 +189,8 @@
.
push
(
function
(
is_connected
)
{
// default page
if
(
options
.
page
===
undefined
)
{
return
gadget
.
aq_pleasePublishMyState
({
page
:
"
contactlist
"
})
options
.
page
=
"
contactlist
"
;
return
gadget
.
aq_pleasePublishMyState
(
options
)
.
push
(
gadget
.
pleaseRedirectMyHash
.
bind
(
gadget
));
}
...
...
@@ -191,7 +198,7 @@
gadget
.
props
.
came_from
=
options
;
return
gadget
.
getDeclaredGadget
(
"
connection
"
)
.
push
(
function
(
connection_gadget
)
{
return
connection_gadget
.
tryAutoConnect
();
return
connection_gadget
.
tryAutoConnect
(
options
);
});
}
return
gadget
.
getDeclaredGadget
(
options
.
page
)
...
...
src/jabberclient_connection/index.html
View file @
75d7758a
...
...
@@ -17,11 +17,9 @@
<script
class=
"login-template"
type=
"text/x-handlebars-template"
>
<
div
class
=
"
login-box ui-corner-all ui-shadow
"
>
<
h3
>
Status
:
Not
connected
<
/h3><br/
>
<
h3
>
Status
:
Not
connected
<
/h3
>
<
h5
>
XMPP
Server
:
&
nbsp
{{
server
}}
<
/h5
>
<
form
class
=
"
login-form
"
data
-
ajax
=
"
false
"
>
<
div
class
=
"
ui-field-contain
"
>
<
input
type
=
"
url
"
name
=
"
server
"
placeholder
=
"
Jabber server url
"
value
=
"
{{server}}
"
required
>
<
/div
>
<
div
class
=
"
ui-field-contain
"
>
<
input
type
=
"
text
"
name
=
"
jid
"
placeholder
=
"
Jabber ID
"
value
=
"
{{jid}}
"
required
>
<
/div
>
...
...
src/jabberclient_connection/jabberclient_connection.js
View file @
75d7758a
...
...
@@ -139,7 +139,7 @@
function
showLogin
(
gadget
,
options
)
{
var
params
=
{
server
:
"
https://mail.tiolive.com/chat/http-bind/
"
server
:
options
.
server
};
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
...
...
@@ -193,14 +193,14 @@
.
declareAcquiredMethod
(
"
renderConnection
"
,
"
renderConnection
"
)
.
declareMethod
(
"
tryAutoConnect
"
,
function
()
{
.
declareMethod
(
"
tryAutoConnect
"
,
function
(
options
)
{
var
params
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'
connection_params
'
));
if
(
params
!==
null
&&
typeof
params
===
'
object
'
&&
Object
.
keys
(
params
).
length
===
3
)
{
this
.
manageService
(
connectionListener
(
this
,
params
));
}
else
{
return
this
.
renderConnection
();
return
this
.
renderConnection
(
options
);
}
})
...
...
@@ -208,7 +208,16 @@
g
.
props
=
{};
})
.
declareAcquiredMethod
(
'
pleaseRedirectMyHash
'
,
'
pleaseRedirectMyHash
'
)
.
declareAcquiredMethod
(
'
getHash
'
,
'
getHash
'
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
if
(
options
.
server
===
undefined
)
{
options
.
server
=
"
https://mail.tiolive.com/chat/http-bind/
"
;
return
this
.
getHash
(
options
)
.
push
(
this
.
pleaseRedirectMyHash
.
bind
(
this
));
}
if
(
this
.
props
.
connection
&&
this
.
props
.
connection
.
authenticated
)
{
return
showLogout
(
this
);
...
...
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