mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
d8dec01edd
refs TryGhost/Ghost#12365 Portal allows direct free signup link or data attributes, allowing members to directly share or link to only free plan in Portal popup if available - A new portal signup link for free plan - `/signup/free`
67 lines
2.0 KiB
JavaScript
67 lines
2.0 KiB
JavaScript
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 () {
|
|
return this.isLink ? 'Data attributes' : 'Links';
|
|
}),
|
|
|
|
sectionHeaderLabel: computed('isLink', function () {
|
|
return this.isLink ? 'Link' : 'Data attribute';
|
|
}),
|
|
|
|
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);
|
|
}),
|
|
copySignupMonthly: task(function* (data) {
|
|
copyTextToClipboard(data);
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
}),
|
|
copySignupYearly: task(function* (data) {
|
|
copyTextToClipboard(data);
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
}),
|
|
copySignupFree: task(function* (data) {
|
|
copyTextToClipboard(data);
|
|
yield timeout(this.isTesting ? 50 : 3000);
|
|
}),
|
|
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);
|
|
})
|
|
});
|