Skip to content

Page designer i frame implementation#129

Open
asad-rafter wants to merge 2 commits intocloudinary:new_iframefrom
asad-rafter:page-designer-iFrame-implementation
Open

Page designer i frame implementation#129
asad-rafter wants to merge 2 commits intocloudinary:new_iframefrom
asad-rafter:page-designer-iFrame-implementation

Conversation

@asad-rafter
Copy link
Copy Markdown
Contributor

No description provided.

@@ -3,24 +3,16 @@
var PageMgr = require('dw/experience/PageMgr');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please move all require statements to local scope

"https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.2.10/iframeResizer.min.js",
"/experience/editors/cloudinary/utils.js",
"/experience/editors/cloudinary/imageForm.js"
"https://media-library.cloudinary.com/global/all.js",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be fetched dynamically from the BM?

@@ -0,0 +1,8 @@
'use strict';

var cloudinaryApi = require('*/cartridge/scripts/cloudinary/cloudinaryApi');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please move all require statements to local scope

@@ -5,13 +5,32 @@ var HashMap = require('dw/util/HashMap');
var cloudinaryApi = require('*/cartridge/scripts/cloudinary/cloudinaryApi');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please move all require statements to local scope

"resources": {
"scripts": [
"https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.2.10/iframeResizer.contentWindow.min.js",
"https://studio-widget.cloudinary.com/latest/all.js",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be fetched dynamically from the BM?


// Size the container to fill the modal viewport
parentIFrame.getPageInfo(function (info) {
var rem = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please use Numbaer.parseFloat instead of parseFloat

setTimeout(function () {
try {
var buttons = window.parent.document.querySelectorAll('button');
for (var b = 0; b < buttons.length; b++) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please use for-of loop

@@ -0,0 +1,173 @@
/**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter please use optional chain expression, and avoid unicode chars and long separation lines

try {
var ffOptions = JSON.parse(player.formFactorOptions);
var w = window.innerWidth;
var ff = w <= 767 ? 'mobile' : (w <= 1023 ? 'tablet' : 'desktop');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter are these numbers hardcodded in PD? is there any chance the customer would need different breakpoints

background: #fff;
}

.cld-adv-applied {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asad-rafter where is this class used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants