You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
AntonDriemin edited this page Dec 9, 2014
·
8 revisions
Open Social
Preferences
Binary.com Open Social API override common OS prefs/setprefs and allow developer to store widget preferences in the local storage (defined in Scripts/Binary/Binary.OpenSocial.js)
All methods to get preferences reading data from the gadget url (like before), e.g. for mywidget.html?myKey=test
prefs.getString('myKey')//returns 'test'
however, local storage values has higest priority, so
prefs.set("myKey",'new value')prefs.getString('myKey')//returns 'new value' until local storage cleanup, or user remove widget from the dashboard, or prefs.set("myKey", null)
The upper case **ID ** key in the url equals **moduleId **(Open Social gadget identifier), and ID value idendifies the gadget instance on the any dashboard. The ID will have different value for the same gadget, added to the dashboard two times.