client_scripts
Differences
This shows you the differences between two versions of the page.
| client_scripts [12/30/2024 05:42] – created johnsonjohn | client_scripts [12/31/2025 05:40] (current) – removed johnsonjohn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======Client Scripts====== | ||
| - | |||
| - | =====Variable Field read_only FALSE===== | ||
| - | < | ||
| - | g_form.setReadOnly(' | ||
| - | </ | ||
| - | |||
| - | ----- | ||
| - | =====Incident===== | ||
| - | ====Assigned to/ | ||
| - | < | ||
| - | function onChange(control, | ||
| - | if (isLoading || newValue === '' | ||
| - | | ||
| - | } | ||
| - | |||
| - | //Type appropriate comment here, and begin script below | ||
| - | if (newValue != oldValue) { | ||
| - | | ||
| - | | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | ====Hightlight Caller==== | ||
| - | < | ||
| - | function onChange(control, | ||
| - | var callerLabel = $(' | ||
| - | var callerField = $(' | ||
| - | if (!callerLabel || !callerField) | ||
| - | return; | ||
| - | |||
| - | if (!newValue) { | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | return; | ||
| - | } | ||
| - | g_form.getReference(' | ||
| - | } | ||
| - | |||
| - | function vipCallerCallback(caller) { | ||
| - | var callerLabel = $(' | ||
| - | var callerField = $(' | ||
| - | if (!callerLabel || !callerField) | ||
| - | return; | ||
| - | |||
| - | // define VIP flag position | ||
| - | var bgPosition = "95% 55%"; | ||
| - | //If VIP and authorized security requester, set flag and mark purple | ||
| - | if ((caller.vip == ' | ||
| - | if (document.documentElement.getAttribute(' | ||
| - | bgPosition = "5% 45%"; | ||
| - | |||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | // If only VIP, set flag and mark red | ||
| - | else if (caller.vip == ' | ||
| - | if (document.documentElement.getAttribute(' | ||
| - | bgPosition = "5% 45%"; | ||
| - | |||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | // If provider and authorized security requester, mark purple | ||
| - | else if ((caller.u_snow_providers_group_member == ' | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | // If only provider, mark red | ||
| - | else if (caller.u_snow_providers_group_member == ' | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | //check for Authorized Security Request status, and make sure they' | ||
| - | //VIP supercedes ASR | ||
| - | else if ((caller.u_authorized_security_requester == ' | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | else { | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | ====onChange Caller Email is Empty==== | ||
| - | < | ||
| - | function onChange(control, | ||
| - | if (isLoading || newValue === '' | ||
| - | | ||
| - | } | ||
| - | |||
| - | var callerDetails = g_form.getReference(' | ||
| - | |||
| - | | ||
| - | if (callerDetails.email == '' | ||
| - | | ||
| - | | ||
| - | } else { | ||
| - | | ||
| - | } | ||
| - | } | ||
| - | | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | ====onLoad Caller Email is Empty==== | ||
| - | < | ||
| - | function onLoad() { | ||
| - | //Type appropriate comment here, and begin script below | ||
| - | var callerDetails = g_form.getReference(' | ||
| - | |||
| - | | ||
| - | if (callerDetails.email == '' | ||
| - | | ||
| - | } | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | =====Sys_User===== | ||
| - | ====Example==== | ||
| - | < | ||
| - | function onChange(control, | ||
| - | var callerLabel = $(' | ||
| - | var callerField = $(' | ||
| - | if (!callerLabel || !callerField) | ||
| - | return; | ||
| - | |||
| - | if (!newValue) { | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | return; | ||
| - | } | ||
| - | g_form.getReference(' | ||
| - | } | ||
| - | |||
| - | function vipCallerCallback(caller) { | ||
| - | var callerLabel = $(' | ||
| - | var callerField = $(' | ||
| - | if (!callerLabel || !callerField) | ||
| - | return; | ||
| - | |||
| - | //check for VIP & WFH status | ||
| - | var bgPosition = "95% 55%"; | ||
| - | if (document.documentElement.getAttribute(' | ||
| - | bgPosition = "5% 45%"; | ||
| - | } | ||
| - | |||
| - | if (caller.vip == ' | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } else if (caller.u_wfh == ' | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } else { | ||
| - | callerLabel.setStyle({backgroundImage: | ||
| - | callerField.setStyle({color: | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
| - | |||
| - | =====Tasks===== | ||
| - | ====Hide empty variables==== | ||
| - | < | ||
| - | function onLoad() { | ||
| - | //Hide all empty variables using the scratchpad object passed from 'Hide Empty Variables' | ||
| - | if(g_scratchpad.emptyVars != '' | ||
| - | var emptyVars = g_scratchpad.emptyVars.split(',' | ||
| - | for(i = 0; i < emptyVars.length; | ||
| - | g_form.setDisplay(' | ||
| - | } | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ---- | ||
client_scripts.1735566173.txt.gz · Last modified: by johnsonjohn
