The webPages Flow:
Google Feature Used:
- Using the Tabs Feature in order to display each webPage in a new Tab.
- Using the PubSub Feature in order to listen to published messages, and act accordingly.
The function is called on load of the page.
It builds all the static tabs(usefull links, libarary and map). Goes over all saved webPages and UserPages in the userPrefs and add a new tab for each one of them.
- course.name : the name of the tab
- course.data : the URL
The Function adds a tab to the gadet according to the data in course.
The Function is called every time a message is recieved.
If the messae is a delete message it calls removeTabByNum with the num recieved in the message, and DeleteSite to remove it from the UserPrefs.
if not, it checks if the data string begins with "http", and if so it process it and call addNewTab. it also update the userPref and save them.
This Function is called when the add Button is pressed. It adds a site according to the information in the 2 inputs "siteUrl" & "siteName".
It Uses addNewTab for that. it also saves the new information in the userPrefs.
The function delete a tab from the gadget using the serial number of the course, ehich is passed in num parameter.
It seeks the tab with matching name to the course name stored in the pref.
in IE the tab name is added with some spaces by google so the function strip it from the spaces and then compare.
The Function is called when the remove button is pressed. It delete the currentlly selected tab from the gadget.
It also search it in the userPref(both the "yedion" sites & user sites), and delete it from there.
It faces the same problem with IE and uses the same manipulation to solve it.
remove from the "yedion" added sites userPref the userPref in "num" index.Save the new userPref.
remove from the user added sites userPref the userPref in "num" index.Save the new userPref.
Saves the UserPref storing the "yedion" added sites.
Saves the UserPref storing the user added sites.
This functions are called when a tab is selected. this is done by issuing a callback function to every tab. if a static tab was selected we call hideButton. if a dinamiclly added tab is called we call showButton.
the purpouse of these functions is to show and hide the remove button to prevent users from deleting the static tabs.
This is done by changing the visibility property of the butto object.