source: sandbox/newExpressoMail/prototype/modules/newMail/js/folder.js @ 7265

Revision 7265, 1.8 KB checked in by gustavo, 12 years ago (diff)

Ticket #0000 - Criado novo modulo para o desenvolvimento do novo ExpressoMail?

  • Property svn:executable set to *
Line 
1dashes = /\//gi;
2
3var Folder = {
4    open : 'INBOX',
5
6    remove : function(id, callback){
7        DataLayer.remove("folder", id);
8        DataLayer.commit(false, false, callback);
9    },
10
11    rename : function(id, value, callback){
12        DataLayer.put("folder", {id:id, new:value});
13        DataLayer.commit(false, false, callback);
14    },
15
16    create : function(id, path,callback){
17        DataLayer.put("folder", {name:id, path:path});
18        DataLayer.commit(false, false, callback);
19    },
20
21    move : function (id, value){
22
23    },
24
25    exportMessages : function(id, callback){
26
27    },
28
29    change : function(id, title){
30        var data = DataLayer.get("folder", {criteria:{folder:id} }, true)[0];
31        Tab.setFolderTotal(data.messageCount.total);
32        Tab.setFolderUnread(data.messageCount.unseen);
33        Tab.setFolderName(title ? title : data.commonName);
34        Folder.open = id;
35        Grid.jqGrid('clearGridData')
36            .jqGrid('setGridParam', {
37                url:  BASE_PATH+'REST.php?q=folder/'+id.replace(dashes, '.')+'/message'
38            })
39            .trigger('reloadGrid',
40            [{
41                page: 1
42            }]
43        );
44    },
45
46    acl : function(id){
47
48    },
49
50    info : function(id){
51        return DataLayer.get("folder", {criteria:{folder:(id ? id : Folder.open)} }, true)[0];
52    },
53    special : {},
54    init: function(){
55        this.special[imap_configs.imapDefaultDraftsFolder] = "Rascunhos";
56        this.special[imap_configs.imapDefaultSentFolder] = "Enviados";
57        this.special[imap_configs.imapDefaultSpamFolder] = "Spam";
58        this.special[imap_configs.imapDefaultTrashFolder] = "Lixeira";
59    },
60
61    delimiter : imap_configs.imapDelimiter
62}
63
64Folder.init();
Note: See TracBrowser for help on using the repository browser.