Resolved merge conflict

dev
Gregory Pike 11 years ago
commit 199031e798

@ -52,10 +52,28 @@
}
};
// Directly adds a value to local storage
// If local storage is not available in the browser use cookies
// Example use: localStorageService.add('library','angular');
var addToLocalStorage = function (key, value) {
// Checks the browser to see if local storage is supported
var browserSupportsLocalStorage = function () {
try {
var supported = ('localStorage' in window && window['localStorage'] !== null);
// When Safari (OS X or iOS) is in private browsing mode, it appears as though localStorage
// is available, but trying to call .setItem throws an exception.
//
// "QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage
// that exceeded the quota."
var key = prefix + '__' + Math.round(Math.random() * 1e7);
if (supported) {
localStorage.setItem(key, '');
localStorage.removeItem(key);
}
return true;
} catch (e) {
$rootScope.$broadcast('LocalStorageModule.notification.error',e.message);
return false;
}
};
// If this browser does not support local storage use cookies
if (!browserSupportsLocalStorage()) {

@ -1,6 +1,6 @@
{
"name": "angular-local-storage",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "http://gregpike.net/demos/angular-local-storage/demo.html",
"authors": [
"grevory <greg@gregpike.ca>"
@ -21,6 +21,6 @@
],
"devDependencies": {
"angularjs": "*",
"angular-mocks": "~1.0.8"
"angular-mocks": "~1.2.1"
}
}

@ -1,6 +1,6 @@
{
"name": "angular-local-storage",
"version": "0.0.1",
"version": "0.0.2",
"description": "An Angular module that gives you access to the browsers local storage",
"main": "angular-local-storage.js",
"scripts": {