Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gulpfile.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ function inlineTextRequire(file, content, srcDir, isDevBuild = true) {
const requireFragments = extractRequireTextFragments(content);
for (const {requirePath, requireStatement} of requireFragments) {
let filePath = srcDir + requirePath;
if(requirePath.startsWith("./")) {
if(requirePath.startsWith("./") || requirePath.startsWith("../")) {
filePath = path.join(path.dirname(file), requirePath);
}
let textContent = textContentMap[getKey(filePath, isDevBuild)];
Expand All @@ -663,7 +663,7 @@ function inlineTextRequire(file, content, srcDir, isDevBuild = true) {
textContentMap[getKey(filePath, isDevBuild)] = fileContent;
textContent = fileContent;
}
if((requirePath.endsWith(".js") && !requirePath.includes("./")) // js files that are relative paths are ok
if((requirePath.endsWith(".js") && !requirePath.includes("./") && !requirePath.includes("../")) // js files that are relative paths are ok
|| excludeSuffixPathsInlining.some(ext => requirePath.endsWith(ext))) {
console.warn("Not inlining JS/JSON file:", requirePath, filePath);
if(filePath.includes("phoenix-pro")) {
Expand Down
2 changes: 0 additions & 2 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ define(function (require, exports, module) {
require("widgets/InlineMenu");
require("thirdparty/tinycolor");
require("utils/LocalizationUtils");
require("services/login-desktop");
require("services/login-browser");

// DEPRECATED: In future we want to remove the global CodeMirror, but for now we
// expose our required CodeMirror globally so as to avoid breaking extensions in the
Expand Down
3 changes: 0 additions & 3 deletions src/command/DefaultMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ define(function (require, exports, module) {
menu.addMenuItem(Commands.HELP_SUPPORT);
menu.addMenuDivider();
menu.addMenuItem(Commands.HELP_GET_PRO);
if(Phoenix.isNativeApp) {
menu.addMenuItem(Commands.HELP_MANAGE_LICENSES);
}
menu.addMenuDivider();
if (brackets.config.suggest_feature_url) {
menu.addMenuItem(Commands.HELP_SUGGEST);
Expand Down
20 changes: 15 additions & 5 deletions src/extensionsIntegrated/Phoenix-live-preview/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ define(function (require, exports, module) {
panelHTML = require("text!./panel.html"),
Dialogs = require("widgets/Dialogs"),
DefaultDialogs = require("widgets/DefaultDialogs"),
ProDialogs = require("services/pro-dialogs"),
utils = require('./utils');

const KernalModeTrust = window.KernalModeTrust;
Expand Down Expand Up @@ -163,12 +162,17 @@ define(function (require, exports, module) {
let connectingOverlayTimer = null; // this is needed as we show the connecting overlay after 3s
let connectingOverlayTimeDuration = 3000;

function _getLiveEditEntitlement() {
// in community edition, this may not be present;
return KernalModeTrust.EntitlementsManager && KernalModeTrust.EntitlementsManager.getLiveEditEntitlement();
}

let isProEditUser = false;
// this is called everytime there is a change in entitlements
async function _entitlementsChanged() {
try {
const entitlement = await KernalModeTrust.EntitlementsManager.getLiveEditEntitlement();
isProEditUser = entitlement.activated;
const entitlement = await _getLiveEditEntitlement();
isProEditUser = entitlement && entitlement.activated;
} catch (error) {
console.error("Error updating pro user status:", error);
isProEditUser = false;
Expand Down Expand Up @@ -411,7 +415,12 @@ define(function (require, exports, module) {
LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_HIGHLIGHT_MODE);
} else if (index === 2) {
if (!LiveDevelopment.setMode(LiveDevelopment.CONSTANTS.LIVE_EDIT_MODE)) {
ProDialogs.showProUpsellDialog(ProDialogs.UPSELL_TYPE_LIVE_EDIT);
if(KernalModeTrust.ProDialogs) {
KernalModeTrust.ProDialogs.showProUpsellDialog(
KernalModeTrust.ProDialogs.UPSELL_TYPE_LIVE_EDIT);
} else {
Metrics.countEvent(Metrics.EVENT_TYPE.PRO, "proUpsellDlg", "fail");
}
}
} else if (item === Strings.LIVE_PREVIEW_EDIT_HIGHLIGHT_ON) {
// Don't allow edit highlight toggle if edit features are not active
Expand Down Expand Up @@ -1313,7 +1322,8 @@ define(function (require, exports, module) {
_projectOpened();
if(!Phoenix.isSpecRunnerWindow){
_entitlementsChanged();
KernalModeTrust.EntitlementsManager.on(
// in community edition EntitlementsManager may be null
KernalModeTrust.EntitlementsManager && KernalModeTrust.EntitlementsManager.on(
KernalModeTrust.EntitlementsManager.EVENT_ENTITLEMENTS_CHANGED,
_entitlementsChanged
);
Expand Down
14 changes: 12 additions & 2 deletions src/extensionsIntegrated/Phoenix/guided-tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,23 @@ define(function (require, exports, module) {
PhStore.setItem(GUIDED_TOUR_LOCAL_STORAGE_KEY, JSON.stringify(userAlreadyDidAction));
}

function _isLoggedIn() {
// in community edition entitlements for pro is null
return KernalModeTrust.EntitlementsManager && KernalModeTrust.EntitlementsManager.isLoggedIn();
}

function _isPaidSubscriber() {
// in community edition entitlements for pro is null
return KernalModeTrust.EntitlementsManager && KernalModeTrust.EntitlementsManager.isPaidSubscriber();
}

async function _resolvePowerUserSurveyURL(surveyJson) {
try {
const isLoggedIn = KernalModeTrust.EntitlementsManager.isLoggedIn();
const isLoggedIn = _isLoggedIn();
if(!isLoggedIn) {
return surveyJson.powerUser;
}
const paidSubscriber = await KernalModeTrust.EntitlementsManager.isPaidSubscriber();
const paidSubscriber = await _isPaidSubscriber();
if(paidSubscriber && surveyJson.powerUserPaid) {
return surveyJson.powerUserPaid;
}
Expand Down
2 changes: 0 additions & 2 deletions src/help/HelpCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ define(function (require, exports, module) {
NativeApp = require("utils/NativeApp"),
Strings = require("strings"),
StringUtils = require("utils/StringUtils"),
ManageLicenses = require("services/manage-licenses"),
AboutDialogTemplate = require("text!htmlContent/about-dialog.html"),
ContributorsTemplate = require("text!htmlContent/contributors-list.html"),
Mustache = require("thirdparty/mustache/mustache");
Expand Down Expand Up @@ -174,7 +173,6 @@ define(function (require, exports, module) {
CommandManager.register(Strings.CMD_GET_PRO, Commands.HELP_GET_PRO, _handleLinkMenuItem(brackets.config.purchase_url), {
htmlName: getProString
});
CommandManager.register(Strings.CMD_MANAGE_LICENSES, Commands.HELP_MANAGE_LICENSES, ManageLicenses.showManageLicensesDialog);
CommandManager.register(Strings.CMD_SUGGEST, Commands.HELP_SUGGEST, _handleLinkMenuItem(brackets.config.suggest_feature_url));
CommandManager.register(Strings.CMD_REPORT_ISSUE, Commands.HELP_REPORT_ISSUE, _handleLinkMenuItem(brackets.config.report_issue_url));
CommandManager.register(Strings.CMD_RELEASE_NOTES, Commands.HELP_RELEASE_NOTES, _handleLinkMenuItem(brackets.config.release_notes_url));
Expand Down
Loading
Loading