Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This widget overrides the rtt type of this page whenever a group hasn't been manually specified.<div id="help"></div>
- <script>
- var passedgroupnumber = 0;
- var parentgroupnumber = 0;
- var ispageexplicit=false;
- var helpdiv = document.getElementById("help");
- //get the iframe url RttTypes value and store in RttTypes (if passed)
- var iframeurl=location.search;
- iframeurl=iframeurl.replace('?','');
- var iframeargsarray=iframeurl.split('&');
- var iframeargsmatrix = new Array(iframeargsarray.length);
- for (var i = 0; i < iframeargsarray.length; i++){
- iframeargsmatrix[i] = new Array(2);iframeargsmatrix[i] = iframeargsarray[i].split('=');}
- for (var j=0; j < iframeargsmatrix.length; j++){
- if(iframeargsmatrix[j][0] == 'RttTypes'){passedgroupnumber = iframeargsmatrix[j][1];break;}}
- //passedgroupnumber contains the iframe's group. If 0, no RttTypes was passed.
- //get the parent url parameters
- var parenturl=parent.document.location.search;
- parenturl=parenturl.replace('?','');
- var argsarray=parenturl.split('&');
- var argsmatrix = new Array(argsarray.length);
- for (var i = 0; i < argsarray.length; i++){argsmatrix[i] = new Array(2);argsmatrix[i] = argsarray[i].split('=');}
- for (var j = 0; j < argsmatrix.length; j++){
- if (argsmatrix[j][0] == 'pg'){ispageexplicit=true;}
- if (argsmatrix[j][0] == 'RttTypes'){parentgroupnumber = argsmatrix[j][1];}}
- //parentgroupnumber contains the parent url's group. If 0, no group was specified.
- if(ispageexplicit){
- if(passedgroupnumber != 0){
- helpdiv.innerHTML = 'You have specified the RttTypes ' + passedgroupnumber + '. <br />Now edit this view and set the height to 0 to maximize available screen real estate. You should probably change the title of the browser view so that it indicates the default RttTypes.';
- if (parentgroupnumber == 0){parent.document.location=parent.document.location.href + '&RttTypes=' + passedgroupnumber;}}
- else {
- var helptext = 'You have not specified a RttTypes within the browser view\'s target URL.'
- if (parentgroupnumber == 0){helptext = helptext + ' If you don\'t know what RttTypes to use, click the IP SLA Operations Types dropdown box at the top of this page and select a type. When the page refreshes, you will see updated instructions.';helpdiv.innerHTML = helptext;}
- else {helptext += ' If you would like to set the currently selected RttTypes as the default RttTypes for this page, change the browser view\'s target URL to the following:<br />' + '../content/defaultgroup.html?RttTypes=' + parentgroupnumber ;helpdiv.innerHTML = helptext;}
- }}
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement