Sha256: 136bae309dc080ff258b11c19fbc31b72dafee953163d672f39dc14f4accf5f9

Contents?: true

Size: 1.48 KB

Versions: 27

Compression:

Stored size: 1.48 KB

Contents

window.Data = 
  # values cannot be longer than 255 chars
  #
  store: (data, success_function, error_function) ->
    Debug.log("Data.store", data)
    
    keys = 
      "keys": data
      
    openmail.Application.setData keys, (response) ->
      Debug.log("openmail.Application.setData response", response)

      if typeof(response.error) != 'undefined' && response.error != YAHOO.openmail.ERR_NONE
        # storage error detected
        Debug.error("Error saving data", response)
        
        if typeof(error_function) != 'undefined'
          error_function(response)
      else
        if typeof(success_function) != 'undefined'
          success_function(response)
  
  # keys must be an array
  #
  fetch: (keys, success_function, error_function) ->
    Debug.log("Data.fetch", keys)
    
    keys = 
      "keys": keys
    
    openmail.Application.getData keys, (response) ->
      Debug.log("Inside openmail.Application.getData callback", response)
    
      if typeof(response.error) != 'undefined' && (response.error != YAHOO.openmail.ERR_NONE)
        Debug.error("Error retrieving data", response)
        if typeof(error_function) != 'undefined'
          error_function(response)
      else
        Debug.log("success in openmail.Application.getData", response)
        if typeof(success_function) != 'undefined'
          success_function(response)
  
  clear: -> 
    Data.store
      "ymail_wssid": null
    , (response) ->
      YMDP.guid = null
      YMDP.ymail_wssid = null
      
      

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ymdp-1.4.7 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.6 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.5 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.4 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.3 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.2 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.1 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.4.0 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.3.4 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.3.3 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.3.2 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.3.1 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.3.0 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.2.0 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.1.0 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.0.1 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-1.0.0 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-0.10.2 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-0.10.1 lib/ymdp/javascripts/jquery/data.js.coffee
ymdp-0.10.0 lib/ymdp/javascripts/jquery/data.js.coffee