Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SharedFields:
Value:
- ID: "641c597f-4064-49dc-9384-eb3fa9ae0a27"
Hint: DisableSiteimproveInEE
Value: 1
Value:
- ID: "9c6106ea-7a5a-48e2-8cad-f0f693b1e2d4"
Hint: __Read Only
Value:
Expand All @@ -32,14 +32,14 @@ Languages:
Value: 20170214T131835
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "e282bb42-8099-47fc-932d-20af413f84d7"
Value: "87c72cf1-73be-4cda-92ad-8d3c128c2a1d"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\anthony_johnson@epam.com
sitecore\admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240425T154243Z
Value: 20240527T063010Z
- ID: "dc7b73b5-c692-4595-b193-95095d22f5ac"
Hint: Sites
Value: ""
Value: "{B0AFF02B-8F55-4643-BED9-7F651E0454B3}"
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Languages:
sitecore\admin
- ID: "8cdc337e-a112-42fb-bbb4-4143751e123f"
Hint: __Revision
Value: "b7dae90f-fcea-4f5a-bd03-6a3f9cc0e5cb"
Value: "28dd4334-bcf9-429c-a1b4-1ce1a8e8d425"
- ID: "badd9cf9-53e0-4d0c-bcc0-2d784c282f6a"
Hint: __Updated by
Value: |
sitecore\anthony_johnson@epam.com
sitecore\admin
- ID: "d9cf14b1-fa16-4ba6-9288-e8a174d4d522"
Hint: __Updated
Value: 20240410T130242Z
Value: 20240527T062709Z
3 changes: 1 addition & 2 deletions src/platform/App_Data/xdts/Web.config.xdt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" xdt:Transform="Replace" xdt:Locator="Match(name)" value="sameorigin" />
<add name="X-Frame-Options" xdt:Transform="Replace" xdt:Locator="Match(name)" value="allow-from https://help.siteimprove.com/support/" />
<add name="Content-Security-Policy" xdt:Transform="Replace" xdt:Locator="Match(name)" value="default-src 'self' 'unsafe-inline' 'unsafe-eval' https://apps.sitecore.net cdnjs.cloudflare.com https://*.siteimprove.com/; img-src 'self' data: https://s.gravatar.com https://*.wp.com/cdn.auth0.com/avatars https://*.sitecorecloud.io; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com cdnjs.cloudflare.com https://*.sitecorecloud.io; style-src-elem 'self' 'unsafe-inline' https://fonts.googleapis.com cdnjs.cloudflare.com https://*.sitecorecloud.io; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com cdnjs.cloudflare.com; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://cdn.siteimprove.net; connect-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.siteimprove.com; frame-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.siteimprove.com; frame-ancestors 'self' https://*.siteimprove.com; upgrade-insecure-requests; block-all-mixed-content;"/>
<add name="Content-Security-Policy" xdt:Transform="Replace" xdt:Locator="Match(name)" value="default-src 'self' 'unsafe-inline' 'unsafe-eval' https://apps.sitecore.net cdnjs.cloudflare.com https://*.siteimprove.com/; img-src 'self' data: https://cdn.auth0.com/avatars' https://s.gravatar.com https://*.wp.com/cdn.auth0.com/avatars https://*.sitecorecloud.io; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com cdnjs.cloudflare.com https://*.sitecorecloud.io; style-src-elem 'self' 'unsafe-inline' https://fonts.googleapis.com cdnjs.cloudflare.com https://*.sitecorecloud.io https://web-sdk-eu.aptrinsic.com; font-src 'self' 'unsafe-inline' https://fonts.gstatic.com cdnjs.cloudflare.com; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://cdn.siteimprove.net https://web-sdk-eu.aptrinsic.com ; connect-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.siteimprove.com https://esp-eu.aptrinsic.com; frame-src 'self' 'unsafe-eval' 'unsafe-inline' https://*.siteimprove.com; frame-ancestors 'self' https://*.siteimprove.com; upgrade-insecure-requests; block-all-mixed-content;"/>
</customHeaders>
</httpProtocol>
</system.webServer>
Expand Down
Binary file modified src/platform/lib/Siteimprove.dll
Binary file not shown.
330 changes: 330 additions & 0 deletions src/platform/sitecore/shell/Controls/SitecoreWindow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,330 @@
function scWindow() {
this.minimized = false;
this.maximized = false;
this.docked = false;

var manager = this.getManager();

if (manager != null) {
var icon = "";
var match = "";
var header = "";

var match = window.location.href.match(/ic=[^&]*/gi);
if (match != null) {
var icon = unescape(match[0]).substr(3);
}
var match = window.location.href.match(/he=[^&]*/gi);
if (match != null) {
var header = decodeURIComponent(match[0]).substr(3).replace(/\+/g, " ");
}
else {
header = "Content Editor";
}

this.docked = manager.register(window, header, icon);
}

scForm.browser.attachEvent(window, "onload", scLoadWindow);
scForm.browser.attachEvent(window, "onunload", scUnloadWindow);
}

