Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This widget overrides the page context 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");
- 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] == 'groupnumber'){passedgroupnumber = iframeargsmatrix[j][1];break;}}
- 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] == 'GroupID'){parentgroupnumber = argsmatrix[j][1];}}
- if(ispageexplicit){
- if(passedgroupnumber != 0){
- helpdiv.innerHTML = 'You have specified the GroupID ' + 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 path to the default group.';
- if (parentgroupnumber == 0){parent.document.location=parent.document.location.href + '&GroupID=' + passedgroupnumber;}}
- else {
- var helptext = 'You have not specified a group number within the browser view\'s target URL.'
- if (parentgroupnumber == 0){helptext = helptext + ' If you don\'t know what GroupID to use, click the \'[change]\' link at the top of this page and select a group. When the page refreshes, you will see updated instructions.';helpdiv.innerHTML = helptext;}
- else {helptext += ' If you would like to set the currently selected group as the default page context for this page, change the browser view\'s target URL by adding the following:<br />' + '?groupnumber=' + parentgroupnumber ;helpdiv.innerHTML = helptext;}
- }}
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement