Skip to content

Commit ca75b70

Browse files
authored
Create UIscript.js
1 parent 2e69ad4 commit ca75b70

File tree

1 file changed

+20
-0
lines changed
  • Client-Side Components/UI Scripts/User acknowledgement Using UI script and user preferences

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
addLoadEvent(function() {
2+
try {
3+
// Skip contexts where GlideDialogWindow isn't available (e.g., Service Portal)
4+
if (typeof GlideDialogWindow === 'undefined' || (window.NOW && NOW.sp))
5+
return;
6+
var prefName = 'login.consent1';
7+
// Only show the dialog when the pref is explicitly 'false'
8+
var val = (typeof getPreference === 'function') ? getPreference(prefName) : null;
9+
var shouldShow = String(val || '').toLowerCase() === 'false';
10+
//alert("val"+" "+val+" "+"shouldShow"+" "+shouldShow);
11+
if (!shouldShow)
12+
return;
13+
var dialog = new GlideDialogWindow('acknowledgement_dialog'); // UI Page name
14+
dialog.setTitle('Acknowledge Message');
15+
dialog.setSize(500, 300);
16+
dialog.render();
17+
} catch (e) {
18+
if (console && console.warn) console.warn('ack loader error', e);
19+
}
20+
});

0 commit comments

Comments
 (0)