2020-07-30 16:12:44 +03:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import copyTextToClipboard from 'ghost-admin/utils/copy-text-to-clipboard';
|
|
|
|
import {computed} from '@ember/object';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
import {task, timeout} from 'ember-concurrency';
|
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
config: service(),
|
|
|
|
tagName: '',
|
|
|
|
isLink: true,
|
|
|
|
|
|
|
|
toggleValue: computed('isLink', function () {
|
2020-08-26 18:10:19 +03:00
|
|
|
return this.isLink ? 'Data attributes' : 'Links';
|
2020-07-30 16:12:44 +03:00
|
|
|
}),
|
|
|
|
|
|
|
|
sectionHeaderLabel: computed('isLink', function () {
|
2020-08-26 18:10:19 +03:00
|
|
|
return this.isLink ? 'Link' : 'Data attribute';
|
2020-07-30 16:12:44 +03:00
|
|
|
}),
|
|
|
|
|
|
|
|
init() {
|
|
|
|
this._super(...arguments);
|
|
|
|
this.siteUrl = this.config.get('blogUrl');
|
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
toggleShowLinks() {
|
|
|
|
this.toggleProperty('isLink');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
copyDefault: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
|
|
|
copySignup: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
2020-11-17 21:30:46 +03:00
|
|
|
copySignupMonthly: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
|
|
|
copySignupYearly: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
2020-11-20 08:30:27 +03:00
|
|
|
copySignupFree: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
2020-07-30 16:12:44 +03:00
|
|
|
copySignin: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
|
|
|
copyAccountHome: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
|
|
|
copyAccountPlans: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
}),
|
|
|
|
copyAccountProfile: task(function* (data) {
|
|
|
|
copyTextToClipboard(data);
|
|
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
|
|
})
|
|
|
|
});
|