File size: 1,875 Bytes
b285804
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
let converter = () => {                                  
    let location = document.getElementById("location-input").value; // get the location input                                   
    encodedLocation = encode('location'); // encode the location                                                                               
    let bookRoomWallShelfBookPage = encodedLocation.split("."); // split the location into its components (we only care about the first 5)                                   
    let book = bookRoomWallShelfBookPage[0];                                   
    let room = bookRoomWallShelfBookPage[1];                                   
    let wall = bookRoomWallShelfBookPage[2];                                   
    let shelf = bookRoomWallShelfBookPage[3];                                   
    let page = bookRoomWallShelfBookPage[4];                                   
    let bookIndex = getBookIndex(book, room, wall, shelf);                                   
    console.log("bookIndex:", bookIndex);                                                                                                         
    let pages = getBookPages(bookIndex);                                   
    console.log("pages:", pages);                                   
    let roomIndex = getRoomIndex(room);                                   
    console.log("roomIndex:", roomIndex);                                   
    let shelfIndex = getShelfIndex(shelf);                                   
    console.log("shelfIndex:", shelfIndex);                                   
    let wallIndex = getWallIndex(wall);                                   
    console.log("wallIndex:", wallIndex);                                   
};                                   

const encode = (string) = https/stackoverflow.com/ sendo# so- 203294.1352949#ACT=1)