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
6c3aa34c
Commit
6c3aa34c
authored
Aug 14, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some work on removing jquery from converse-bookmarks
parent
1c80fa41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
12 deletions
+29
-12
spec/bookmarks.js
spec/bookmarks.js
+2
-1
src/converse-bookmarks.js
src/converse-bookmarks.js
+26
-10
src/converse-inverse.js
src/converse-inverse.js
+1
-1
No files found.
spec/bookmarks.js
View file @
6c3aa34c
...
@@ -81,7 +81,8 @@
...
@@ -81,7 +81,8 @@
$form
.
find
(
'
input[name="name"]
'
).
val
(
'
Play's the Thing
'
);
$form
.
find
(
'
input[name="name"]
'
).
val
(
'
Play's the Thing
'
);
$form
.
find
(
'
input[name="autojoin"]
'
).
prop
(
'
checked
'
,
true
);
$form
.
find
(
'
input[name="autojoin"]
'
).
prop
(
'
checked
'
,
true
);
$form
.
find
(
'
input[name="nick"]
'
).
val
(
'
JC
'
);
$form
.
find
(
'
input[name="nick"]
'
).
val
(
'
JC
'
);
$form
.
submit
();
view
.
$el
.
find
(
'
.button-primary
'
).
click
();
expect
(
view
.
model
.
get
(
'
bookmarked
'
)).
toBeTruthy
();
expect
(
view
.
model
.
get
(
'
bookmarked
'
)).
toBeTruthy
();
expect
(
$bookmark
.
hasClass
(
'
on-button
'
),
true
);
expect
(
$bookmark
.
hasClass
(
'
on-button
'
),
true
);
...
...
src/converse-bookmarks.js
View file @
6c3aa34c
...
@@ -101,10 +101,11 @@
...
@@ -101,10 +101,11 @@
},
},
onBookmarked
()
{
onBookmarked
()
{
const
icon
=
this
.
el
.
querySelector
(
'
.icon-pushpin
'
);
if
(
this
.
model
.
get
(
'
bookmarked
'
))
{
if
(
this
.
model
.
get
(
'
bookmarked
'
))
{
this
.
$
(
'
.icon-pushpin
'
).
addClass
(
'
button-on
'
);
icon
.
classList
.
add
(
'
button-on
'
);
}
else
{
}
else
{
this
.
$
(
'
.icon-pushpin
'
).
removeClass
(
'
button-on
'
);
icon
.
classList
.
remove
(
'
button-on
'
);
}
}
},
},
...
@@ -125,11 +126,18 @@
...
@@ -125,11 +126,18 @@
renderBookmarkForm
()
{
renderBookmarkForm
()
{
const
{
_converse
}
=
this
.
__super__
,
const
{
_converse
}
=
this
.
__super__
,
{
__
}
=
_converse
,
{
__
}
=
_converse
,
$body
=
this
.
$
(
'
.chatroom-body
'
);
body
=
this
.
el
.
querySelector
(
'
.chatroom-body
'
);
$body
.
children
().
addClass
(
'
hidden
'
);
_
.
each
(
body
.
children
,
function
(
child
)
{
child
.
classList
.
add
(
'
hidden
'
);
});
// Remove any existing forms
// Remove any existing forms
$body
.
find
(
'
form.chatroom-form
'
).
remove
();
let
form
=
body
.
querySelector
(
'
form.chatroom-form
'
);
$body
.
append
(
if
(
!
_
.
isNull
(
form
))
{
form
.
parentNode
.
removeChild
(
form
);
}
body
.
insertAdjacentHTML
(
'
beforeend
'
,
tpl_chatroom_bookmark_form
({
tpl_chatroom_bookmark_form
({
heading
:
__
(
'
Bookmark this room
'
),
heading
:
__
(
'
Bookmark this room
'
),
label_name
:
__
(
'
The name for this bookmark:
'
),
label_name
:
__
(
'
The name for this bookmark:
'
),
...
@@ -138,9 +146,17 @@
...
@@ -138,9 +146,17 @@
default_nick
:
this
.
model
.
get
(
'
nick
'
),
default_nick
:
this
.
model
.
get
(
'
nick
'
),
label_submit
:
__
(
'
Save
'
),
label_submit
:
__
(
'
Save
'
),
label_cancel
:
__
(
'
Cancel
'
)
label_cancel
:
__
(
'
Cancel
'
)
}));
})
this
.
$
(
'
.chatroom-form
'
).
submit
(
this
.
onBookmarkFormSubmitted
.
bind
(
this
));
);
this
.
$
(
'
.chatroom-form .button-cancel
'
).
on
(
'
click
'
,
this
.
cancelConfiguration
.
bind
(
this
));
form
=
body
.
querySelector
(
'
form.chatroom-form
'
);
form
.
addEventListener
(
'
submit
'
,
this
.
onBookmarkFormSubmitted
.
bind
(
this
)
);
form
.
querySelector
(
'
.button-cancel
'
).
addEventListener
(
'
click
'
,
this
.
cancelConfiguration
.
bind
(
this
)
);
},
},
onBookmarkFormSubmitted
(
ev
)
{
onBookmarkFormSubmitted
(
ev
)
{
...
@@ -173,7 +189,7 @@
...
@@ -173,7 +189,7 @@
_
.
forEach
(
models
,
function
(
model
)
{
_
.
forEach
(
models
,
function
(
model
)
{
model
.
destroy
();
model
.
destroy
();
});
});
this
.
$
(
'
.icon-pushpin
'
).
removeClass
(
'
button-on
'
);
this
.
el
.
querySelector
(
'
.icon-pushpin
'
).
classList
.
remove
(
'
button-on
'
);
}
}
}
}
}
}
...
...
src/converse-inverse.js
View file @
6c3aa34c
// Converse.js (A browser based XMPP chat client)
// Converse.js (A browser based XMPP chat client)
// http://conversejs.org
// http://conversejs.org
//
//
// Copyright (c)
2012-2016, Jan-Carel
Brand <jc@opkode.com>
// Copyright (c)
JC
Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
// Licensed under the Mozilla Public License (MPLv2)
//
//
/*global define */
/*global define */
...
...
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