HTML and CSS Reference
In-Depth Information
if (window.localStorage) {
initialized = true;
successCallback(null);
} else {
errorCallback('storage_api_not_supported', 'The web storage api is not supported');
}
},
initObjectStore : function(type, successCallback, errorCallback) {
if (!initialized) {
errorCallback('storage_api_not_initialized', 'The storage engine has not been initialized');
} else if (!localStorage.getItem(type)) {
localStorage.setItem(type, JSON.stringify({}));
}
initializedObjectStores[type] = true;
successCallback(null);
},
save : function(type, obj, successCallback, errorCallback) {
},
findAll : function(type, successCallback, errorCallback) {
},
delete : function(type, id, successCallback, errorCallback) {
},
findByProperty : function(type, propertyName, propertyValue, successCallback, errorCallback) {
},
findById : function (type, id, successCallback, errorCallback)
{
}
}
}();
Like the tasksController , this controller implicitly creates a new object. The object in this
case will be stored in a global variable called storageEngine .
The initial implementation above contains an implementation of the init and initOb-
jectStore methods. Technically the Web storage implementation does not need the init
method, since there is nothing that specifically needs initializing in order to use the loc-
Search WWH ::




Custom Search