Permalink
Browse files

Issue #18 - ie js error fix

  • Loading branch information...
simsalabim committed Feb 13, 2012
1 parent 005e4f2 commit 877b12a814280fe4a32d2bf8f38548895ad09709
Showing with 64 additions and 64 deletions.
  1. +63 −63 sisyphus.js
  2. +1 −1 sisyphus.min.js
View
@@ -18,74 +18,74 @@
return sisyphus;
};
- browserStorage = {};
+ var browserStorage = {};
/**
- * Check if local storage or other browser storage is available
- *
- * @return Boolean
- */
- browserStorage.isAvailable = function() {
- if ( typeof $.jStorage === "object" ) {
- return true;
- }
- try {
- return localStorage.getItem;
- } catch ( e ) {
- return false;
- }
- }
+ * Check if local storage or other browser storage is available
+ *
+ * @return Boolean
+ */
+ browserStorage.isAvailable = function() {
+ if ( typeof $.jStorage === "object" ) {
+ return true;
+ }
+ try {
+ return localStorage.getItem;
+ } catch ( e ) {
+ return false;
+ }
+ }
/**
- * Set data to browser storage
- *
- * @param [String] key
- * @param [String] value
- *
- * @return Boolean
- */
- browserStorage.set = function( key, value ) {
- if ( typeof $.jStorage === "object" ) {
- $.jStorage.set( key, value + "" )
- } else {
- try {
- localStorage.setItem( key, value + "" );
- } catch (e) {
- //QUOTA_EXCEEDED_ERR
- }
- }
- }
+ * Set data to browser storage
+ *
+ * @param [String] key
+ * @param [String] value
+ *
+ * @return Boolean
+ */
+ browserStorage.set = function( key, value ) {
+ if ( typeof $.jStorage === "object" ) {
+ $.jStorage.set( key, value + "" )
+ } else {
+ try {
+ localStorage.setItem( key, value + "" );
+ } catch (e) {
+ //QUOTA_EXCEEDED_ERR
+ }
+ }
+ }
- /**
- * Get data from browser storage by specified key
- *
- * @param [String] key
- *
- * @return string
- */
- browserStorage.get = function( key ) {
- if ( typeof $.jStorage === "object" ) {
- var result = $.jStorage.get( key );
- return result ? result.toString() : result;
- } else {
- return localStorage.getItem( key )
- }
- }
+ /**
+ * Get data from browser storage by specified key
+ *
+ * @param [String] key
+ *
+ * @return string
+ */
+ browserStorage.get = function( key ) {
+ if ( typeof $.jStorage === "object" ) {
+ var result = $.jStorage.get( key );
+ return result ? result.toString() : result;
+ } else {
+ return localStorage.getItem( key )
+ }
+ }
- /**
- * Delete data from browser storage by specified key
- *
- * @param [String] key
- *
- * @return void
- */
- browserStorage.delete = function( key ) {
- if ( typeof $.jStorage === "object" ) {
- $.jStorage.deleteKey( key );
- } else {
- localStorage.removeItem( key );
- }
- }
+ /**
+ * Delete data from browser storage by specified key
+ *
+ * @param [String] key
+ *
+ * @return void
+ */
+ browserStorage.remove = function( key ) {
+ if ( typeof $.jStorage === "object" ) {
+ $.jStorage.deleteKey( key );
+ } else {
+ localStorage.removeItem( key );
+ }
+ }
Sisyphus = ( function() {
var params = {
@@ -434,7 +434,7 @@
}
var field = $( this );
var prefix = self.href + targetFormId + field.attr( "name" ) + self.options.customKeyPrefix;
- self.browserStorage.delete( prefix )
+ self.browserStorage.remove( prefix )
released = true;
} );
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 877b12a

Please sign in to comment.