scWindow.prototype.activate = function() {
this.bringToFront();
}

scWindow.prototype.bringToFront = function() {
var manager = this.getManager();
if (manager != null) {
manager.bringToFront(this.getID());
}
}

scWindow.prototype.canDrag = function() {
return !this.maximized && !this.minimized;
}

scWindow.prototype.canMaximize = function() {
this.getWindowFlags();

return this.maximizable && !this.docked;
}

scWindow.prototype.canMinimize = function() {
this.getWindowFlags();

return this.minimizable && !this.docked;
}

scWindow.prototype.canResize = function() {
this.getWindowFlags();

return this.resizable && !this.maximized && !this.minimized && !this.docked;
}

scWindow.prototype.closeWindow = function() {
var manager = this.getManager();
if (manager != null) {
manager.close(this.getID());
}
}

scWindow.prototype.getEventPoint = function(evt, control) {
var result = new scPoint(evt.clientX, evt.clientY);

var ctl = scForm.browser.getSrcElement(evt);

ctl = ctl.offsetParent;

while (ctl != null && ctl != control) {
result.offset(ctl.offsetLeft, ctl.offsetTop);

ctl = ctl.offsetParent;
}

return result;
}

scWindow.prototype.getFrame = function() {
return scForm.browser.getFrameElement(window);
}

scWindow.prototype.getID = function() {
var frame = this.getFrame();

if (frame != null) {
return frame.id;
}

return null;
}

scWindow.prototype.getManager = function() {
if (typeof(window.parent.scManager) != "undefined") {
return window.parent.scManager;
}

return null;
}

scWindow.prototype.getWindowFlags = function() {
if (this.maximizable == null) {
this.maximizable = true;
this.minimizable = true;
this.resizable = true;

for(var e = scForm.browser.getEnumerator(document.getElementsByTagName("TABLE")); !e.atEnd(); e.moveNext()) {
var className = e.item().className;

if (className.indexOf("scWindowHandle") >= 0) {
this.resizable = className.indexOf("scWindowNoResize") < 0;
this.maximizable = className.indexOf("scWindowNoMaximize") < 0;
this.minimizable = className.indexOf("scWindowNoMinimize") < 0;
break;
}
}
}
}

scWindow.prototype.hideWindow = function() {
var manager = this.getManager();
if (manager != null) {
manager.hide(this.getID());
}
}

scWindow.prototype.hitTest = function(evt) {
if (evt == null) {
return "";
}

var ctl = scForm.browser.getSrcElement(evt);
if (typeof ctl.tagName == "undefined") {
return "";
}

var delta = 4;
var delta2 = 16;

var point = new scPoint(evt.clientX, evt.clientY);

var width = document.body.offsetWidth;
var height = document.body.offsetHeight;

if (this.canResize()) {
if (point.x < delta && point.y < delta2 || point.x < delta2 && point.y < delta) {
return "resize topleft";
}
else if (point.x < delta && point.y >= height - delta2 || point.x < delta2 && point.y >= height - delta) {
return "resize bottomleft";
}
else if (point.x >= width - delta2 && point.y < delta || point.x >= width - delta && point.y < delta2) {
return "resize topright";
}
else if (point.x >= width - delta2 && point.y >= height - delta || point.x >= width - delta && point.y >= height - delta2) {
return "resize bottomright";
}
else if (point.x < delta) {
return "resize left";
}
else if (point.x >= width - delta) {
return "resize right";
}
else if (point.y < delta) {
return "resize top";
}
else if (point.y >= height - delta) {
return "resize bottom";
}
}

if (this.canDrag()) {
while (ctl != null) {
if (ctl.classList != null && ctl.classList.length > 0 && ctl.className != null && ctl.className.indexOf("scWindowHandle") >= 0 && point.y < 60) {
return "handle";
}

ctl = ctl.parentNode;
}
}

return "";
}

