Guide (Help Center) coding genius assistance needed!

Answered

4 Comments

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member of The Year - 2021

    Hey Budke, John,

    Try the given code, hope it worked for you.

    I tried it on Copenhagen Theme. 

     

    i). new_request_page.hbs, remove 'onload' event from the body tag. 

     

     

    ii). style.css file, same code as you have.

     

     

    iii). script.js file, you need to use the code below which I shared.

     

     

    Code:

    if (window.location.href.indexOf("requests/new") > -1) {
    function CustomAlert() {
     this.render = function(dialog) {
            var winW = window.innerWidth;
            var winH = window.innerHeight;
            var dialogoverlay = document.getElementById('dialogoverlay');
            var dialogbox = document.getElementById('dialogbox');
            dialogoverlay.style.display = "block";
            dialogoverlay.style.height = winH+"px";
            dialogbox.style.left = (winW/2) - (550 * .5)+"px";
            dialogbox.style.top = "100px";
            dialogbox.style.display = "block";
            document.getElementById('dialogboxhead').innerHTML = "NOTICE - please read!";
            document.getElementById('dialogboxbody').innerHTML = dialog;
            document.getElementById('dialogboxfoot').innerHTML = '<button onclick="Alert.ok()">OK</button>';
        
      this.ok = function(){
      document.getElementById('dialogbox').style.display = "none";
      document.getElementById('dialogoverlay').style.display = "none";
      }
     } 
    }

     if (window.location.href.indexOf("?ticket_form_id") < 1) {
      var Alert = new CustomAlert(); 
       window.onload = function() {
         Alert.render('If the request you want to submit is not listed as an option please contact a supervisor for triage and action. Additional reporting channels are available to them. (Examples include MDT, OA, intra/internet, console furniture, etc.)')
       };
      }else{
      console.log('Disable function');
      }
     }

     

     

     

    It's working for me as you want. If any issue let me know :)

     

    Thanks

    Team

    0
  • Budke, John

    Hi Ifra: THANK YOU! Works perfectly! One question, if I may...how do I change the box position? It's at the very top immediately below the header. I'd like to move it down to be more readable.

     

    0
  • Budke, John

    I figured out the screen positioning.  Thanks again for your help, everything great now.

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member of The Year - 2021

    Glad to hear that it's working for you :)

    0

Please sign in to leave a comment.

Powered by Zendesk