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
fef92ad9
Commit
fef92ad9
authored
Jan 30, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oauth: Replace VDOMView with HTMLView
parent
8b522776
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
20 deletions
+18
-20
src/converse-oauth.js
src/converse-oauth.js
+5
-11
src/templates/oauth_providers.html
src/templates/oauth_providers.html
+0
-9
src/templates/oauth_providers.js
src/templates/oauth_providers.js
+13
-0
No files found.
src/converse-oauth.js
View file @
fef92ad9
...
...
@@ -4,12 +4,11 @@
* @license Mozilla Public License (MPLv2)
*/
import
{
Collection
}
from
"
skeletor.js/src/collection
"
;
import
{
HTMLView
}
from
'
skeletor.js/src/htmlview.js
'
;
import
{
Model
}
from
'
skeletor.js/src/model.js
'
;
import
converse
from
"
@converse/headless/converse-core
"
;
import
hello
from
"
hellojs
"
;
import
tpl_oauth_providers
from
"
templates/oauth_providers.html
"
;
const
{
_
,
Backbone
}
=
converse
.
env
;
import
tpl_oauth_providers
from
"
templates/oauth_providers.js
"
;
// The following line registers your plugin.
...
...
@@ -91,17 +90,12 @@ converse.plugins.add("converse-oauth", {
_converse
.
oauth_providers
=
new
_converse
.
OAuthProviders
();
_converse
.
OAuthProvidersView
=
Backbone
.
VDOMView
.
extend
({
'
events
'
:
{
'
click .oauth-login
'
:
'
oauthLogin
'
},
_converse
.
OAuthProvidersView
=
HTMLView
.
extend
({
toHTML
()
{
return
tpl_oauth_providers
(
Object
.
assign
({
'
_
'
:
_
,
'
__
'
:
_converse
.
__
,
'
providers
'
:
this
.
model
.
toJSON
()
'
providers
'
:
this
.
model
.
toJSON
(),
'
oauthLogin
'
:
ev
=>
this
.
oauthLogin
(
ev
)
}));
},
...
...
src/templates/oauth_providers.html
deleted
100644 → 0
View file @
8b522776
<fieldset
class=
"oauth-providers"
>
{[ o._.forEach(o.providers, function (provider) { ]}
<p
class=
"oauth-provider"
>
<a
class=
"oauth-login"
href=
"#"
data-id=
"{{provider.id}}"
>
<i
class=
"fa {{ provider.class}}"
></i>
{{provider.login_text}}
</a>
</p>
{[ }); ]}
</fieldset>
src/templates/oauth_providers.js
0 → 100644
View file @
fef92ad9
const
tpl_provider
=
(
o
)
=>
html
`
<p class="oauth-provider">
<a @click=
${
o
.
oauthLogin
}
class="oauth-login" data-id="
${
provider
.
id
}
">
<i class="fa
${
provider
.
class
}
"></i>
${
provider
.
login_text
}
</a>
</p>
`
;
export
default
(
o
)
=>
html
`
<fieldset class="oauth-providers">
${
o
.
providers
.
map
(
provider
=>
tpl_provider
(
o
))
}
</fieldset>
`
;
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