Skip to content

Commit 1495e0e

Browse files
committed
feat: remove show image gallery option from dropdown
1 parent 8f04897 commit 1495e0e

File tree

4 files changed

+2
-65
lines changed

4 files changed

+2
-65
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function RemoteFunctions(config = {}) {
259259
* @param {DOMElement} element - the HTML DOM element that was clicked (should be an image)
260260
*/
261261
function _handleImageGalleryOptionClick(event, element) {
262-
if (!_imageRibbonGallery && shouldShowImageRibbon()) {
262+
if (!_imageRibbonGallery) {
263263
_imageRibbonGallery = new ImageRibbonGallery(element);
264264
}
265265
}
@@ -3380,12 +3380,6 @@ function RemoteFunctions(config = {}) {
33803380
return getHighlightMode() !== "click";
33813381
}
33823382

3383-
// helper function to check if image ribbon gallery should be shown
3384-
function shouldShowImageRibbon() {
3385-
if (_imageRibbonGallery) { return false; }
3386-
return config.imageRibbon !== false;
3387-
}
3388-
33893383
// helper function to clear element background highlighting
33903384
function clearElementBackground(element) {
33913385
if (element._originalBackgroundColor !== undefined) {
@@ -4022,23 +4016,12 @@ function RemoteFunctions(config = {}) {
40224016
const highlightModeChanged = oldHighlightMode !== newHighlightMode;
40234017
const isProStatusChanged = oldConfig.isProUser !== config.isProUser;
40244018
const highlightSettingChanged = oldConfig.highlight !== config.highlight;
4025-
const imageRibbonJustEnabled = !oldConfig.imageRibbon && config.imageRibbon;
4026-
4027-
// Handle significant configuration changes
4019+
// Handle configuration changes
40284020
if (highlightModeChanged || isProStatusChanged || highlightSettingChanged) {
40294021
_handleConfigurationChange();
40304022
}
40314023

4032-
// if user enabled the image ribbon setting and an image is selected, then we show the image ribbon
4033-
if (imageRibbonJustEnabled && previouslyClickedElement &&
4034-
previouslyClickedElement.tagName.toLowerCase() === 'img') {
4035-
if (!_imageRibbonGallery) {
4036-
_imageRibbonGallery = new ImageRibbonGallery(previouslyClickedElement);
4037-
}
4038-
}
4039-
40404024
_updateEventListeners();
4041-
40424025
return JSON.stringify(config);
40434026
}
40444027

src/LiveDevelopment/main.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ define(function main(require, exports, module) {
7070
},
7171
isProUser: isProUser,
7272
elemHighlights: "hover", // default value, this will get updated when the extension loads
73-
imageRibbon: true, // default value, this will get updated when the extension loads
7473
// this strings are used in RemoteFunctions.js
7574
// we need to pass this through config as remoteFunctions runs in browser context and cannot
7675
// directly reference Strings file
@@ -376,20 +375,6 @@ define(function main(require, exports, module) {
376375
}
377376
}
378377

379-
// this function is responsible to update image picker config
380-
// called from live preview extension when preference changes
381-
function updateImageRibbonConfig() {
382-
const prefValue = PreferencesManager.get("livePreviewImagePicker");
383-
config.imageRibbon = prefValue !== false; // default to true if undefined
384-
385-
if (MultiBrowserLiveDev && MultiBrowserLiveDev.status >= MultiBrowserLiveDev.STATUS_ACTIVE) {
386-
if (!prefValue) { MultiBrowserLiveDev.dismissLivePreviewBoxes(); } // to remove any existing image ribbons and UI boxes
387-
388-
MultiBrowserLiveDev.updateConfig(JSON.stringify(config));
389-
MultiBrowserLiveDev.registerHandlers();
390-
}
391-
}
392-
393378
// init commands
394379
CommandManager.register(Strings.CMD_LIVE_HIGHLIGHT, Commands.FILE_LIVE_HIGHLIGHT, togglePreviewHighlight);
395380
CommandManager.register(Strings.CMD_RELOAD_LIVE_PREVIEW, Commands.CMD_RELOAD_LIVE_PREVIEW, _handleReloadLivePreviewCommand);
@@ -418,7 +403,6 @@ define(function main(require, exports, module) {
418403
exports.togglePreviewHighlight = togglePreviewHighlight;
419404
exports.setLivePreviewEditFeaturesActive = setLivePreviewEditFeaturesActive;
420405
exports.updateElementHighlightConfig = updateElementHighlightConfig;
421-
exports.updateImageRibbonConfig = updateImageRibbonConfig;
422406
exports.getConnectionIds = MultiBrowserLiveDev.getConnectionIds;
423407
exports.getLivePreviewDetails = MultiBrowserLiveDev.getLivePreviewDetails;
424408
exports.hideHighlight = MultiBrowserLiveDev.hideHighlight;

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@ define(function (require, exports, module) {
113113
description: Strings.LIVE_DEV_SETTINGS_ELEMENT_HIGHLIGHT_PREFERENCE
114114
});
115115

116-
// live preview image picker preference (whether to show image gallery when clicking images)
117-
const PREFERENCE_PROJECT_IMAGE_RIBBON = "livePreviewImagePicker";
118-
PreferencesManager.definePreference(PREFERENCE_PROJECT_IMAGE_RIBBON, "boolean", true, {
119-
description: Strings.LIVE_PREVIEW_EDIT_IMAGE_RIBBON
120-
});
121-
122116
const LIVE_PREVIEW_PANEL_ID = "live-preview-panel";
123117
const LIVE_PREVIEW_IFRAME_ID = "panel-live-preview-frame";
124118
const LIVE_PREVIEW_IFRAME_HTML = `
@@ -425,7 +419,6 @@ define(function (require, exports, module) {
425419
if (isEditFeaturesActive) {
426420
items.push("---");
427421
items.push(Strings.LIVE_PREVIEW_EDIT_HIGHLIGHT_ON);
428-
items.push(Strings.LIVE_PREVIEW_EDIT_IMAGE_RIBBON);
429422
}
430423

431424
const rawMode = PreferencesManager.get(PREFERENCE_LIVE_PREVIEW_MODE) || _getDefaultMode();
@@ -451,12 +444,6 @@ define(function (require, exports, module) {
451444
return `✓ ${Strings.LIVE_PREVIEW_EDIT_HIGHLIGHT_ON}`;
452445
}
453446
return `${'\u00A0'.repeat(4)}${Strings.LIVE_PREVIEW_EDIT_HIGHLIGHT_ON}`;
454-
} else if (item === Strings.LIVE_PREVIEW_EDIT_IMAGE_RIBBON) {
455-
const isImageRibbonEnabled = PreferencesManager.get(PREFERENCE_PROJECT_IMAGE_RIBBON) !== false;
456-
if(isImageRibbonEnabled) {
457-
return `✓ ${item}`;
458-
}
459-
return `${'\u00A0'.repeat(4)}${item}`;
460447
}
461448
return item;
462449
});
@@ -505,15 +492,6 @@ define(function (require, exports, module) {
505492
const newMode = currentMode !== "click" ? "click" : "hover";
506493
PreferencesManager.set(PREFERENCE_PROJECT_ELEMENT_HIGHLIGHT, newMode);
507494
return; // Don't dismiss highlights for this option
508-
} else if (item === Strings.LIVE_PREVIEW_EDIT_IMAGE_RIBBON) {
509-
// Don't allow image ribbon toggle if edit features are not active
510-
if (!isEditFeaturesActive) {
511-
return;
512-
}
513-
// Toggle image ribbon preference
514-
const currentEnabled = PreferencesManager.get(PREFERENCE_PROJECT_IMAGE_RIBBON);
515-
PreferencesManager.set(PREFERENCE_PROJECT_IMAGE_RIBBON, !currentEnabled);
516-
return; // Don't dismiss highlights for this option
517495
}
518496

519497
// need to dismiss the previous highlighting and stuff
@@ -1318,15 +1296,8 @@ define(function (require, exports, module) {
13181296
LiveDevelopment.updateElementHighlightConfig();
13191297
});
13201298

1321-
// Handle image ribbon preference changes from this extension
1322-
PreferencesManager.on("change", PREFERENCE_PROJECT_IMAGE_RIBBON, function() {
1323-
LiveDevelopment.updateImageRibbonConfig();
1324-
});
1325-
13261299
// Initialize element highlight config on startup
13271300
LiveDevelopment.updateElementHighlightConfig();
1328-
// Initialize image ribbon config on startup
1329-
LiveDevelopment.updateImageRibbonConfig();
13301301

13311302
LiveDevelopment.openLivePreview();
13321303
LiveDevelopment.on(LiveDevelopment.EVENT_OPEN_PREVIEW_URL, _openLivePreviewURL);

src/nls/root/strings.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ define({
205205
"LIVE_PREVIEW_MODE_HIGHLIGHT": "Highlight Mode",
206206
"LIVE_PREVIEW_MODE_EDIT": "Edit Mode",
207207
"LIVE_PREVIEW_EDIT_HIGHLIGHT_ON": "Edit Highlights on Hover",
208-
"LIVE_PREVIEW_EDIT_IMAGE_RIBBON": "Show Image Picker on Image click",
209208
"LIVE_PREVIEW_MODE_PREFERENCE": "{0} shows only the webpage, {1} connects the webpage to your code - click on elements to jump to their code and vice versa, {2} provides highlighting along with advanced element manipulation",
210209
"LIVE_PREVIEW_CONFIGURE_MODES": "Configure Live Preview Modes",
211210
"LIVE_PREVIEW_PRO_FEATURE_TITLE": "Pro Feature",

0 commit comments

Comments
 (0)