Sha256: 9ae188e4e3af02d1f8e5afab47e5dc46adb7400925209c303bb1e4d18c6da9ff

Contents?: true

Size: 1.65 KB

Versions: 52

Compression:

Stored size: 1.65 KB

Contents

var Data;

Data = {
  // values cannot be longer than 255 chars
  //
  store: function(data, success_function, error_function) {
    Debug.log("Data.store", data);
    
    var keys = {
      "keys": data
    };
    openmail.Application.setData(keys, function(response) {
      Debug.log("openmail.Application.setData response", response);

      if (response.error && (response.error !== YAHOO.openmail.ERR_NONE)) {
        // storage error detected
        Debug.error("Error saving data", response);
        if (error_function) {
          error_function(response);
        }
      } else {
        if (success_function) {
          success_function(response);
        }
      }
    });
  },
  
  // keys must be an array
  //
  fetch: function(keys, success_function, error_function) {
    Debug.log("Data.fetch", keys);
    
    keys = {
      "keys": keys
    };
    
    openmail.Application.getData(keys, function(response) {
      try {
        Debug.log("Inside openmail.Application.getData callback", response);
      
        if (response.error && (response.error !== YAHOO.openmail.ERR_NONE)) {
          Debug.error("Error retrieving data", response);
          if (error_function) {
            error_function(response);
          }
        } else {
          Debug.log("success in openmail.Application.getData", response);
          if (success_function) {
            success_function(response);
          }
        }
      } catch(omg) {
        Debug.error(omg);
      }
    });
  },
  
  clear: function() {
    Data.store({
      "ymail_wssid": null
    }, function(response) {
      YAHOO.oib.guid = null;
      YAHOO.oib.ymail_wssid = null;      
    });
  }
};

Version data entries

52 entries across 52 versions & 1 rubygems

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