Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Essem
Sharkey
Commits
1eecc1fa
Commit
1eecc1fa
authored
7 years ago
by
こぴなたみぽ
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
6573f364
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/web/app/common/-tags/twitter-setting.tag
+0
-62
0 additions, 62 deletions
src/web/app/common/-tags/twitter-setting.tag
src/web/app/common/views/components/twitter-setting.vue
+64
-0
64 additions, 0 deletions
src/web/app/common/views/components/twitter-setting.vue
with
64 additions
and
62 deletions
src/web/app/common/-tags/twitter-setting.tag
deleted
100644 → 0
+
0
−
62
View file @
6573f364
<mk-twitter-setting>
<p>%i18n:common.tags.mk-twitter-setting.description%<a href={ _DOCS_URL_ + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p>
<p class="account" v-if="I.twitter" title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p>
<p>
<a href={ _API_URL_ + '/connect/twitter' } target="_blank" @click="connect">{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a>
<span v-if="I.twitter"> or </span>
<a href={ _API_URL_ + '/disconnect/twitter' } target="_blank" v-if="I.twitter" @click="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%</a>
</p>
<p class="id" v-if="I.twitter">Twitter ID: { I.twitter.user_id }</p>
<style lang="stylus" scoped>
:scope
display block
color #4a535a
.account
border solid 1px #e1e8ed
border-radius 4px
padding 16px
a
font-weight bold
color inherit
.id
color #8899a6
</style>
<script lang="typescript">
this.mixin('i');
this.form = null;
this.on('mount', () => {
this.$root.$data.os.i.on('updated', this.onMeUpdated);
});
this.on('unmount', () => {
this.$root.$data.os.i.off('updated', this.onMeUpdated);
});
this.onMeUpdated = () => {
if (this.$root.$data.os.i.twitter) {
if (this.form) this.form.close();
}
};
this.connect = e => {
e.preventDefault();
this.form = window.open(_API_URL_ + '/connect/twitter',
'twitter_connect_window',
'height=570,width=520');
return false;
};
this.disconnect = e => {
e.preventDefault();
window.open(_API_URL_ + '/disconnect/twitter',
'twitter_disconnect_window',
'height=570,width=520');
return false;
};
</script>
</mk-twitter-setting>
This diff is collapsed.
Click to expand it.
src/web/app/common/views/components/twitter-setting.vue
0 → 100644
+
64
−
0
View file @
1eecc1fa
<
template
>
<div
class=
"mk-twitter-setting"
>
<p>
%i18n:common.tags.mk-twitter-setting.description%
<a
:href=
"`$
{docsUrl}/link-to-twitter`" target="_blank">%i18n:common.tags.mk-twitter-setting.detail%
</a></p>
<p
class=
"account"
v-if=
"os.i.twitter"
:title=
"`Twitter ID: $
{os.i.twitter.user_id}`">%i18n:common.tags.mk-twitter-setting.connected-to%:
<a
:href=
"`https://twitter.com/$
{os.i.twitter.screen_name}`" target="_blank">@
{{
I
.
twitter
.
screen_name
}}
</a></p>
<p>
<a
:href=
"`$
{apiUrl}/connect/twitter`" target="_blank" @click.prevent="connect">
{{
os
.
i
.
twitter
?
'
%i18n:common.tags.mk-twitter-setting.reconnect%
'
:
'
%i18n:common.tags.mk-twitter-setting.connect%
'
}}
</a>
<span
v-if=
"os.i.twitter"
>
or
</span>
<a
:href=
"`$
{apiUrl}/disconnect/twitter`" target="_blank" v-if="os.i.twitter" @click.prevent="disconnect">%i18n:common.tags.mk-twitter-setting.disconnect%
</a>
</p>
<p
class=
"id"
v-if=
"os.i.twitter"
>
Twitter ID:
{{
os
.
i
.
twitter
.
user_id
}}
</p>
</div>
</
template
>
<
script
lang=
"ts"
>
import
Vue
from
'
vue
'
;
import
{
apiUrl
,
docsUrl
}
from
'
../../../config
'
;
export
default
Vue
.
extend
({
data
()
{
return
{
form
:
null
,
apiUrl
,
docsUrl
};
},
watch
:
{
'
os.i
'
()
{
if
((
this
as
any
).
os
.
i
.
twitter
)
{
if
(
this
.
form
)
this
.
form
.
close
();
}
}
},
methods
:
{
connect
()
{
this
.
form
=
window
.
open
(
apiUrl
+
'
/connect/twitter
'
,
'
twitter_connect_window
'
,
'
height=570, width=520
'
);
},
disconnect
()
{
window
.
open
(
apiUrl
+
'
/disconnect/twitter
'
,
'
twitter_disconnect_window
'
,
'
height=570, width=520
'
);
}
}
});
</
script
>
<
style
lang=
"stylus"
scoped
>
.mk-twitter-setting
color #4a535a
.account
border solid 1px #e1e8ed
border-radius 4px
padding 16px
a
font-weight bold
color inherit
.id
color #8899a6
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment