1function ChangePassword() { 2 var newurl = window.location.protocol + "//" + window.location.host + "/AlliedPilots/Account/ChangePassword"; 3 $.ajax({ 4 type: "POST", 5 data: {}, 6 dataType: 'text', 7 url: newurl, 8 success: function (response) { 9 window.location.href = response; 10 }, 11 error: function (data) { 12 console.log(response); 13 console.log('error:' + data); 14 } 15 }); 16} 17 18function CancelPasswordChange() { 19 $('#signout-modal').modal('hide'); 20} 21 22function extendtoogleclick() { 23 var currentstate = !$("#tools-checkbox").prop("checked"); 24 var widgetAction = false; 25 if (currentstate) { 26 document.documentElement.style.setProperty("--widget-access", "flex"); 27 widgetAction = false; 28 $("#tools-checkbox").prop("checked", true); 29 } else { 30 document.documentElement.style.setProperty("--widget-access", "none"); 31 widgetAction = true; 32 $("#tools-checkbox").prop("checked", false); 33 } 34 this.model = JSON.parse(readCookie("UserPreferencesCookie")); 35 this.request = PreferencesPostModel(); 36 this.request.Home.HideHomeTools = widgetAction; 37 postPrefs(); 38} 39 40function readCookie(key) { 41 var result; 42 return (result = new RegExp( 43 "(?:^|; )" + encodeURIComponent(key) + "=([^;]*)" 44 ).exec(document.cookie)) 45 ? result[1] 46 : null; 47} 48 49function postPrefs(storeToDB = true) { 50 $.ajax({
51 url: "/AlliedPilots/PostUserPrefs/PostPrefs", 52 datatype: "json", 53 type: "POST", 54 contentType: "application/json; charset=utf-8", 55 data: JSON.stringify({ 56 model: { storeToDatabase: storeToDB, dbPreferencesModel: this.request }, 57 }), 58 async: true, 59 processData: false, 60 cache: false, 61 62 success: function (Data) { 63 var cusid = Data; 64 $(".widget-icons").removeClass("race-block"); 65 $("#iconZoomSelector").removeClass("race-block"); 66 launchToast("Setting saved", "task_alt", "green"); 67 }, 68 error: function (xhr) { 69 $(".widget-icons").removeClass("race-block"); 70 $("#iconZoomSelector").removeClass("race-block"); 71 launchToast("Error: Setting not saved", "warning", "red"); 72 return null; 73 }, 74 error: function (exception) { 75 $(".widget-icons").removeClass("race-block"); 76 $("#iconZoomSelector").removeClass("race-block"); 77 launchToast("Error: Setting not saved", "error", "red"); 78 console.log("Ooops", "Exeption:" + exception.responseJSON, "error"); 79 }, 80 }); 81} 82 83function PreferencesPostModel() { 84 if (this.model) { 85 var userName = this.model.userName; 86 var home = { 87 HomeImageId: this.model.home.homeImageId, 88 HideHomeTools: this.model.home.hideHomeTools, 89 BookmarkedToolsIds: this.model.home.bookmarkedToolsIds, 90 IconZoomLevel: this.model.home.iconZoomLevel 91 }; 92 var universal = { 93 MenuDisplayOption: this.model.universal.menuDisplayOption, 94 IsMenuMinified: this.model.universal.isMenuMinified, 95 IsMenuOpen: this.model.universal.isMenuOpen, 96 ThemeColor: this.model.universal.themeColor, 97 DarkMode: this.model.universal.darkMode, 98 Avatar: this.model.universal.avatar, 99 }; 100 var notifications = { 101 ReceiveNotifications: this.model.notifications.receiveNotifications, 102 }; 103 var preferences = { 104 HomeCommitteePage: this.model.preferences.homeCommitteePage, 105 }; 106 107 return { 108 UserName: userName, 109 Home: home, 110 Universal: universal, 111 Notifications: notifications, 112 Preferences: preferences, 113 }; 114 } 115} 116 117function launchToast(title, icon, bgColor) { 118 var x = document.getElementById("toast"); 119 var p = $("#toast p"); 120 var span = $("#toast span"); 121 var bg = $("#toast #img"); 122 x.className = "show"; 123 p.html(title); 124 span.html(icon); 125 bg.css({ "background-color": bgColor }); 126 setTimeout(function () { 127 x.className = x.className.replace("show", ""); 128 }, 3000); 129}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.