1 | function buildMessageButtons(content){
|
---|
2 | var data = getTabData();
|
---|
3 | //FLAGS BUTTON SET
|
---|
4 | content.find(".message-flags").find(".message-important-flag").button({
|
---|
5 | icons: {
|
---|
6 | primary: "ui-icon-notice"
|
---|
7 | },
|
---|
8 | text: false
|
---|
9 | }).click(function(){
|
---|
10 | var checked = $(this).attr("checked") == "checked" ? true : false;
|
---|
11 | set_message_flag(data.id, checked ? "flagged" : "unflagged", undefined, data.folder);
|
---|
12 | write_msg(get_lang('Message marked as ') + get_lang( checked ? "Important" : "Normal"));
|
---|
13 | refresh();
|
---|
14 | }).end().find(".message-unread-flag").button({
|
---|
15 | icons: {
|
---|
16 | primary: "ui-icon-mail-closed"
|
---|
17 | },
|
---|
18 | text: false
|
---|
19 | }).click(function(){
|
---|
20 | var checked = $(this).attr("checked") == "checked" ? true : false;
|
---|
21 | set_message_flag(data.id, checked ? "unseen" : "seen", undefined, data.folder);
|
---|
22 | write_msg(get_lang('Message marked as ') + get_lang( checked ? "Unseen" : "Seen"));
|
---|
23 | refresh();
|
---|
24 | }).end().find(".message-spam-flag").button({
|
---|
25 | icons: {
|
---|
26 | primary: "ui-icon-alert"
|
---|
27 | },
|
---|
28 | text: false
|
---|
29 | }).click(function(){
|
---|
30 | var checked = $(this).attr("checked") == "checked" ? true : false;
|
---|
31 | checked ? spam(data.folder, data.id,'null') : nospam(data.id,'null', data.folder);
|
---|
32 | removeTab();
|
---|
33 | refresh();
|
---|
34 | }).end().find(".message-followup-flag").button({
|
---|
35 | icons: {
|
---|
36 | primary: "ui-icon-flag"
|
---|
37 | },
|
---|
38 | text: false
|
---|
39 | });
|
---|
40 | content.find(".message-flags").buttonset();
|
---|
41 |
|
---|
42 | //MESSAGES ACTION NEXT PREV BUTTON SET
|
---|
43 | content.find(".messages-controll").find(".message-prev").button({
|
---|
44 | icons: {
|
---|
45 | primary: "ui-icon-carat-1-w"
|
---|
46 | },
|
---|
47 | text: false
|
---|
48 | }).click(function(){
|
---|
49 |
|
---|
50 | }).next().button({
|
---|
51 | icons: {
|
---|
52 | primary: "ui-icon-carat-1-e"
|
---|
53 | },
|
---|
54 | text: false
|
---|
55 | });
|
---|
56 | content.find(".messages-controll").buttonset();
|
---|
57 |
|
---|
58 | //
|
---|
59 | content.find(".message-forward").button({
|
---|
60 | icons:{
|
---|
61 | primary: "ui-icon-arrowreturnthick-1-e"
|
---|
62 | },
|
---|
63 | text : false
|
---|
64 | });
|
---|
65 |
|
---|
66 | var teste = content.find(".message-reply-menu-content").clone();
|
---|
67 | content.find(".message-reply-menu-content").remove();
|
---|
68 |
|
---|
69 | content.find(".button.message-reply").button({
|
---|
70 | icons:{
|
---|
71 | primary: "ui-icon-arrowreturnthick-1-w"
|
---|
72 | },
|
---|
73 | text : false
|
---|
74 | }).next().button({
|
---|
75 | icons:{
|
---|
76 | primary: "ui-icon-triangle-1-s"
|
---|
77 | },
|
---|
78 | text : false
|
---|
79 | }).parent().buttonset();
|
---|
80 |
|
---|
81 | content.find("span.message-reply").append(teste);
|
---|
82 |
|
---|
83 | content.find(".message-reply").next().menuPlugin({
|
---|
84 | content : content.find(".message-reply-menu-content").html(),
|
---|
85 | positionOpts: {
|
---|
86 | posX: 'left',
|
---|
87 | posY: 'bottom',
|
---|
88 | offsetX: -140,
|
---|
89 | offsetY: 0,
|
---|
90 | directionH: 'right',
|
---|
91 | directionV: 'down',
|
---|
92 | detectH: true, // do horizontal collision detection
|
---|
93 | detectV: true, // do vertical collision detection
|
---|
94 | linkToFront: false
|
---|
95 | },
|
---|
96 | flyOut: true,
|
---|
97 | showSpeed: 100,
|
---|
98 | crumbDefaultText: '>'
|
---|
99 | });
|
---|
100 |
|
---|
101 |
|
---|
102 | content.find(".button.message-edit").button({
|
---|
103 | icons:{
|
---|
104 | primary: "ui-icon-pencil"
|
---|
105 | },
|
---|
106 | text : false
|
---|
107 | });
|
---|
108 | //BUTTON MORE AND TAGS
|
---|
109 | content.find(".message-tags").button({
|
---|
110 | icons: {
|
---|
111 | primary: "ui-icon-tag",
|
---|
112 | secondary: "ui-icon-triangle-1-s"
|
---|
113 | },
|
---|
114 | text: false
|
---|
115 | }).next().next().button({
|
---|
116 | icons: {
|
---|
117 | secondary: "ui-icon-triangle-1-s"
|
---|
118 | },
|
---|
119 | text: true
|
---|
120 | });
|
---|
121 |
|
---|
122 | content.find(".message-more").menuPlugin({
|
---|
123 | content : content.find(".message-more-menu-content").html(),
|
---|
124 | flyOut: true,
|
---|
125 | positionOpts: {
|
---|
126 | posX: 'left',
|
---|
127 | posY: 'bottom',
|
---|
128 | offsetX: -140,
|
---|
129 | offsetY: 0,
|
---|
130 | directionH: 'right',
|
---|
131 | directionV: 'down',
|
---|
132 | detectH: true, // do horizontal collision detection
|
---|
133 | detectV: true, // do vertical collision detection
|
---|
134 | linkToFront: false
|
---|
135 | },
|
---|
136 | showSpeed: 100,
|
---|
137 | crumbDefaultText: '>'
|
---|
138 | });
|
---|
139 |
|
---|
140 | content.find(".message-tags-menu-content ul li").remove();
|
---|
141 | $.each(getLabels(), function(key,value){
|
---|
142 | content.find(".message-tags-menu-content ul")
|
---|
143 | .append("<li id='"+key+"'><a onclick='labeledMessages("+
|
---|
144 | (key.match(/label(.*)/) ? key.match(/label(.*)/)[1] : 'configureLabels({applyToSelectedMessages:true})')
|
---|
145 | +");' href='#'>"+value.name+"</a></li>").find("li:last");
|
---|
146 | });
|
---|
147 |
|
---|
148 | content.find(".message-tags").menuPlugin({
|
---|
149 | content : content.find(".message-tags-menu-content").html(),
|
---|
150 | flyOut: true,
|
---|
151 | positionOpts: {
|
---|
152 | posX: 'left',
|
---|
153 | posY: 'bottom',
|
---|
154 | offsetX: -140,
|
---|
155 | offsetY: 0,
|
---|
156 | directionH: 'right',
|
---|
157 | directionV: 'down',
|
---|
158 | detectH: true, // do horizontal collision detection
|
---|
159 | detectV: true, // do vertical collision detection
|
---|
160 | linkToFront: false
|
---|
161 | },
|
---|
162 | showSpeed: 100,
|
---|
163 | crumbDefaultText: '>'
|
---|
164 | });
|
---|
165 | //REMOVE MESSAGE BUTTON
|
---|
166 | content.find(".message-remove").button({
|
---|
167 | icons: {
|
---|
168 | primary: "ui-icon-trash"
|
---|
169 | },
|
---|
170 | text: false
|
---|
171 | }).click(function(){
|
---|
172 | proxy_mensagens.delete_msgs(data.folder,data.id,'null');
|
---|
173 | removeTab();
|
---|
174 | refresh();
|
---|
175 | });
|
---|
176 |
|
---|
177 | //PREFERENCES BUTTON
|
---|
178 | content.find(".messages-preferences").button({
|
---|
179 | icons: {
|
---|
180 | primary: "ui-icon-gear",
|
---|
181 | secondary: "ui-icon-triangle-1-s"
|
---|
182 | },
|
---|
183 | text: false
|
---|
184 | }).css("width", "45px");
|
---|
185 |
|
---|
186 | //MESSAGE DETAILS
|
---|
187 | content.find(".message-hide-show-details").click(function(){
|
---|
188 | $(this).find("span").toggle();
|
---|
189 | content.find(".message-details").toggle("blind");
|
---|
190 | }).hover(
|
---|
191 | function(){
|
---|
192 | $(this).addClass("message-detail-hover");
|
---|
193 | },
|
---|
194 | function(){
|
---|
195 | $(this).removeClass("message-detail-hover");
|
---|
196 | }
|
---|
197 | );
|
---|
198 |
|
---|
199 | } |
---|