Software: Microsoft-IIS/10.0. PHP/7.4.33 uname -a: Windows NT LAKE 10.0 build 20348 (Windows Server 2016) AMD64 IWPD_801(traduongco) Safe-mode: OFF (not secure) C:\Windows\SystemApps\Microsoft.Windows.CloudExperienceHost_cw5n1h2txyewy\webapps\inclusiveOobe\js\ drwxrwxrwx | |
| Viewing file: Select action/file-type: //
// Copyright (C) Microsoft. All rights reserved.
//
define(["lib/knockout", 'legacy/bridge', 'legacy/events', 'legacy/core', 'corejs/knockouthelpers'], (ko, bridge, constants, core, KoHelpers) => {
class OobeSettingsData {
// Takes in a list of settings and commits them, then logs associated telemetry and completes the webapp
commitSettings(settings, privacyConsentPresentationVersion) {
try {
// Show the progress ring while committing async.
bridge.fireEvent(CloudExperienceHost.Events.showProgressWhenPageIsBusy);
bridge.invoke("CloudExperienceHost.UserManager.getUserId").then((userId) => {
let userObj = null;
if (userId) {
userObj = Windows.System.User.getFromId(userId);
}
this.commitSettingsForUser(userObj, settings, privacyConsentPresentationVersion);
}, (err) => {
this.commitSettingsForUser(null, settings, privacyConsentPresentationVersion);
});
}
catch (err) {
bridge.invoke("CloudExperienceHost.Telemetry.logEvent", "CommitSettingsFailure", core.GetJsonFromError(err));
bridge.fireEvent(constants.Events.done, constants.AppResult.error);
}
}
commitSettingsForUser(userObj, settings, privacyConsentPresentationVersion) {
CloudExperienceHostAPI.OobeSettingsStaticsCore.commitSettingsAsyncForUser(userObj, settings, privacyConsentPresentationVersion).done(function () {
for (let setting of settings) {
bridge.invoke("CloudExperienceHost.Telemetry.logEvent", setting.canonicalName, setting.value);
}
bridge.fireEvent(constants.Events.done, constants.AppResult.success);
},
function (err) {
bridge.invoke("CloudExperienceHost.Telemetry.logEvent", "CommitSettingsAsyncWorkerFailure", core.GetJsonFromError(err));
bridge.fireEvent(constants.Events.done, constants.AppResult.error);
});
}
initializeLearnMoreContentAsync() {
return CloudExperienceHostAPI.OobeSettingsManagerStaticsCore.getLearnMorePlainTextAsync().then((result) => {
if (CloudExperienceHostAPI.FeatureStaging.isOobeFeatureEnabled("OobePrivacySettingsHtmlLearnMore")) {
this.learnMoreContent = result;
}
else {
let msHtmlStringBody = result.replace(/\r/g, "</p><p>");
let msHtmlString = "<html><head><link href=\"/webapps/inclusiveOobe/css/inclusive-mseula.css\" rel=\"stylesheet\"></head><body><p>" + msHtmlStringBody + "</p></body></html>";
this.learnMoreContent = msHtmlString;
}
});
}
getLearnMoreContent() {
return this.learnMoreContent;
}
updateLearnMoreContentForRender(doc, dirVal, isInternetAvailable, errorMessage, targetPersonality, elementToAnchor) {
let cssOverride = "";
if (targetPersonality === CloudExperienceHost.TargetPersonality.InclusiveBlue) {
cssOverride = "/webapps/inclusiveOobe/css/inclusive-mseula.css";
}
else if (targetPersonality === CloudExperienceHost.TargetPersonality.LiteWhite) {
cssOverride = "/webapps/inclusiveOobe/css/light-iframe-content.css";
}
if (cssOverride && (cssOverride !== "") && CloudExperienceHostAPI.FeatureStaging.isOobeFeatureEnabled("OobePrivacySettingsHtmlLearnMore")) {
let fileRef = doc.head.ownerDocument.createElement("link");
fileRef.setAttribute("rel", "stylesheet");
fileRef.setAttribute("href", cssOverride);
if (elementToAnchor) {
// If we're overriding CSS and elementToAnchor is provided (e.g. in the Multi-page OOBE privacy settings scenario),
// only anchor the Learn More content to that element once the stylesheet has loaded
fileRef.onload = function() {
doc.location.href = "#" + elementToAnchor;
}
}
doc.head.appendChild(fileRef);
}
else if (elementToAnchor) {
// If we're not overriding CSS and elementToAnchor is provided, anchor the Learn More content to that element right away
doc.location.href = "#" + elementToAnchor;
}
let privacyLinks = doc.querySelectorAll("a");
for (let i = 0; i < privacyLinks.length; i++) {
let link = privacyLinks[i];
link.onclick = (e) => {
if (isInternetAvailable) {
// Styling on the local resource html content is managed by applying cssOverride, but the deep-linked server-side Privacy content
// is statically hosted with its own styles. It is TargetPersonality.InclusiveBlue by default (the initial existing personality)
// and supports other personalities via QueryString "profile" argument.
// Profile values must match the server-side value set.
let personalityQSParam = (targetPersonality === CloudExperienceHost.TargetPersonality.LiteWhite) ? "&profile=transparentLight" : "";
let url = e.target.href + personalityQSParam;
WinJS.xhr({ url: url }).then((response) => {
doc.location.href = url;
}, (error) => {
let html = "<html><head>";
if (cssOverride && (cssOverride !== "")) {
html = html + "<link href=\"" + cssOverride + "\" rel=\"stylesheet\">";
}
html = html + "</head><body><p>" + errorMessage + "</p></body></html>";
KoHelpers.loadIframeContent(doc, { content: html, dir: dirVal });
});
e.preventDefault();
}
else {
let innerHTML = "<html><head>";
if (cssOverride && (cssOverride !== "")) {
innerHTML = innerHTML + "<link href=\"" + cssOverride + "\" rel=\"stylesheet\">";
}
innerHTML = innerHTML + "</head><body><p>" + errorMessage + "</p></body></html>";
doc.body.innerHTML = innerHTML;
e.preventDefault();
}
};
}
}
}
return new OobeSettingsData();
});
|
:: Command execute :: | |
--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.6504 ]-- |