diff --git a/assets/javascripts/app/db.coffee b/assets/javascripts/app/db.coffee index be99699e..4b67c6b7 100644 --- a/assets/javascripts/app/db.coffee +++ b/assets/javascripts/app/db.coffee @@ -3,6 +3,7 @@ class app.DB VERSION = 15 constructor: -> + @versionMultipler = if $.isIE() then 1e5 else 1e9 @useIndexedDB = @useIndexedDB() @callbacks = [] @@ -13,12 +14,12 @@ class app.DB try @open = true - req = indexedDB.open(NAME, VERSION * 1e9 + @userVersion()) + req = indexedDB.open(NAME, VERSION * @versionMultipler + @userVersion()) req.onsuccess = @onOpenSuccess req.onerror = @onOpenError req.onupgradeneeded = @onUpgradeNeeded catch error - @fail 'error', error + @fail 'exception', error return onOpenSuccess: (event) => @@ -79,10 +80,10 @@ class app.DB return handleVersionMismatch: (actualVersion) -> - if Math.floor(actualVersion / 1e9) isnt VERSION + if Math.floor(actualVersion / @versionMultipler) isnt VERSION @fail 'version' else - @setUserVersion actualVersion - VERSION * 1e9 + @setUserVersion actualVersion - VERSION * @versionMultipler @db() return diff --git a/assets/javascripts/lib/util.coffee b/assets/javascripts/lib/util.coffee index aba9f038..8972775b 100644 --- a/assets/javascripts/lib/util.coffee +++ b/assets/javascripts/lib/util.coffee @@ -339,6 +339,9 @@ $.popup = (value) -> $.isMac = -> navigator.userAgent?.indexOf('Mac') >= 0 +$.isIE = -> + navigator.userAgent?.indexOf('MSIE') >= 0 || navigator.userAgent?.indexOf('rv:11.0') >= 0 + HIGHLIGHT_DEFAULTS = className: 'highlight' delay: 1000