Rank: Member
Groups: Member
Joined: 10/16/2019(UTC) Posts: 12
|
Thanks for replying. So, I've added it and this is what my onActivate currently looks like: Quote: "onActivate": [ "{{ #function $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct(TRUE)},1000) }) }}", "{{ #function $['cc'].getHiResImages(800,800) }}" ] However, adding that new line still doesn't load my saved changes when I edit the PSD. Instead, it actually resets the state to the original (unedited version) when I try to preview a change and hit 'Back'. So, not sure what to do. This is my full config: Quote:{ "vars": { "psdApiUrl": "https://h.customerscanvas.com/online-demo/PsdWebService/", "designs": [{ "title": "Rectangle", "name": "clients/mycalendars/new/rectangle" }, { "title": "Oval", "name": "clients/mycalendars/new/oval" }, { "title": "Left Circle", "name": "clients/mycalendars/new/left-circle" }, { "title": "Top Circle", "name": "clients/mycalendars/new/top-circle" }] }, "language": "en", "widgets": [{ "name": "image-request", "type": "ajax", "params": { "url": "{{vars.psdApiUrl + '/api/preview'}}", "lock": "preview", "method": "POST", "responseType": "json", "request": { "template": "{{ 'mockups/clients/mycalendars/new/preview-mockup-' + $['design-variation']._.name.split('/')[3] }}", "format": "png", "unsharpMask": "(1.2, 0.5, 0.05)", "data": { "Design": { "type": "image", "image": "{{$['cc'].hiResUrls[0]}}", "dpix": 300, "dpiY": 300 } } } } }, { "name": "preview", "type": "image-carousel", "params": { "containerColor": "#ffffff", "showImageIndex": false, "images": [{ "url": "{{$['image-request'].response}}" }] } }, { "name": "finish-button", "type": "finish-button", "params": { "enabled": true, "visible": true, "onClick": ["{{#function $['cc'].getHiResImages(800,800)}}", "{{#function $['order-details'].widgetUpdated}}"] } }, { "name": "order-details", "type": "order", "params": { "images": "{{ [$['image-request'].response] }}", "downloadUrls": "{{ $['cc'].hiResUrls }}", "data": "{{ $['cc'].stateId }}" } }, { "name": "option-list", "type": "group", "params": { "type": "noncollapsible", "tabs": [{ "widgets": [{ "type": "gallery", "name": "design-variation", "title": "Header Type", "params": { "showTitle": true, "forceSelection": true, "items": { "{{ #each vars.designs as design }}": { "name": "{{ design.name}}", "title": "{{ design.title}}", "previewUrl": "{{ settings.customersCanvasBaseUrl + '/api/ProductTemplates/designs/' + design.name + '?width=400&height=400'}}" } } } }] }] } }, { "name": "cc", "type": "canvas", "params": { "initial": { "editorConfig": { "defaultItemsConfig": { "image": { "width": "50%", "location": { "x": "50%", "y": "50%", "originX": "center", "originY": "center" } }, "text": { "font": { "postScriptName": "ArialMT", "size": 24, "fauxBold": false, "fauxItalic": false }, "color": "#000" } }, "initialMode": "Advanced", "fontList": { "appFonts": ["*"] }, "autoLoadUserInfo": true, "restoreProductOnReloadEnabled": false, "canvas": { "shadowEnabled": false, "violationWarningButtonsEnabled": true, "color": "white", "rulers": { "enabled": false } }, "rendering": { "proofImageWatermarkEnabled": false }, "violationWarningsSettings": { "safetyLineViolationWarningEnabled": true }, "watermark": { "text": { "opacity": 0 } }, "widgets": { "TopToolbar": { "zOrderButtonsEnabled": false, "textShadowButtonEnabled": false, "textFontStyleButtonEnabled": false, "textStrokeButtonEnabled": false, "opacitySliderEnabled": false, "imageEditButtonEnabled": false, "zOrder": { "zOrderLevelButtonsEnabled": false, "zOrderSendToButtonsEnabled": false }, "fontSize": { "max": 72, "min": 6, "step": 1 } }, "Toolbox": { "buttons": [{ "translationKey": "Toolbox.TEXT", "translationKeyTitle": "Toolbox.TITLE_ADD_TEXT", "iconClass": "cc-icon-add-text", "buttons": ["Text"] }, { "translationKey": "Toolbox.ADD_IMAGE", "translationKeyTitle": "Toolbox.TITLE_ADD_IMAGE", "iconClass": "cc-icon-add-image", "action": "Image", "tabs": ["My Files"] }, { "translationKey": "Toolbox.SHAPE", "translationKeyTitle": "Toolbox.TITLE_ADD_SHAPE", "iconClass": "cc-icon-add-shape", "buttons": ["Line", "Rectangle", "Ellipse"] }] }, "ItemMenu": { "objectManipulationEnabled": true, "verticalAlignmentEnabled": false, "horizontalAlignmentEnabled": false, "changeZOrderEnabled": false }, "BottomToolbar": { "snapLinesCheckboxEnabled": false, "gridCheckboxEnabled": false }, "ObjectInspector": { "aboveCanvasOnSmallScreenEnabled": true, "bgItemEnabled": false, "position": "Right", "isHidden": true }, "GalleryDialog": { "publicFolderName": "", "downloadPsdAsImage": false, "defaultTabName": "My Files", "tabs": [{ "name": "My Files", "type": "user", "categoriesEnabled": true, "canEdit": true, "canUpload": true }] }, "FinishButton": { "mode": "Disabled" } } }, "productDefinition": { "surfaces": [{ "printAreas": [{ "designFile": "{{vars.designs[0].name}}" }] }] } }, "setPrintArea": { "{{#if $['design-variation']._}}": { "options": { "preserveUserChanges": true, "updateRevertData": false }, "data": { "designFile": "{{ $['design-variation']._.name }}" } }, "{{#else}}": {} } } }], "steps": [{ "name": "Design", "title": "Design", "mainPanel": { "name": "cc" }, "toolPanel": { "name": "option-list" } }, { "title": "Preview", "name": "Preview", "mainPanel": { "name": "preview" }, "onActivate": [ "{{ #function $['cc'].customersCanvasPromise.then((cc)=>{ setTimeout(() => {cc.revertProduct()},1000) }) }}", "{{ #function $['cc'].getHiResImages(800,800) }}" ] }], "userId": 1 }
|