diff --git a/src/extensionsIntegrated/Phoenix/guided-tour.js b/src/extensionsIntegrated/Phoenix/guided-tour.js index 5cef4901ea..aaeb97e634 100644 --- a/src/extensionsIntegrated/Phoenix/guided-tour.js +++ b/src/extensionsIntegrated/Phoenix/guided-tour.js @@ -39,7 +39,6 @@ define(function (require, exports, module) { const GENERAL_SURVEY_TIME = 1200000, // 20 min SURVEY_PRELOAD_DELAY = 10000, // 10 seconds to allow the survey to preload, but not // enough time to break user workflow - ONE_MONTH_IN_DAYS = 30, POWER_USER_SURVEY_INTERVAL_DAYS = 35; const userAlreadyDidAction = PhStore.getItem(GUIDED_TOUR_LOCAL_STORAGE_KEY) @@ -58,11 +57,10 @@ define(function (require, exports, module) { * 2. Then after user opens default project, we show "edit code for live preview popup" * 3. When user changes file by clicking on files panel, we show "click here to open new project window" * this will continue showing every session until user clicks on the new project icon - * 4. After about 2 minutes, the GitHub stars popup will show, if not shown in the past two weeks. Repeats 2 weeks. - * 5. After about 3 minutes, the health popup will show up. - * 6. power user survey shows up if the user has used brackets for 3 days or 8 hours in the last two weeks after 3 + * 4. After about 3 minutes, the health popup will show up. + * 5. power user survey shows up if the user has used brackets for 3 days or 8 hours in the last two weeks after 3 * minutes. This will not coincide with health popup due to the power user check. - * 7. After about 10 minutes, survey shows up. + * 6. After about 10 minutes, survey shows up. * // the rest are by user actions * a. When user clicks on live preview, we show "click here to popout live preview" * b. Beautification notification when user opened the editor context menu and have not done any beautification yet. @@ -125,94 +123,6 @@ define(function (require, exports, module) { }); } - function _loadTwitterScripts() { - // https://developer.twitter.com/en/docs/twitter-for-websites/javascript-api/guides/javascript-api - // we maily do this to metric the users who clicked on the tweet button - if(window.twttr){ - return; - } - const twitterScript = document.createElement( 'script' ); - twitterScript.setAttribute( 'src', "https://platform.twitter.com/widgets.js" ); - document.body.appendChild( twitterScript ); - twitterScript.addEventListener("load", ()=>{ - if(!window.twttr){ - console.error("twitter scripts not loaded"); - return; - } - window.twttr.events.bind('click', function (ev) { - Metrics.countEvent(Metrics.EVENT_TYPE.USER, "notify", "twit.click", 1); - if(Phoenix.isNativeApp) { - // hyperlinks wont work in tauri, so we have to use tauri apis - Phoenix.app.openURLInDefaultBrowser( - 'https://twitter.com/intent/tweet?screen_name=phcodedev&ref_src=twsrc%5Etfw'); - } - }); - }); - } - - function _openStarsPopup() { - _loadTwitterScripts(); - let notification = $(`${Strings.GITHUB_STARS_POPUP} -
- ${Strings.GITHUB_STARS_POPUP_TWITTER} - - `); - notification.find(".gtstarph").click(()=>{ - Metrics.countEvent(Metrics.EVENT_TYPE.USER, "notify", "star.click", 1); - if(Phoenix.isNativeApp) { - // hyperlinks wont work in tauri, so we have to use tauri apis - Phoenix.app.openURLInDefaultBrowser( - 'https://github.com/phcode-dev/phoenix'); - } - }); - NotificationUI.createToastFromTemplate(Strings.ENJOYING_APP, notification, { - dismissOnClick: false - }); - } - - function _showRequestStarsPopup() { - if(Phoenix.firstBoot){ - // on first boot we don't show the `enjoying phoenix?` popup as user needs more time to evaluate. - // GitHub stars/tweet situation isn't improving either. So we show this at the second launch so that we - // the users like the product to revisit and then, every 30 days. - return; - } - let lastShownDate = userAlreadyDidAction.lastShownGithubStarsDate; - let nextShowDate = new Date(lastShownDate); - nextShowDate.setUTCDate(nextShowDate.getUTCDate() + ONE_MONTH_IN_DAYS); - let currentDate = new Date(); - if(!lastShownDate || currentDate >= nextShowDate){ - Metrics.countEvent(Metrics.EVENT_TYPE.USER, "notify", "star", 1); - _openStarsPopup(); - userAlreadyDidAction.lastShownGithubStarsDate = Date.now(); - PhStore.setItem(GUIDED_TOUR_LOCAL_STORAGE_KEY, JSON.stringify(userAlreadyDidAction)); - } - } - function _showFirstUseSurvey(surveyURL, delayOverride, title, useDialog) { let surveyVersion = 6; // increment this if you want to show this again if(userAlreadyDidAction.generalSurveyShownVersion === surveyVersion) { @@ -372,7 +282,6 @@ define(function (require, exports, module) { tourStarted = true; _showNewProjectNotification(); _showBeautifyNotification(); - _showRequestStarsPopup(); _showSurveys(); }; }); diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index ae3131de41..30a58a3bed 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -1284,9 +1284,6 @@ define({ // Guided tour "GUIDED_LIVE_PREVIEW": "Make some code changes in the HTML file to see live preview. ok", "GUIDED_LIVE_PREVIEW_POPOUT": "Click this button to popout live preview to a new tab. ok", - "ENJOYING_APP": "Enjoying {APP_NAME}?", - "GITHUB_STARS_POPUP": "