some userinteraction for show all folders, improve regex for unseen detection

This commit is contained in:
Klaus Leithoff 2014-02-06 12:48:01 +00:00
parent d3bbb7b9ac
commit 4a4327d57e
3 changed files with 74 additions and 64 deletions

View File

@ -863,6 +863,7 @@ app.classes.mail = AppJS.extend(
// if olddesc is undefined or #skip# then skip the message, as we process subfolders
if (typeof _status[i]['olddesc'] !== 'undefined' && _status[i]['olddesc'] !== '#skip-user-interaction-message#') egw_message(this.egw.lang("Renamed Folder %1 to %2",_status[i]['olddesc'],_status[i]['desc']));
ftree.renameItem(i,_status[i]['id'],_status[i]['desc']);
ftree.setStyle(i, 'font-weight: '+(_status[i]['desc'].match(this._unseen_regexp) ? 'bold' : 'normal'));
//alert(i +'->'+_status[i]['id']+'+'+_status[i]['desc']);
if (_status[i]['id']==selectedNode.id)
{
@ -913,9 +914,10 @@ app.classes.mail = AppJS.extend(
// if olddesc is undefined or #skip# then skip the message, as we process subfolders
if (typeof _status[i] !== 'undefined' && _status[i] !== '#skip-user-interaction-message#')
{
egw_message(this.egw.lang("Reloaded Folder %1 ",typeof _status[i] == "string" ? _status[i] : _status[i].text));
egw_message(this.egw.lang("Reloaded Folder %1 ",typeof _status[i] == "string" ? _status[i].replace(this._unseen_regexp, '') : _status[i].text.replace(this._unseen_regexp, '')));
}
ftree.refreshItem(i,typeof _status[i] == "object" ? _status[i] : null);
if (typeof _status[i] == "string") ftree.setStyle(i, 'font-weight: '+(_status[i].match(this._unseen_regexp) ? 'bold' : 'normal'));
}
var selectedNodeAfter = ftree.getSelectedNode();
@ -1010,7 +1012,7 @@ app.classes.mail = AppJS.extend(
/**
* Regular expression to find (and remove) unseen count from folder-name
*/
_unseen_regexp: / \([0-9]\)$/,
_unseen_regexp: / \([0-9]+\)$/,
/**
* Delete mails - actually calls the backend function for deletion
@ -1134,7 +1136,7 @@ app.classes.mail = AppJS.extend(
getFolders = true;
}
// alert(folder);
egw_message(this.egw.lang('Connect to Profile %1',_widget.getSelectedLabel()));
egw_message(this.egw.lang('Connect to Profile %1',_widget.getSelectedLabel().replace(this._unseen_regexp, '')));
this.lock_tree();
egw.json('mail.mail_ui.ajax_changeProfile',[folder, getFolders], jQuery.proxy(function() {
@ -1188,8 +1190,8 @@ app.classes.mail = AppJS.extend(
// Get nice folder name for message, if selected is not a profile
if(!profile_selected)
{
var displayname = _widget.getSelectedLabel().replace(this._remove_unseen_regexp, '');
var myMsg = (displayname?displayname:_folder)+' '+this.egw.lang('selected');
var displayname = _widget.getSelectedLabel();
var myMsg = (displayname?displayname:_folder).replace(this._unseen_regexp, '')+' '+this.egw.lang('selected');
egw_message(myMsg);
}
@ -2544,6 +2546,7 @@ app.classes.mail = AppJS.extend(
aclCommonWidget.set_value(rights);
}
},
/**
*
* @todo get the account id and open the relevant sieve, ATM alway open sieve rules which is set in preferences
@ -2571,10 +2574,13 @@ app.classes.mail = AppJS.extend(
all_folders: function(_action,_senders)
{
//console.log(_action,_senders);
this.lock_tree();
var mailbox = _senders[0].id.split('::');
acc_id = mailbox[0];
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
egw_message(this.egw.lang('Toggle all Folders view for %1',ftree.getLabel(acc_id)));
this.lock_tree();
egw.json('mail.mail_ui.ajax_reloadNode',[acc_id,!_action.checked], jQuery.proxy(function() {
egw_message(this.egw.lang('Toggle all Folders view for %1',ftree.getLabel(acc_id)));
this.unlock_tree();
},this))
.sendRequest();
@ -2590,6 +2596,8 @@ app.classes.mail = AppJS.extend(
{
var mailbox = _senders[0].id.split('::');
var folder = mailbox[1], acc_id = mailbox[0];
var ftree = this.et2.getWidgetById(this.nm_index+'[foldertree]');
egw_message(this.egw.lang('Toggle all Folders view for %1',ftree.getLabel(acc_id)));
egw.json('mail.mail_ui.ajax_foldersubscription',[acc_id,folder,true])
.sendRequest();
},

View File

@ -359,6 +359,7 @@ then mail de dann
there is no imap server configured. mail de Es ist kein IMAP Server Konfiguriert
timeout on connections to your imap server mail de Stellen Sie hier das Verbindungstimeout für IMAP Verbindungen ein.
to do mail de zu erledigen
toggle all folders view for %1 mail de Umschaltung der Alle-Ordner-anzeigen Ansicht für %1
trash mail de Papierkorb
trash folder mail de Ordner für gelöschte Nachrichten
trust servers seen / unseen info mail de Abruf des Ungelesen/gelesen Status des Mailservers

View File

@ -358,6 +358,7 @@ then mail en THEN
there is no imap server configured. mail en There is no IMAP Server configured.
timeout on connections to your imap server mail en Timeout on connections to your IMAP Server
to do mail en to do
toggle all folders view for %1 mail en Toggle all Folders view for %1
trash mail en Trash
trash folder mail en trash folder
trust servers seen / unseen info mail en trust servers SEEN / UNSEEN info