Skip to content

Commit

Permalink
UJ: Merged from template.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwieds committed Jan 5, 2024
2 parents 59da346 + 627ef25 commit 02bbffe
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 21 deletions.
35 changes: 31 additions & 4 deletions _includes/master/modules/user/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ <h4 class="text-white">Error!</h4>
options.unsaved.parent = options.unsaved.parent || '.dashboard-display-unsaved-popup';

options.createDefaultElements = typeof options.createDefaultElements === 'undefined' ? true : options.createDefaultElements;
options.preventUnsavedNavigation = typeof options.preventUnsavedNavigation === 'undefined' ? true : options.preventUnsavedNavigation;
options.showUnsavedPopup = typeof options.showUnsavedPopup === 'undefined' ? true : options.showUnsavedPopup;
options.checkboxReturnType = typeof options.checkboxReturnType === 'undefined' ? 'object' : options.checkboxReturnType;

self.element.id = select(self.id);

Expand Down Expand Up @@ -261,7 +263,7 @@ <h4 class="text-white">Error!</h4>
$el.removeAttribute('hidden');

try {
var toast = new bootstrap.Toast($el, {})
var toast = new bootstrap.Toast($el, {autohide: false})
toast.show();
} catch (e) {
// console.warn('[Dashboard] Unable to create error toast', e);
Expand Down Expand Up @@ -300,7 +302,9 @@ <h4 class="text-white">Error!</h4>

// Set allow leave
if (['success'].includes(status)) {
self.setAllowLeave(true);
if (self.options.preventUnsavedNavigation) {
self.setAllowLeave(true);
}
}

return self;
Expand Down Expand Up @@ -331,7 +335,7 @@ <h4 class="text-white">Error!</h4>
.forEach(function (el) {
var $el = select(el);
var name = $el.getAttribute('name');
var value = select('#' + $form.id + ' [name="' + name + '"]').getValue();
var value = select('#' + $form.id + ' [name="' + name + '"]').getValue({returnType: self.options.checkboxReturnType});

if (el.tagName === 'BUTTON') {
return;
Expand All @@ -346,6 +350,27 @@ <h4 class="text-white">Error!</h4>
return self._handler.transformData(data);
};

Dashboard.prototype.setFormData = function (settings) {
var self = this;
var data = {};
var $form = self.element.id.get(0);

$form.querySelectorAll(self._inputAndSubmit)
.forEach(function (el) {
var $el = select(el);
var name = $el.getAttribute('name');
var value = get(settings, name);

if (typeof value === 'undefined') {
return;
}

$el.setValue(value);
});

return self._handler.transformData(data);
};

Dashboard.prototype.transformData = function (fn) {
var self = this;

Expand Down Expand Up @@ -403,7 +428,9 @@ <h4 class="text-white">Error!</h4>
self.element.unsaved.parent.removeAttribute('hidden');
}

self.setAllowLeave(false);
if (self.options.preventUnsavedNavigation) {
self.setAllowLeave(false);
}

self.display('ready');

Expand Down
3 changes: 3 additions & 0 deletions _layouts/master/admin/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
enabled: false,
}
},
exitPopup: {
enabled: false,
},
}
"
---
Expand Down
28 changes: 19 additions & 9 deletions _layouts/master/authentication/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<i class="bi-toggle2-on nav-icon"></i> Active Sessions
</a>
</li>
<li class="nav-item">
<li class="nav-item" data-hash-trigger="#deleteAccount" hidden>
<a class="nav-link" href="#deleteAccount">
<i class="bi-trash3 nav-icon"></i> Delete Account
</a>
Expand Down Expand Up @@ -935,7 +935,7 @@ <h4 class="card-header-title"><i class="bi-toggle2-on nav-icon me-1"></i> Active


<!-- Card -->
<div id="deleteAccount" class="card">
<div id="deleteAccount" class="card" data-hash-trigger="#deleteAccount">
<div class="card-header">
<h4 class="card-title"><i class="bi-trash3 nav-icon me-1"></i> Delete Account</h4>
</div>
Expand Down Expand Up @@ -1241,9 +1241,9 @@ <h4 class="mb-0">{name} <span class="connect-account-identity text-muted" data-p
linux: 'https://cdn.itwcreativeworks.com/assets/general/images/brands/color/linux.svg',
}

