Commit b4e15307 authored by Jake Mylet's avatar Jake Mylet

Update and removed inline comments from JS as function and details of code is...

Update and removed inline comments from JS as function and details of code is present in documentation. Added and should be pretty well complete with Global scope documentation.
parent 1076cb02
(function() {
var url = document.URL;
if (url.search("Login") != -1)
return 0;
else if (url.search("Setup") != -1)
......
......@@ -2,11 +2,15 @@
The JS function specified below is run on every page.
#### [WhatPage.js](../WAMI/WAMI/WhatPage.js)
Will determine what page, and therefore the step in the inventory process currently at. This is accomplished by obtaining the URL from the page and search for certain strings in the URL to determine what page the script executes on.
Will determine what page, and therefore the step in the inventory process currently at. This is accomplished by obtaining the URL from the page and search for certain strings in the URL to determine what page the script executes on.
From the URL property of the document object, retrieve the address of the page.
```javascript
var url = document.URL;
```
Use the string search function to determine if there is a certain substring present. This function will return the index of the beginning substring if found or -1 if not present.
```javascript
if (url.search("Login") != -1)
return 0;
else if (url.search("Setup") != -1)
......@@ -17,4 +21,11 @@ else if (url.search("Action") != -1)
return 3;
else
return -1;
```
\ No newline at end of file
```
Function will return 0 through 3 depending upon the step of the inventory process based off of the number of the step in the process or -1 if not on an RTI page.
1. Login Page
2. Setup Page
3. Scan Page
4. Action (i.e. Scan Error) page
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment