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
add3b8ef
Commit
add3b8ef
authored
Aug 15, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils now no longer depends on jquery.
parent
6c3aa34c
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
221 additions
and
177 deletions
+221
-177
spec/controlbox.js
spec/controlbox.js
+11
-0
src/converse-muc.js
src/converse-muc.js
+7
-6
src/converse-register.js
src/converse-register.js
+1
-1
src/templates/field.html
src/templates/field.html
+2
-1
src/utils.js
src/utils.js
+193
-162
tests/mock.js
tests/mock.js
+7
-7
No files found.
spec/controlbox.js
View file @
add3b8ef
...
@@ -137,6 +137,17 @@
...
@@ -137,6 +137,17 @@
});
});
_converse
.
rosterview
.
update
();
// XXX: Will normally called as event handler
_converse
.
rosterview
.
update
();
// XXX: Will normally called as event handler
}
}
$
.
fn
.
hasScrollBar
=
function
()
{
if
(
!
$
.
contains
(
document
,
this
.
get
(
0
)))
{
return
false
;
}
if
(
this
.
parent
().
height
()
<
this
.
get
(
0
).
scrollHeight
)
{
return
true
;
}
return
false
;
};
return
test_utils
.
waitUntil
(
function
()
{
return
test_utils
.
waitUntil
(
function
()
{
if
(
_converse
.
rosterview
.
$roster
.
hasScrollBar
())
{
if
(
_converse
.
rosterview
.
$roster
.
hasScrollBar
())
{
return
$filter
.
is
(
'
:visible
'
);
return
$filter
.
is
(
'
:visible
'
);
...
...
src/converse-muc.js
View file @
add3b8ef
...
@@ -191,11 +191,12 @@
...
@@ -191,11 +191,12 @@
_converse
.
api
.
listen
.
on
(
'
serviceDiscovered
'
,
this
.
featureAdded
,
this
);
_converse
.
api
.
listen
.
on
(
'
serviceDiscovered
'
,
this
.
featureAdded
,
this
);
// Features could have been added before the controlbox was
// Features could have been added before the controlbox was
// initialized. We're only interested in MUC
// initialized. We're only interested in MUC
const
feature
=
_converse
.
disco_entities
[
_converse
.
domain
].
features
.
findWhere
({
const
entity
=
_converse
.
disco_entities
[
_converse
.
domain
];
'
var
'
:
Strophe
.
NS
.
MUC
if
(
!
_
.
isUndefined
(
entity
))
{
});
const
feature
=
entity
.
features
.
findWhere
({
'
var
'
:
Strophe
.
NS
.
MUC
});
if
(
feature
)
{
if
(
feature
)
{
this
.
featureAdded
(
feature
);
this
.
featureAdded
(
feature
);
}
}
}
});
});
},
},
...
@@ -1283,7 +1284,7 @@
...
@@ -1283,7 +1284,7 @@
$fieldset
.
append
(
$
(
'
<p class="instructions">
'
).
text
(
instructions
));
$fieldset
.
append
(
$
(
'
<p class="instructions">
'
).
text
(
instructions
));
}
}
_
.
each
(
$fields
,
function
(
field
)
{
_
.
each
(
$fields
,
function
(
field
)
{
$fieldset
.
append
(
utils
.
xForm2webForm
(
$
(
field
),
$
stanza
));
$fieldset
.
append
(
utils
.
xForm2webForm
(
field
,
stanza
));
});
});
$form
.
append
(
'
<fieldset></fieldset>
'
);
$form
.
append
(
'
<fieldset></fieldset>
'
);
$fieldset
=
$form
.
children
(
'
fieldset:last
'
);
$fieldset
=
$form
.
children
(
'
fieldset:last
'
);
...
...
src/converse-register.js
View file @
add3b8ef
...
@@ -356,7 +356,7 @@
...
@@ -356,7 +356,7 @@
if
(
this
.
form_type
===
'
xform
'
)
{
if
(
this
.
form_type
===
'
xform
'
)
{
$fields
=
$stanza
.
find
(
'
field
'
);
$fields
=
$stanza
.
find
(
'
field
'
);
_
.
each
(
$fields
,
(
field
)
=>
{
_
.
each
(
$fields
,
(
field
)
=>
{
$form
.
append
(
utils
.
xForm2webForm
.
bind
(
this
,
$
(
field
),
$
stanza
));
$form
.
append
(
utils
.
xForm2webForm
.
bind
(
this
,
field
,
stanza
));
});
});
}
else
{
}
else
{
// Show fields
// Show fields
...
...
src/templates/field.html
View file @
add3b8ef
<field
var=
"{{{name}}}"
>
{[ if (_.isArray(value)) { ]}
<field
var=
"{{{name}}}"
>
{[ if (_.isArray(value)) { ]}
{[ _.each(value,function(arrayValue) { ]}
<value>
{{{arrayValue}}}
</value>
{[ }); ]}
{[ _.each(value,function(arrayValue) { ]}
<value>
{{{arrayValue}}}
</value>
{[ }); ]}
{[ } else { ]}
{[ } else { ]}
<value>
{{{value}}}
</value>
<value>
{{{value}}}
</value>
...
...
src/utils.js
View file @
add3b8ef
This diff is collapsed.
Click to expand it.
tests/mock.js
View file @
add3b8ef
(
function
(
root
,
factory
)
{
(
function
(
root
,
factory
)
{
define
(
"
mock
"
,
[
'
jquery.noconflict
'
,
'
converse
'
],
factory
);
define
(
"
mock
"
,
[
'
jquery.noconflict
'
,
'
converse
'
],
factory
);
}(
this
,
function
(
$
,
converse
_api
)
{
}(
this
,
function
(
$
,
converse
)
{
var
_
=
converse
_api
.
env
.
_
;
var
_
=
converse
.
env
.
_
;
var
Promise
=
converse
_api
.
env
.
Promise
;
var
Promise
=
converse
.
env
.
Promise
;
var
Strophe
=
converse
_api
.
env
.
Strophe
;
var
Strophe
=
converse
.
env
.
Strophe
;
var
$iq
=
converse
_api
.
env
.
$iq
;
var
$iq
=
converse
.
env
.
$iq
;
var
mock
=
{};
var
mock
=
{};
// Names from http://www.fakenamegenerator.com/
// Names from http://www.fakenamegenerator.com/
mock
.
req_names
=
[
mock
.
req_names
=
[
...
@@ -99,7 +99,7 @@
...
@@ -99,7 +99,7 @@
});
});
}
}
var
_converse
=
converse
_api
.
initialize
(
_
.
extend
({
var
_converse
=
converse
.
initialize
(
_
.
extend
({
'
i18n
'
:
'
en
'
,
'
i18n
'
:
'
en
'
,
'
auto_subscribe
'
:
false
,
'
auto_subscribe
'
:
false
,
'
play_sounds
'
:
false
,
'
play_sounds
'
:
false
,
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
'
debug
'
:
false
'
debug
'
:
false
},
settings
||
{}));
},
settings
||
{}));
_converse
.
ChatBoxViews
.
prototype
.
trimChat
=
function
()
{};
_converse
.
ChatBoxViews
.
prototype
.
trimChat
=
function
()
{};
_converse
.
disable_effects
=
true
;
window
.
converse_
disable_effects
=
true
;
$
.
fx
.
off
=
true
;
$
.
fx
.
off
=
true
;
return
_converse
;
return
_converse
;
}
}
...
...
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