scWindow.prototype.hide = function() {
var manager = this.getManager();
if (manager != null) {
manager.hide(this.getID());
}
}

scWindow.prototype.maximizeWindow = function() {
if (this.canMaximize()) {
if (window.event.clientY > 36) {
return;
}
var manager = this.getManager();

if (manager != null) {
manager.maximize(this.getID());
}
}
}

scWindow.prototype.minimizeWindow = function() {
if (this.canMinimize()) {
var manager = this.getManager();

if (manager != null) {
manager.minimize(this.getID());
}
}
}

scWindow.prototype.mouseDown = function(tag, evt) {
if (evt != null && scForm.browser.getMouseButton(evt) == 1 && !evt.ctrlKey && !evt.shiftKey && !evt.altKey) {
var manager = this.getManager();

if (manager != null) {
this.manager = manager;

manager.mouseDown(tag, evt, this.getID(), this.hitTest(evt));
}
}
}

scWindow.prototype.mouseMove = function(tag, evt) {
if (this.manager != null) {
this.manager.mouseMove(tag, evt, this.getID());
return false;
}
else {
var hit = this.hitTest(evt);

switch (hit) {
case "resize left": case "resize right":
document.body.style.cursor = "e-resize";
break;

case "resize top": case "resize bottom":
document.body.style.cursor = "n-resize";
break;

case "resize topleft": case "resize bottomright":
document.body.style.cursor = "mw-resize";
break;

case "resize topright": case "resize bottomleft":
document.body.style.cursor = "sw-resize";
break;

default:
document.body.style.cursor = "default";
break;
}
}

return false;
}

scWindow.prototype.mouseUp = function(tag, evt) {
if (this.manager != null) {
this.manager.mouseUp(tag, evt, this.getID());
this.manager = null;
return false;
}
}

scWindow.prototype.setCaption = function(caption) {
var ctl = scForm.browser.getControl("WindowCaption");

if (ctl != null) {
ctl.innerHTML = caption + " - ";
}
}

scWindow.prototype.setDocked = function(docked) {
this.docked = docked;

var ctl = scForm.browser.getControl("WindowFrameTop");
if (ctl != null) {
ctl.style.background = (docked ? "inactiveborder" : "activecaption url(/sitecore/shell/themes/standard/images/toolwindow.gif) repeat-x");
ctl.style.color = (docked ? "windowtext" : "captiontext");
}
var ctl = scForm.browser.getControl("WindowFrameLeft");
if (ctl != null) {
ctl.style.background = (docked ? "inactiveborder" : "activecaption");
}
var ctl = scForm.browser.getControl("WindowFrameRight");
if (ctl != null) {
ctl.style.background = (docked ? "inactiveborder" : "activecaption");
}
var ctl = scForm.browser.getControl("WindowFrameBottom");
if (ctl != null) {
ctl.style.background = (docked ? "inactiveborder" : "activecaption");
}
}

function scLoadWindow() {
var manager = scWin.getManager();

if (manager != null) {
scWin.setDocked(scWin.docked);

var frame = scWin.getFrame();
if (frame.style.width == "100%" && frame.style.height == "100%") {
scWin.maximized = true;
scWin.bounds = new scRect(0, 0, frame.ownerDocument.body.offsetWidth * 75 / 100, frame.ownerDocument.body.offsetHeight * 75 / 100);
}
}
}

function scUnloadWindow() {
var manager = scWin.getManager();

if (manager != null) {
manager.unloadWindow(scWin.getID());
}
}

var scWin = new scWindow();
Loading