Skip to content

Commit e20f282

Browse files
committed
style cleanup
1 parent f52f39b commit e20f282

30 files changed

+555
-1381
lines changed

src/php-error.html

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
const phpVersion = urlParams.get("phpVersion");
1010
if (phpVersion) {
1111
var paragraph = document.getElementById("php-version");
12-
var text = document.createTextNode(
13-
"You are currently running PHP version: " + phpVersion,
14-
);
12+
var text = document.createTextNode("You are currently running PHP version: " + phpVersion);
1513

1614
paragraph.appendChild(text);
1715
}
@@ -36,20 +34,14 @@ <h1 class="heading">500</h1>
3634
<p id="php-version" class="subheading"></p>
3735
<br />
3836
<p class="subheading">
39-
<a
40-
href="https://www.php.net/supported-versions.php"
41-
style="color: red"
37+
<a href="https://www.php.net/supported-versions.php" style="color: red"
4238
>Checkout supported versions of PHP</a
4339
>
4440
</p>
4541
</div>
4642
</div>
4743
<div class="right-section">
48-
<svg
49-
class="svgimg"
50-
xmlns="http://www.w3.org/2000/svg"
51-
viewBox="51.5 -15.288 385 505.565"
52-
>
44+
<svg class="svgimg" xmlns="http://www.w3.org/2000/svg" viewBox="51.5 -15.288 385 505.565">
5345
<g class="bench-legs">
5446
<path
5547
d="M202.778,391.666h11.111v98.611h-11.111V391.666z M370.833,390.277h11.111v100h-11.111V390.277z M183.333,456.944h11.111
@@ -109,18 +101,9 @@ <h1 class="heading">500</h1>
109101
repeatCount="indefinite"
110102
></animate>
111103
</stop>
112-
<stop
113-
offset="100%"
114-
style="stop-color: #ededed; stop-opacity: 0"
115-
/>
104+
<stop offset="100%" style="stop-color: #ededed; stop-opacity: 0" />
116105
</radialGradient>
117-
<circle
118-
class="lamp-light__glow"
119-
fill="url(#SVGID_1_)"
120-
cx="119.676"
121-
cy="44.22"
122-
r="65"
123-
/>
106+
<circle class="lamp-light__glow" fill="url(#SVGID_1_)" cx="119.676" cy="44.22" r="65" />
124107
<path
125108
class="lamp-bottom"
126109
d="M135.417,487.781c0,1.378-1.244,2.496-2.778,2.496H106.25c-1.534,0-2.778-1.118-2.778-2.496v-74.869

src/skin/js/CRMJSOM.js

