Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
92305692
Commit
92305692
authored
Nov 23, 2014
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show hardcoded urls. Some css width tweaks. updates #117
parent
3dbcdd61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
26 deletions
+39
-26
converse.js
converse.js
+25
-19
css/converse.css
css/converse.css
+3
-3
less/converse.less
less/converse.less
+3
-3
src/templates/form_input.html
src/templates/form_input.html
+8
-1
No files found.
converse.js
View file @
92305692
...
...
@@ -1942,15 +1942,6 @@
b64_sha1
(
'
converse.roster.groups
'
+
converse
.
bare_jid
));
converse
.
rosterview
=
new
converse
.
RosterView
({
model
:
rostergroups
});
this
.
contactspanel
.
$el
.
append
(
converse
.
rosterview
.
$el
);
// TODO:
// See if we shouldn't also fetch the roster here... otherwise
// the roster is always populated by the rosterHandler method,
// which appears to be a less economic way.
// i.e. from what it seems, only groups are fetched from
// browserStorage, and no contacts.
// XXX: Make sure that if fetch is called, we don't sort on
// each item add...
// converse.roster.fetch()
converse
.
rosterview
.
render
().
fetch
().
update
();
return
this
;
},
...
...
@@ -4562,6 +4553,7 @@
reset
:
function
(
settings
)
{
var
defaults
=
{
fields
:
{},
urls
:
[],
title
:
""
,
instructions
:
""
,
registered
:
false
,
...
...
@@ -4683,19 +4675,29 @@
$form
.
append
(
utils
.
xForm2webForm
(
field
));
});
}
else
{
// Show fields
_
.
each
(
Object
.
keys
(
this
.
fields
),
$
.
proxy
(
function
(
key
)
{
// TODO:
$form
.
append
(
'
<input placeholder="
'
+
key
+
'
" name="
'
+
key
+
'
"></input>
'
);
console
.
log
(
'
need to add form input here...
'
);
$form
.
append
(
'
<label>
'
+
key
+
'
</label>
'
);
var
$input
=
$
(
'
<input placeholder="
'
+
key
+
'
" name="
'
+
key
+
'
"></input>
'
);
if
(
key
===
'
password
'
||
key
===
'
email
'
)
{
$input
.
attr
(
'
type
'
,
key
);
}
$form
.
append
(
$input
);
},
this
));
// Show urls
_
.
each
(
this
.
urls
,
$
.
proxy
(
function
(
url
)
{
$form
.
append
(
$
(
'
<a target="blank"></a>
'
).
attr
(
'
href
'
,
url
).
text
(
url
));
},
this
));
}
if
(
this
.
fields
.
length
)
{
if
(
this
.
fields
)
{
$form
.
append
(
'
<input type="submit" class="submit" value="
'
+
__
(
'
Register
'
)
+
'
"/>
'
);
$form
.
on
(
'
submit
'
,
$
.
proxy
(
this
.
submitRegistrationForm
,
this
));
$form
.
append
(
'
<input type="button" class="submit" value="
'
+
__
(
'
Cancel
'
)
+
'
"/>
'
);
$form
.
find
(
'
input[type=button]
'
).
on
(
'
click
'
,
$
.
proxy
(
this
.
cancelRegistration
,
this
));
}
else
{
$form
.
append
(
'
<input type="button" class="submit" value="
'
+
__
(
'
Return
'
)
+
'
"/>
'
);
$form
.
find
(
'
input[type=button]
'
).
on
(
'
click
'
,
$
.
proxy
(
this
.
cancelRegistration
,
this
));
}
$form
.
append
(
'
<input type="button" class="submit" value="
'
+
__
(
'
Cancel
'
)
+
'
"/>
'
);
$form
.
find
(
'
input[type=button]
'
).
on
(
'
click
'
,
$
.
proxy
(
this
.
cancelRegistration
,
this
));
},
reportErrors
:
function
(
stanza
)
{
...
...
@@ -4756,7 +4758,7 @@
var
$inputs
=
$
(
ev
.
target
).
find
(
'
:input:not([type=button]):not([type=submit])
'
),
iq
=
$iq
({
type
:
"
set
"
})
.
c
(
"
query
"
,
{
xmlns
:
Strophe
.
NS
.
REGISTER
})
.
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
'
submit
'
});
// TODO: Add Strophe namespace
.
c
(
"
x
"
,
{
xmlns
:
Strophe
.
NS
.
XFORM
,
type
:
'
submit
'
});
$inputs
.
each
(
function
()
{
iq
.
cnode
(
utils
.
webForm2xForm
(
this
)).
up
();
...
...
@@ -4786,11 +4788,16 @@
_setFieldsFromLegacy
:
function
(
$query
)
{
$query
.
children
().
each
(
$
.
proxy
(
function
(
idx
,
field
)
{
var
$field
=
$
(
field
);
if
(
field
.
tagName
.
toLowerCase
()
===
'
instructions
'
)
{
this
.
instructions
=
Strophe
.
getText
(
field
);
return
;
}
else
if
(
field
.
tagName
.
toLowerCase
()
===
'
x
'
)
{
// TODO:
if
(
$field
.
attr
(
'
xmlns
'
)
===
'
jabber:x:oob
'
)
{
$field
.
find
(
'
url
'
).
each
(
$
.
proxy
(
function
(
idx
,
url
)
{
this
.
urls
.
push
(
$
(
url
).
text
());
},
this
));
}
return
;
}
this
.
fields
[
field
.
tagName
.
toLowerCase
()]
=
Strophe
.
getText
(
field
);
...
...
@@ -4849,7 +4856,6 @@
},
remove
:
function
()
{
// XXX ?
this
.
$tabs
.
empty
();
this
.
$el
.
parent
().
empty
();
}
...
...
css/converse.css
View file @
92305692
...
...
@@ -756,7 +756,7 @@
font-size
:
115%
;
}
#converse-register
.provider-score
{
width
:
1
87
px
;
width
:
1
78
px
;
margin-bottom
:
8px
;
}
#converse-register
.form-help
.url
{
...
...
@@ -1163,7 +1163,7 @@ dl.add-converse-contact {
#conversejs
form
#converse-register
.instructions
{
font-style
:
italic
;
color
:
gray
;
font-size
:
8
0
%
;
font-size
:
8
5
%
;
}
#conversejs
form
#converse-register
.form-errors
{
color
:
red
;
...
...
@@ -1176,7 +1176,7 @@ dl.add-converse-contact {
}
#conversejs
form
#converse-register
input
,
#conversejs
form
#converse-login
input
{
width
:
1
87
px
;
width
:
1
78
px
;
height
:
30px
;
}
#conversejs
form
#converse-register
label
,
...
...
less/converse.less
View file @
92305692
...
...
@@ -835,7 +835,7 @@
}
#converse-register .provider-score {
width: 1
87
px;
width: 1
78
px;
margin-bottom: 8px;
}
...
...
@@ -1314,7 +1314,7 @@ dl.add-converse-contact {
#conversejs form#converse-register .instructions {
font-style: italic;
color: gray;
font-size: 8
0
%;
font-size: 8
5
%;
}
#conversejs form#converse-register .form-errors {
...
...
@@ -1330,7 +1330,7 @@ dl.add-converse-contact {
#conversejs form#converse-register input,
#conversejs form#converse-login input {
width: 1
87
px;
width: 1
78
px;
height: 30px;
}
...
...
src/templates/form_input.html
View file @
92305692
<label>
{{label}}
<input
name=
"{{name}}"
type=
"{{type}}"
value=
"{{value}}"
></label>
{[ if (label) { ]}
<label>
{{label}}
{[ } ]}
<input
name=
"{{name}}"
type=
"{{type}}"
value=
"{{value}}"
>
{[ if (label) { ]}
</label>
{[ } ]}
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