$authUserProfileImg.setAttribute('onerror', '')
$authUserProfileImg.setAttribute('onerror', '');
$authUserProfileImg.src = gravatar;
$authUserProfileParent.href = 'https://gravatar.com'
$authUserProfileParent.href = 'https://gravatar.com';

// Process
if (!user) {
Expand Down Expand Up @@ -1835,12 +1835,22 @@ <h4 class="mb-0">{name} <span class="connect-account-identity text-muted" data-p
return bootstrap.Tooltip.getOrCreateInstance(tooltipTriggerEl)
})

if (currentURL.hash) {
var hashEl = document.querySelector('*[href="' + currentURL.hash + '"]');
// console.log('---hashEl', currentURL.hash, hashEl);
if (hashEl) {
hashEl.click();
// Handle hash
var $hashBtn = document.querySelector('*[href="' + currentURL.hash + '"]');
var $hashTrigger = select('*[data-hash-trigger]');

// Unhide hash trigger
$hashTrigger.each(function ($el) {
if ($el.getAttribute('data-hash-trigger') === currentURL.hash) {
$el.removeAttribute('hidden');
} else {
$el.setAttribute('hidden', true);
}
})

// Click hash trigger
if ($hashBtn) {
$hashBtn.click();
}

})
Expand Down
6 changes: 3 additions & 3 deletions _layouts/master/placeholder/legal/privacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ In the event of a change of control, if we sell or otherwise transfer part or th
## How We Store Your Information

### Your Choices About Your Information:
Your account information and profile privacy settings can be updated or changed by visitng your account profile at [{{ site.url }}/account]({{ site.url }}/account) or by contacting {{ site.brand.name }} directly at [{{ site.url }}/contact]({{ site.url }}/contact).
- You may request to have your account deleted by visiting your account profile at [{{ site.url }}/account]({{ site.url }}/account)
Your account information and profile privacy settings can be updated or changed by visiting your account profile at [{{ site.url }}/account]({{ site.url }}/account) or by contacting {{ site.brand.name }} directly at [{{ site.url }}/contact]({{ site.url }}/contact).
- You may request to have your account deleted by visiting your account profile at [{{ site.url }}/account]({{ site.url }}/account#deleteAccount)
- You may request to unsubscribe from emails by clicking the "unsubscribe" link inside the email.

## Children’s Privacy:
When it comes to the collection of personal information from children under 13, the Children’s Online Privacy Protection Act (COPPA) puts parents in control. The Federal Trade Commission, the nation’s consumer protection agency enforces the COPPA Rule, which spells out what operators of websites and online services must do to protect children’s privacy and safety online. We do not specifically market to children under 13.

## Request your data to be removed or deleted
If you would like your personally identifiable information to be deleted from our database you can request deletion here: [{{ site.url }}/account]({{ site.url }}/account)
If you would like your personally identifiable information to be deleted from our database you can request deletion here: [{{ site.url }}/account]({{ site.url }}/account#deleteAccount)

## Acceptance of this policy
Use of our site signifies your acceptance of this policy. If you do not accept the policy then please do not use this site. When registering we will further request your explicit acceptance of the privacy policy.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"sharp": "0.23.1 (sometime before 2021ish): Hard lock because later versions had issues. Possibly solved in higher node versions"
},
"devDependencies": {
"@babel/core": "7.23.6",
"@babel/preset-env": "7.23.6",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.7",
"autoprefixer": "9.8.8",
"browser-sync": "2.23.7",
"del": "6.1.1",
Expand All @@ -83,14 +83,14 @@
"require-dir": "1.2.0",
"sharp": "0.23.1",
"source-map-loader": "2.0.2",
"terser-webpack-plugin": "5.3.9",
"terser-webpack-plugin": "^5.3.10",
"through2": "4.0.2",
"ultimate-jekyll-poster": "0.0.15",
"vinyl-named": "1.1.0",
"web-manager": "3.2.30",
"web-manager": "3.2.33",
"webpack": "5.89.0",
"webpack-stream": "6.1.2",
"wonderful-fetch": "1.0.1",
"wonderful-fetch": "^1.1.1",
"yargs": "16.2.0",
"zzzzzzzzzz": "9.9.9"
}
Expand Down

0 comments on commit 02bbffe

Please sign in to comment.