mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-23 13:59:32 +00:00
Style
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/* -*- Mode: js2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
|
||||
SOGoMailDataSource = Class.create({
|
||||
|
||||
|
||||
initialize: function(dataTable, url) {
|
||||
// Instance variables
|
||||
this.dataTable = dataTable;
|
||||
this.id = url;
|
||||
this.url = url;
|
||||
|
||||
|
||||
this.uids = new Array();
|
||||
this.threaded = false;
|
||||
this.cache = new Hash();
|
||||
|
||||
|
||||
this.loaded = false;
|
||||
this.delayedGetData = false;
|
||||
this.ajaxGetData = false;
|
||||
@@ -19,7 +19,7 @@ SOGoMailDataSource = Class.create({
|
||||
// Constants
|
||||
this.overflow = 50; // must be higher or equal to the overflow of the data table class
|
||||
},
|
||||
|
||||
|
||||
destroy: function() {
|
||||
this.uids.clear();
|
||||
var keys = this.cache.keys();
|
||||
@@ -71,7 +71,7 @@ SOGoMailDataSource = Class.create({
|
||||
this.loaded = true;
|
||||
// log ("MailDataSource.init() " + this.uids.length + " UIDs, " + this.cache.keys().length + " headers");
|
||||
},
|
||||
|
||||
|
||||
load: function(urlParams) {
|
||||
var params;
|
||||
this.loaded = false;
|
||||
@@ -89,7 +89,7 @@ SOGoMailDataSource = Class.create({
|
||||
params,
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
},
|
||||
|
||||
|
||||
_loadCallback: function(http) {
|
||||
if (http.status == 200) {
|
||||
if (http.responseText.length > 0) {
|
||||
@@ -108,7 +108,7 @@ SOGoMailDataSource = Class.create({
|
||||
log("SOGoMailDataSource._loadCallback Error " + http.status + ": " + http.responseText);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getData: function(id, index, count, callbackFunction, delay) {
|
||||
if (this.loaded == false) {
|
||||
// UIDs are not yet loaded -- delay the call until loading the data is completed.
|
||||
@@ -124,12 +124,12 @@ SOGoMailDataSource = Class.create({
|
||||
callbackFunction
|
||||
).delay(delay);
|
||||
},
|
||||
|
||||
|
||||
_getData: function(id, index, count, callbackFunction) {
|
||||
var start, end;
|
||||
var i, j;
|
||||
var missingUids = new Array();
|
||||
|
||||
|
||||
if (count > 1) {
|
||||
// Compute last index depending on number of UIDs
|
||||
start = index - (this.overflow/2);
|
||||
@@ -170,7 +170,7 @@ SOGoMailDataSource = Class.create({
|
||||
else if (callbackFunction)
|
||||
this._returnData(callbackFunction, id, start, end);
|
||||
},
|
||||
|
||||
|
||||
_getRemoteData: function(callbackData, urlParams) {
|
||||
if (this.ajaxGetData) {
|
||||
this.ajaxGetData.aborted = true;
|
||||
@@ -184,7 +184,7 @@ SOGoMailDataSource = Class.create({
|
||||
urlParams,
|
||||
{ "Content-type": "application/x-www-form-urlencoded" });
|
||||
},
|
||||
|
||||
|
||||
_getRemoteDataCallback: function(http) {
|
||||
if (http.status == 200) {
|
||||
if (http.responseText.length > 0) {
|
||||
@@ -207,7 +207,7 @@ SOGoMailDataSource = Class.create({
|
||||
log("SOGoMailDataSource._getRemoteDataCallback Error " + http.status + ": " + http.responseText);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
_returnData: function(callbackFunction, id, start, end) {
|
||||
var i, j;
|
||||
var data = new Array();
|
||||
|
||||
Reference in New Issue
Block a user