var flUser = {
currentApp: {
plan: {
id: 'sub_1Lv0wBJNczvHKhMArMcr0keV',
active: true, // Update between 'true' and 'false'
status: 'active', // Update between 'active', 'past-due', and 'canceled'
createdAt: 1666280739,
expiresAt: 1668164160,
startedAt: 1666280739,
scheduledToCancel: true // Update between 'true' and 'false'
}
}
};
var appPlanBanners = {
currentApp: flUser.currentApp || {},
get appPlan() {
return this.currentApp.plan || {};
},
warningMessages: {
cancelation: {
message: 'You currently have <strong><span class="time-remaining">10</span> days left</strong> on your app plan. Your plan will expire on <span class="expiry-date">October 25, 2022</span>.',
button: 'Renew plan',
class: 'fl-info'
},
issue: {
message: 'There seems to be an <strong>issue with your payment method</strong>. If we don\'t receive payment your app will be downgraded, but your data will be untouched.',
button: 'Update payment method',
class: 'fl-warning'
},
upgrade: {
message: [
'Your app is on the Free plan. Your app is <strong>limited to 50 app users</strong> who can access it.',
'Your app is on the Free plan. Your app is <strong>limited to 3 app collaborators</strong> who can help you build and test the app.',
'Your app is on the Free plan. Your app is <strong>limited to 500MB of storage</strong>, upgrade to increase storage limits.'
],
button: 'Upgrade',
class: 'fl-default'
}
},
generateWarning: function(type) {
var message = this.warningMessages[type].message;
if (type === 'upgrade') {
message = message[Math.floor(Math.random() * message.length)]
}
var $warningMessage = $('<p>' + message + '</p>');
if (type === 'cancelation') {
var daysRemaining = moment.unix(this.appPlan.expiresAt).diff(moment(), 'days');
var expiryDate =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.