Lines changed: 36 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ window.CRM.APIRequest = function (options) {
1414
jqXHR.url = settings.url;
1515
};
1616
options.error = function (jqXHR, textStatus, errorThrown) {
17-
window.CRM.system.handlejQAJAXError(
18-
jqXHR,
19-
textStatus,
20-
errorThrown,
21-
options.suppressErrorDialog,
22-
);
17+
window.CRM.system.handlejQAJAXError(jqXHR, textStatus, errorThrown, options.suppressErrorDialog);
2318
};
2419
return $.ajax(options);
2520
};
@@ -36,12 +31,7 @@ window.CRM.DisplayErrorMessage = function (endpoint, error) {
3631
": " +
3732
error.message;
3833
if (error.trace) {
39-
message +=
40-
"</p>" +
41-
i18next.t("Stack Trace") +
42-
": <pre>" +
43-
JSON.stringify(error.trace, undefined, 2) +
44-
"</pre>";
34+
message += "</p>" + i18next.t("Stack Trace") + ": <pre>" + JSON.stringify(error.trace, undefined, 2) + "</pre>";
4535
}
4636
bootbox.alert({
4737
title: i18next.t("ERROR"),
@@ -50,9 +40,7 @@ window.CRM.DisplayErrorMessage = function (endpoint, error) {
5040
};
5141

5242
window.CRM.VerifyThenLoadAPIContent = function (url) {
53-
var error = i18next.t(
54-
"There was a problem retrieving the requested object",
55-
);
43+
var error = i18next.t("There was a problem retrieving the requested object");
5644

5745
// Helper function to fetch error message from JSON response
5846
function fetchErrorMessage(targetUrl, fallbackError, callback) {
@@ -63,8 +51,7 @@ window.CRM.VerifyThenLoadAPIContent = function (url) {
6351
async: false,
6452
dataType: "json",
6553
success: function (data) {
66-
var msg =
67-
data && data.message ? data.message : fallbackError;
54+
var msg = data && data.message ? data.message : fallbackError;
6855
callback(msg);
6956
},
7057
error: function () {
@@ -109,8 +96,7 @@ window.CRM.kiosks = {
10996
window.CRM.APIRequest({
11097
path: "kiosks/" + id + "/reloadKiosk",
11198
method: "POST",
112-
}).done(function (data) {
113-
});
99+
}).done(function (data) {});
114100
},
115101
enableRegistration: function () {
116102
return window.CRM.APIRequest({
@@ -222,27 +208,21 @@ window.CRM.groups = {
222208
throw i18next.t("GroupID required for role selection prompt");
223209
}
224210
initFunction = function () {
225-
window.CRM.groups
226-
.getRoles(selectOptions.GroupID)
227-
.done(function (rdata) {
228-
let rolesList = rdata.map(function (item) {
229-
return {
230-
text: i18next.t(item.OptionName), // to translate the Teacher and Student in localize text
231-
id: item.OptionId,
232-
};
233-
});
234-
$("#targetRoleSelection").select2({
235-
data: rolesList,
236-
dropdownParent: $(".bootbox"),
237-
});
211+
window.CRM.groups.getRoles(selectOptions.GroupID).done(function (rdata) {
212+
let rolesList = rdata.map(function (item) {
213+
return {
214+
text: i18next.t(item.OptionName), // to translate the Teacher and Student in localize text
215+
id: item.OptionId,
216+
};
238217
});
218+
$("#targetRoleSelection").select2({
219+
data: rolesList,
220+
dropdownParent: $(".bootbox"),
221+
});
222+
});
239223
};
240224
}
241-
if (
242-
selectOptions.Type ===
243-
(window.CRM.groups.selectTypes.Group |
244-
window.CRM.groups.selectTypes.Role)
245-
) {
225+
if (selectOptions.Type === (window.CRM.groups.selectTypes.Group | window.CRM.groups.selectTypes.Role)) {
246226
options.title = i18next.t("Select Group and Role");
247227
options.buttons.confirm.callback = function () {
248228
selection = {
@@ -262,34 +242,28 @@ window.CRM.groups = {
262242
id: item.Id,
263243
};
264244
});
265-
$("#targetGroupSelection")
266-
.parents(".bootbox")
267-
.removeAttr("tabindex");
245+
$("#targetGroupSelection").parents(".bootbox").removeAttr("tabindex");
268246
$groupSelect2 = $("#targetGroupSelection").select2({
269247
data: groupsList,
270248
dropdownParent: $(".bootbox"),
271249
});
272250

273251
$groupSelect2.on("select2:select", function (e) {
274-
var targetGroupId = $(
275-
"#targetGroupSelection option:selected",
276-
).val();
252+
var targetGroupId = $("#targetGroupSelection option:selected").val();
277253
$parent = $("#targetRoleSelection").parent();
278254
$("#targetRoleSelection").empty();
279-
window.CRM.groups
280-
.getRoles(targetGroupId)
281-
.done(function (rdata) {
282-
rolesList = rdata.map(function (item) {
283-
return {
284-
text: i18next.t(item.OptionName), // this is for the Teacher and Student role
285-
id: item.OptionId,
286-
};
287-
});
288-
$("#targetRoleSelection").select2({
289-
data: rolesList,
290-
dropdownParent: $(".bootbox"),
291-
});
255+
window.CRM.groups.getRoles(targetGroupId).done(function (rdata) {
256+
rolesList = rdata.map(function (item) {
257+
return {
258+
text: i18next.t(item.OptionName), // this is for the Teacher and Student role
259+
id: item.OptionId,
260+
};
292261
});
262+
$("#targetRoleSelection").select2({
263+
data: rolesList,
264+
dropdownParent: $(".bootbox"),
265+
});
266+
});
293267
});
294268
});
295269
},
@@ -358,17 +332,9 @@ window.CRM.system = {
358332
suppressErrorDialog: true,
359333
});
360334
},
361-
handlejQAJAXError: function (
362-
jqXHR,
363-
textStatus,
364-
errorThrown,
365-
suppressErrorDialog,
366-
) {
335+
handlejQAJAXError: function (jqXHR, textStatus, errorThrown, suppressErrorDialog) {
367336
if (jqXHR.status === 401) {
368-
window.location =
369-
window.CRM.root +
370-
"/session/begin?location=" +
371-
window.location.pathname;
337+
window.location = window.CRM.root + "/session/begin?location=" + window.location.pathname;
372338
}
373339
try {
374340
var CRMResponse = JSON.parse(jqXHR.responseText);
@@ -392,18 +358,14 @@ window.CRM.dashboard = {
392358
renderers: {
393359
EventsCounters: function (data) {
394360
if (document.getElementById("BirthdateNumber") != null) {
395-
document.getElementById("BirthdateNumber").innerText =
396-
data.Birthdays;
397-
document.getElementById("AnniversaryNumber").innerText =
398-
data.Anniversaries;
361+
document.getElementById("BirthdateNumber").innerText = data.Birthdays;
362+
document.getElementById("AnniversaryNumber").innerText = data.Anniversaries;
399363
document.getElementById("EventsNumber").innerText = data.Events;
400364
}
401365
},
402366
PageLocale: function (data) {
403367
$(".fi").addClass("fi-" + data.countryFlagCode);
404-
$("#translationInfo").html(
405-
data.name + " [" + window.CRM.locale + "]",
406-
);
368+
$("#translationInfo").html(data.name + " [" + window.CRM.locale + "]");
407369
if (data.displayPerCompleted && data.poPerComplete < 90) {
408370
$("#translationPer").html(data.poPerComplete + "%");
409371
$("#localePer").removeClass("hidden");
@@ -414,10 +376,7 @@ window.CRM.dashboard = {
414376
window.CRM.APIRequest({
415377
method: "GET",
416378
path:
417-
"background/page?token=" +
418-
Math.random() +
419-
"&name=" +
420-
window.CRM.PageName.replace(window.CRM.root, ""),
379+
"background/page?token=" + Math.random() + "&name=" + window.CRM.PageName.replace(window.CRM.root, ""),
421380
suppressErrorDialog: true,
422381
}).done(function (data) {
423382
for (var key in data) {

0 commit comments

Comments
 (0)