@@ -29,13 +29,17 @@ define(function (require, exports, module) {
2929 const proTitle = `<span class="phoenix-pro-title">
3030 <span class="pro-plan-name">Phoenix Pro</span>
3131 <i class="fa-solid fa-feather orange-gold" style="margin-left: 3px;"></i>
32- </span>` ;
32+ </span>` ,
33+ proTitlePlain = `<span class="pro-plan-name">Phoenix Pro</span>
34+ <i class="fa-solid fa-feather" style="margin-left: 2px;"></i>` ;
3335 require ( "./setup-login-service" ) ; // this adds loginService to KernalModeTrust
3436 const Dialogs = require ( "widgets/Dialogs" ) ,
3537 Mustache = require ( "thirdparty/mustache/mustache" ) ,
3638 Strings = require ( "strings" ) ,
3739 StringUtils = require ( "utils/StringUtils" ) ,
38- proUpgradeHTML = require ( "text!./html/pro-upgrade.html" ) ;
40+ ThemeManager = require ( "view/ThemeManager" ) ,
41+ proUpgradeHTML = require ( "text!./html/pro-upgrade.html" ) ,
42+ proEndedHTML = require ( "text!./html/promo-ended.html" ) ;
3943
4044 function showProUpgradeDialog ( trialDays ) {
4145 const title = StringUtils . format ( Strings . PROMO_UPGRADE_TITLE , proTitle ) ;
@@ -44,10 +48,29 @@ define(function (require, exports, module) {
4448 Dialogs . showModalDialogUsingTemplate ( $template ) . done ( function ( id ) {
4549 console . log ( "Dialog closed with id: " + id ) ;
4650 if ( id === 'learn_more' ) {
47- Phoenix . app . openURLInDefaultBrowser ( brackets . config . homepage_url ) ;
51+ // todo add metrics
52+ Phoenix . app . openURLInDefaultBrowser ( brackets . config . purchase_url ) ;
53+ }
54+ } ) ;
55+ }
56+
57+ function showProEndedDialog ( currentVersion ) {
58+ currentVersion = currentVersion || window . AppConfig . apiVersion ;
59+ const buttonGetPro = StringUtils . format ( Strings . PROMO_GET_APP_UPSELL_BUTTON , proTitlePlain ) ;
60+ const title = StringUtils . format ( Strings . PROMO_PRO_ENDED_TITLE , proTitle ) ;
61+ const currentTheme = ThemeManager . getCurrentTheme ( ) ;
62+ const theme = currentTheme && currentTheme . dark ? "dark" : "light" ;
63+ const promoURL = `${ brackets . config . promotions_url } app/upsell_after_trial.html?lang=${ brackets . getLocale ( ) } &theme=${ theme } &version=${ currentVersion } ` ;
64+ const $template = $ ( Mustache . render ( proEndedHTML , { Strings, title, buttonGetPro, promoURL} ) ) ;
65+ Dialogs . showModalDialogUsingTemplate ( $template ) . done ( function ( id ) {
66+ console . log ( "Dialog closed with id: " + id ) ;
67+ if ( id === 'get_pro' ) {
68+ // todo add metrics
69+ Phoenix . app . openURLInDefaultBrowser ( brackets . config . purchase_url ) ;
4870 }
4971 } ) ;
5072 }
5173
5274 exports . showProUpgradeDialog = showProUpgradeDialog ;
75+ exports . showProEndedDialog = showProEndedDialog ;
5376} ) ;
0 commit comments