Initial project structure with sails.js
This commit is contained in:
106
assets/js/pages/account/account-overview.page.js
Normal file
106
assets/js/pages/account/account-overview.page.js
Normal file
@ -0,0 +1,106 @@
|
||||
parasails.registerPage('account-overview', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
isBillingEnabled: false,
|
||||
|
||||
hasBillingCard: false,
|
||||
|
||||
// Syncing/loading states for this page.
|
||||
syncingOpenCheckout: false,
|
||||
syncingUpdateCard: false,
|
||||
syncingRemoveCard: false,
|
||||
|
||||
// For <ajax-form>
|
||||
formData: { /* … */ },
|
||||
formRules: { /* … */ },
|
||||
formErrors: { /* … */ },
|
||||
cloudError: '',
|
||||
syncing: '',
|
||||
|
||||
// For <modal>:
|
||||
modal: '',
|
||||
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function (){
|
||||
_.extend(this, window.SAILS_LOCALS);
|
||||
|
||||
this.isBillingEnabled = !!this.stripePublishableKey;
|
||||
|
||||
// Determine whether there is billing info for this user.
|
||||
this.me.hasBillingCard = (
|
||||
this.me.billingCardBrand &&
|
||||
this.me.billingCardLast4 &&
|
||||
this.me.billingCardExpMonth &&
|
||||
this.me.billingCardExpYear
|
||||
);
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
clickUpdateBillingCardButton: function() {
|
||||
this.modal = 'update-billing-card';
|
||||
this.formData = { newPaymentSource: undefined };
|
||||
this.formRules = { newPaymentSource: {required: true}};
|
||||
},
|
||||
|
||||
closeModal: async function() {
|
||||
// Dismiss modal
|
||||
this.modal = '';
|
||||
await this._resetForms();
|
||||
},
|
||||
|
||||
handleSubmittingUpdateBillingCard: async function(argins) {
|
||||
var newPaymentSource = argins.newPaymentSource;
|
||||
await Cloud.updateBillingCard.with(newPaymentSource);
|
||||
},
|
||||
|
||||
submittedUpdateBillingCard: async function() {
|
||||
Object.assign(this.me, _.pick(this.formData.newPaymentSource, ['billingCardLast4', 'billingCardBrand', 'billingCardExpMonth', 'billingCardExpYear']));
|
||||
this.me.hasBillingCard = true;
|
||||
|
||||
// Dismiss modal
|
||||
this.modal = '';
|
||||
await this._resetForms();
|
||||
},
|
||||
|
||||
_resetForms: async function() {
|
||||
this.cloudError = '';
|
||||
this.formData = {};
|
||||
this.formRules = {};
|
||||
this.formErrors = {};
|
||||
await this.forceRender();
|
||||
},
|
||||
|
||||
clickRemoveCardButton: async function() {
|
||||
this.modal = 'remove-billing-card';
|
||||
this.formData.stripeToken = '';
|
||||
},
|
||||
|
||||
submittedRemoveCardForm: async function() {
|
||||
|
||||
// Update billing info on success.
|
||||
this.me.billingCardLast4 = undefined;
|
||||
this.me.billingCardBrand = undefined;
|
||||
this.me.billingCardExpMonth = undefined;
|
||||
this.me.billingCardExpYear = undefined;
|
||||
this.me.hasBillingCard = false;
|
||||
|
||||
// Close the modal and clear it out.
|
||||
this.closeModal();
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
});
|
50
assets/js/pages/account/edit-password.page.js
Normal file
50
assets/js/pages/account/edit-password.page.js
Normal file
@ -0,0 +1,50 @@
|
||||
parasails.registerPage('edit-password', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
password: {required: true},
|
||||
confirmPassword: {required: true, sameAs: 'password'},
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
// Redirect to a different web page on success.
|
||||
// > (Note that we re-enable the syncing state here. This is on purpose--
|
||||
// > to make sure the spinner stays there until the page navigation finishes.)
|
||||
this.syncing = true;
|
||||
window.location = '/account';
|
||||
},
|
||||
|
||||
}
|
||||
});
|
52
assets/js/pages/account/edit-profile.page.js
Normal file
52
assets/js/pages/account/edit-profile.page.js
Normal file
@ -0,0 +1,52 @@
|
||||
parasails.registerPage('edit-profile', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
fullName: {required: true},
|
||||
emailAddress: {required: true, isEmail: true},
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
// Set the form data.
|
||||
this.formData.fullName = this.me.fullName;
|
||||
this.formData.emailAddress = this.me.emailChangeCandidate ? this.me.emailChangeCandidate : this.me.emailAddress;
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
// Redirect to the account page on success.
|
||||
// > (Note that we re-enable the syncing state here. This is on purpose--
|
||||
// > to make sure the spinner stays there until the page navigation finishes.)
|
||||
this.syncing = true;
|
||||
window.location = '/account';
|
||||
},
|
||||
|
||||
}
|
||||
});
|
54
assets/js/pages/contact.page.js
Normal file
54
assets/js/pages/contact.page.js
Normal file
@ -0,0 +1,54 @@
|
||||
parasails.registerPage('contact', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
emailAddress: {isEmail: true, required: true},
|
||||
fullName: {required: true},
|
||||
topic: {required: true},
|
||||
message: {required: true},
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
|
||||
// Success state when form has been submitted
|
||||
cloudSuccess: false,
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
|
||||
// Show the success message.
|
||||
this.cloudSuccess = true;
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
});
|
59
assets/js/pages/dashboard/welcome.page.js
Normal file
59
assets/js/pages/dashboard/welcome.page.js
Normal file
@ -0,0 +1,59 @@
|
||||
parasails.registerPage('welcome', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
modal: '',
|
||||
pageLoadedAt: Date.now()
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╦╦═╗╔╦╗╦ ╦╔═╗╦ ╔═╗╔═╗╔═╗╔═╗╔═╗
|
||||
// ╚╗╔╝║╠╦╝ ║ ║ ║╠═╣║ ╠═╝╠═╣║ ╦║╣ ╚═╗
|
||||
// ╚╝ ╩╩╚═ ╩ ╚═╝╩ ╩╩═╝ ╩ ╩ ╩╚═╝╚═╝╚═╝
|
||||
// Configure deep-linking (aka client-side routing)
|
||||
virtualPagesRegExp: /^\/welcome\/?([^\/]+)?\/?/,
|
||||
afterNavigate: async function(virtualPageSlug){
|
||||
// `virtualPageSlug` is determined by the regular expression above, which
|
||||
// corresponds with `:unused?` in the server-side route for this page.
|
||||
switch (virtualPageSlug) {
|
||||
case 'hello':
|
||||
this.modal = 'example';
|
||||
break;
|
||||
default:
|
||||
this.modal = '';
|
||||
}
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
clickOpenExampleModalButton: async function() {
|
||||
this.goto('/welcome/hello');
|
||||
// Or, without deep links, instead do:
|
||||
// ```
|
||||
// this.modal = 'example';
|
||||
// ```
|
||||
},
|
||||
|
||||
closeExampleModal: async function() {
|
||||
this.goto('/welcome');
|
||||
// Or, without deep links, instead do:
|
||||
// ```
|
||||
// this.modal = '';
|
||||
// ```
|
||||
},
|
||||
|
||||
}
|
||||
});
|
25
assets/js/pages/entrance/confirmed-email.page.js
Normal file
25
assets/js/pages/entrance/confirmed-email.page.js
Normal file
@ -0,0 +1,25 @@
|
||||
parasails.registerPage('confirmed-email', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function(){
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
//…
|
||||
}
|
||||
});
|
49
assets/js/pages/entrance/forgot-password.page.js
Normal file
49
assets/js/pages/entrance/forgot-password.page.js
Normal file
@ -0,0 +1,49 @@
|
||||
parasails.registerPage('forgot-password', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
emailAddress: {required: true, isEmail: true},
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
|
||||
// Success state when form has been submitted
|
||||
cloudSuccess: false,
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
// If it worked, show the success message.
|
||||
this.cloudSuccess = true;
|
||||
},
|
||||
|
||||
}
|
||||
});
|
53
assets/js/pages/entrance/login.page.js
Normal file
53
assets/js/pages/entrance/login.page.js
Normal file
@ -0,0 +1,53 @@
|
||||
parasails.registerPage('login', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: {
|
||||
rememberMe: true,
|
||||
},
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// A set of validation rules for our form.
|
||||
// > The form will not be submitted if these are invalid.
|
||||
formRules: {
|
||||
emailAddress: { required: true, isEmail: true },
|
||||
password: { required: true },
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
// Redirect to the logged-in dashboard on success.
|
||||
// > (Note that we re-enable the syncing state here. This is on purpose--
|
||||
// > to make sure the spinner stays there until the page navigation finishes.)
|
||||
this.syncing = true;
|
||||
window.location = '/';
|
||||
},
|
||||
|
||||
}
|
||||
});
|
52
assets/js/pages/entrance/new-password.page.js
Normal file
52
assets/js/pages/entrance/new-password.page.js
Normal file
@ -0,0 +1,52 @@
|
||||
parasails.registerPage('new-password', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Main syncing/loading state for this page.
|
||||
syncing: false,
|
||||
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
password: {required: true},
|
||||
confirmPassword: {required: true, sameAs: 'password'},
|
||||
},
|
||||
|
||||
// Server error state for the form
|
||||
cloudError: '',
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
|
||||
this.formData.token = this.token;
|
||||
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
// Redirect to the logged-in dashboard on success.
|
||||
// > (Note that we re-enable the syncing state here. This is on purpose--
|
||||
// > to make sure the spinner stays there until the page navigation finishes.)
|
||||
this.syncing = true;
|
||||
window.location = '/';
|
||||
},
|
||||
|
||||
}
|
||||
});
|
62
assets/js/pages/entrance/signup.page.js
Normal file
62
assets/js/pages/entrance/signup.page.js
Normal file
@ -0,0 +1,62 @@
|
||||
parasails.registerPage('signup', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
// Form data
|
||||
formData: { /* … */ },
|
||||
|
||||
// For tracking client-side validation errors in our form.
|
||||
// > Has property set to `true` for each invalid property in `formData`.
|
||||
formErrors: { /* … */ },
|
||||
|
||||
// Form rules
|
||||
formRules: {
|
||||
fullName: {required: true},
|
||||
emailAddress: {required: true, isEmail: true},
|
||||
password: {required: true},
|
||||
confirmPassword: {required: true, sameAs: 'password'},
|
||||
agreed: {required: true},
|
||||
},
|
||||
|
||||
// Syncing / loading state
|
||||
syncing: false,
|
||||
|
||||
// Server error state
|
||||
cloudError: '',
|
||||
|
||||
// Success state when form has been submitted
|
||||
cloudSuccess: false,
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
submittedForm: async function() {
|
||||
if(this.isEmailVerificationRequired) {
|
||||
// If email confirmation is enabled, show the success message.
|
||||
this.cloudSuccess = true;
|
||||
}
|
||||
else {
|
||||
// Otherwise, redirect to the logged-in dashboard.
|
||||
// > (Note that we re-enable the syncing state here. This is on purpose--
|
||||
// > to make sure the spinner stays there until the page navigation finishes.)
|
||||
this.syncing = true;
|
||||
window.location = '/';
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
});
|
25
assets/js/pages/faq.page.js
Normal file
25
assets/js/pages/faq.page.js
Normal file
@ -0,0 +1,25 @@
|
||||
parasails.registerPage('faq', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function(){
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
//…
|
||||
}
|
||||
});
|
42
assets/js/pages/homepage.page.js
Normal file
42
assets/js/pages/homepage.page.js
Normal file
@ -0,0 +1,42 @@
|
||||
parasails.registerPage('homepage', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function(){
|
||||
this._setHeroHeight();
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
|
||||
clickHeroButton: async function() {
|
||||
// Scroll to the 'get started' section:
|
||||
$('html, body').animate({
|
||||
scrollTop: this.$find('[purpose="scroll-destination"]').offset().top
|
||||
}, 500);
|
||||
},
|
||||
|
||||
// Private methods not tied to a particular DOM event are prefixed with _
|
||||
_setHeroHeight: function() {
|
||||
var $hero = this.$find('[purpose="full-page-hero"]');
|
||||
var headerHeight = $('[purpose="page-header"]').outerHeight();
|
||||
var heightToSet = $(window).height();
|
||||
heightToSet = Math.max(heightToSet, 500);//« ensure min height of 500px - header height
|
||||
heightToSet = Math.min(heightToSet, 1000);//« ensure max height of 1000px - header height
|
||||
$hero.css('min-height', heightToSet - headerHeight+'px');
|
||||
},
|
||||
|
||||
}
|
||||
});
|
25
assets/js/pages/legal/privacy.page.js
Normal file
25
assets/js/pages/legal/privacy.page.js
Normal file
@ -0,0 +1,25 @@
|
||||
parasails.registerPage('privacy', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function(){
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
//…
|
||||
}
|
||||
});
|
25
assets/js/pages/legal/terms.page.js
Normal file
25
assets/js/pages/legal/terms.page.js
Normal file
@ -0,0 +1,25 @@
|
||||
parasails.registerPage('terms', {
|
||||
// ╦╔╗╔╦╔╦╗╦╔═╗╦ ╔═╗╔╦╗╔═╗╔╦╗╔═╗
|
||||
// ║║║║║ ║ ║╠═╣║ ╚═╗ ║ ╠═╣ ║ ║╣
|
||||
// ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝
|
||||
data: {
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗
|
||||
// ║ ║╠╣ ║╣ ║ ╚╦╝║ ║ ║╣
|
||||
// ╩═╝╩╚ ╚═╝╚═╝ ╩ ╚═╝╩═╝╚═╝
|
||||
beforeMount: function() {
|
||||
//…
|
||||
},
|
||||
mounted: async function(){
|
||||
//…
|
||||
},
|
||||
|
||||
// ╦╔╗╔╔╦╗╔═╗╦═╗╔═╗╔═╗╔╦╗╦╔═╗╔╗╔╔═╗
|
||||
// ║║║║ ║ ║╣ ╠╦╝╠═╣║ ║ ║║ ║║║║╚═╗
|
||||
// ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝
|
||||
methods: {
|
||||
//…
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user