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
7985b92d
Commit
7985b92d
authored
Jan 03, 2018
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
95ac01b8
29b5c3e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
21 deletions
+39
-21
src/converse-chatview.js
src/converse-chatview.js
+13
-0
src/converse-dragresize.js
src/converse-dragresize.js
+25
-20
src/converse-muc.js
src/converse-muc.js
+1
-1
No files found.
src/converse-chatview.js
View file @
7985b92d
...
...
@@ -48,6 +48,19 @@
};
converse
.
plugins
.
add
(
'
converse-chatview
'
,
{
/* Optional dependencies are other plugins which might be
* overridden or relied upon, and therefore need to be loaded before
* this plugin. They are called "optional" because they might not be
* available, in which case any overrides applicable to them will be
* ignored.
*
* It's possible however to make optional dependencies non-optional.
* If the setting "strict_plugin_dependencies" is set to true,
* an error will be raised if the plugin is not found.
*
* NB: These plugins need to have already been loaded via require.js.
*/
optional_dependencies
:
[
"
converse-chatboxes
"
],
overrides
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
src/converse-dragresize.js
View file @
7985b92d
...
...
@@ -7,14 +7,13 @@
/*global define, window */
(
function
(
root
,
factory
)
{
define
([
"
jquery.noconflict
"
,
"
converse-core
"
,
define
([
"
converse-core
"
,
"
tpl!dragresize
"
,
"
converse-chatview
"
,
"
converse-muc
"
,
// XXX: would like to remove this
"
converse-controlbox
"
],
factory
);
}(
this
,
function
(
$
,
converse
,
tpl_dragresize
)
{
}(
this
,
function
(
converse
,
tpl_dragresize
)
{
"
use strict
"
;
const
{
_
}
=
converse
.
env
;
...
...
@@ -58,13 +57,13 @@
registerGlobalEventHandlers
()
{
const
that
=
this
;
$
(
document
).
on
(
'
mousemove
'
,
function
(
ev
)
{
document
.
addEventListener
(
'
mousemove
'
,
function
(
ev
)
{
if
(
!
that
.
resizing
||
!
that
.
allow_dragresize
)
{
return
true
;
}
ev
.
preventDefault
();
that
.
resizing
.
chatbox
.
resizeChatBox
(
ev
);
});
$
(
document
).
on
(
'
mouseup
'
,
function
(
ev
)
{
document
.
addEventListener
(
'
mouseup
'
,
function
(
ev
)
{
if
(
!
that
.
resizing
||
!
that
.
allow_dragresize
)
{
return
true
;
}
ev
.
preventDefault
();
const
height
=
that
.
applyDragResistance
(
...
...
@@ -110,7 +109,7 @@
},
initialize
()
{
$
(
window
).
on
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
window
.
addEventListener
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
this
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
},
...
...
@@ -125,7 +124,7 @@
// If a custom width is applied (due to drag-resizing),
// then we need to set the width of the .chatbox element as well.
if
(
this
.
model
.
get
(
'
width
'
))
{
this
.
$el
.
css
(
'
width
'
,
this
.
model
.
get
(
'
width
'
)
);
this
.
el
.
style
.
width
=
this
.
model
.
get
(
'
width
'
);
}
},
...
...
@@ -138,18 +137,20 @@
/* Determine and store the default box size.
* We need this information for the drag-resizing feature.
*/
const
{
_converse
}
=
this
.
__super__
;
const
$flyout
=
this
.
$el
.
find
(
'
.box-flyout
'
);
const
{
_converse
}
=
this
.
__super__
,
flyout
=
this
.
el
.
querySelector
(
'
.box-flyout
'
),
style
=
window
.
getComputedStyle
(
flyout
);
if
(
_
.
isUndefined
(
this
.
model
.
get
(
'
height
'
)))
{
const
height
=
$flyout
.
height
();
const
width
=
$flyout
.
width
(
);
const
height
=
parseInt
(
style
.
height
.
replace
(
/px$/
,
''
),
10
),
width
=
parseInt
(
style
.
width
.
replace
(
/px$/
,
''
),
10
);
this
.
model
.
set
(
'
height
'
,
height
);
this
.
model
.
set
(
'
default_height
'
,
height
);
this
.
model
.
set
(
'
width
'
,
width
);
this
.
model
.
set
(
'
default_width
'
,
width
);
}
const
min_width
=
$flyout
.
css
(
'
min-width
'
)
;
const
min_height
=
$flyout
.
css
(
'
min-height
'
)
;
const
min_width
=
style
[
'
min-width
'
]
;
const
min_height
=
style
[
'
min-height
'
]
;
this
.
model
.
set
(
'
min_width
'
,
min_width
.
endsWith
(
'
px
'
)
?
Number
(
min_width
.
replace
(
/px$/
,
''
))
:
0
);
this
.
model
.
set
(
'
min_height
'
,
min_height
.
endsWith
(
'
px
'
)
?
Number
(
min_height
.
replace
(
/px$/
,
''
))
:
0
);
// Initialize last known mouse position
...
...
@@ -176,7 +177,7 @@
}
else
{
height
=
""
;
}
this
.
$el
.
children
(
'
.box-flyout
'
)[
0
]
.
style
.
height
=
height
;
this
.
el
.
querySelector
(
'
.box-flyout
'
)
.
style
.
height
=
height
;
},
setChatBoxWidth
(
width
)
{
...
...
@@ -187,7 +188,7 @@
width
=
""
;
}
this
.
el
.
style
.
width
=
width
;
this
.
$el
.
children
(
'
.box-flyout
'
)[
0
]
.
style
.
width
=
width
;
this
.
el
.
querySelector
(
'
.box-flyout
'
)
.
style
.
width
=
width
;
},
...
...
@@ -211,7 +212,9 @@
const
{
_converse
}
=
this
.
__super__
;
if
(
!
_converse
.
allow_dragresize
)
{
return
true
;
}
// Record element attributes for mouseMove().
this
.
height
=
this
.
$el
.
children
(
'
.box-flyout
'
).
height
();
const
flyout
=
this
.
el
.
querySelector
(
'
.box-flyout
'
),
style
=
window
.
getComputedStyle
(
flyout
);
this
.
height
=
parseInt
(
style
.
height
.
replace
(
/px$/
,
''
),
10
);
_converse
.
resizing
=
{
'
chatbox
'
:
this
,
'
direction
'
:
'
top
'
...
...
@@ -222,7 +225,9 @@
onStartHorizontalResize
(
ev
)
{
const
{
_converse
}
=
this
.
__super__
;
if
(
!
_converse
.
allow_dragresize
)
{
return
true
;
}
this
.
width
=
this
.
$el
.
children
(
'
.box-flyout
'
).
width
();
const
flyout
=
this
.
el
.
querySelector
(
'
.box-flyout
'
),
style
=
window
.
getComputedStyle
(
flyout
);
this
.
width
=
parseInt
(
style
.
width
.
replace
(
/px$/
,
''
),
10
);
_converse
.
resizing
=
{
'
chatbox
'
:
this
,
'
direction
'
:
'
left
'
...
...
@@ -267,7 +272,7 @@
},
initialize
()
{
$
(
window
).
on
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
window
.
addEventListener
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
return
this
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
},
...
...
@@ -287,7 +292,7 @@
},
initialize
()
{
$
(
window
).
on
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
window
.
addEventListener
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
this
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
},
...
...
@@ -319,7 +324,7 @@
},
initialize
()
{
$
(
window
).
on
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
window
.
addEventListener
(
'
resize
'
,
_
.
debounce
(
this
.
setDimensions
.
bind
(
this
),
100
));
this
.
__super__
.
initialize
.
apply
(
this
,
arguments
);
},
...
...
src/converse-muc.js
View file @
7985b92d
...
...
@@ -129,7 +129,7 @@
*
* NB: These plugins need to have already been loaded via require.js.
*/
optional_dependencies
:
[
"
converse-controlbox
"
],
optional_dependencies
:
[
"
converse-controlbox
"
,
"
converse-chatview
"
],
overrides
:
{
// Overrides mentioned here will be picked up by converse.js's
...
...
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