Changeset 4171c59 in github
- Timestamp:
- Jul 4, 2011 7:40:02 AM (23 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 7da13a3
- Parents:
- 5b3ac324
- Files:
-
- 7 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/js/app.js (modified) (3 diffs)
-
program/localization/en_US/labels.inc (modified) (1 diff)
-
program/steps/mail/attachments.inc (modified) (1 diff)
-
program/steps/mail/compose.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rb8605bd r4171c59 2 2 =========================== 3 3 4 - Add optional textual upload progress indicator (#1486039) 4 5 - Fix parsing URLs containing commas (#1487970) 5 6 - Added vertical splitter for books/groups list in addressbook (#1487923) -
config/main.inc.php.dist
r15d7627 r4171c59 437 437 // Must be less than 'session_lifetime' 438 438 $rcmail_config['min_keep_alive'] = 60; 439 440 // Enables files upload indicator. Requires APC installed and enabled apc.rfc1867 option. 441 // By default refresh time is set to 1 second. You can set this value to true 442 // or any integer value indicating number of seconds. 443 $rcmail_config['upload_progress'] = false; 439 444 440 445 // ---------------------------------- -
program/include/main.inc
r3ddca3b r4171c59 2081 2081 } 2082 2082 2083 function rcube_upload_progress() 2084 { 2085 global $RCMAIL; 2086 2087 $prefix = ini_get('apc.rfc1867_prefix'); 2088 $params = array( 2089 'action' => $RCMAIL->action, 2090 'name' => get_input_value('_progress', RCUBE_INPUT_GET), 2091 ); 2092 2093 if (function_exists('apc_fetch')) { 2094 $status = apc_fetch($prefix . $params['name']); 2095 2096 if (!empty($status)) { 2097 $status['percent'] = $status['current']/$status['total']*100; 2098 $params = array_merge($status, $params); 2099 } 2100 } 2101 2102 if (isset($params['percent'])) 2103 $params['text'] = rcube_label(array('name' => 'uploadprogress', 'vars' => array( 2104 'percent' => $params['percent'] . '%', 2105 'current' => show_bytes($params['current']), 2106 'total' => show_bytes($params['total']) 2107 ))); 2108 console($params); 2109 $RCMAIL->output->command('upload_progress_update', $params); 2110 $RCMAIL->output->send(); 2111 } 2112 2113 function rcube_upload_progress_init() 2114 { 2115 global $RCMAIL; 2116 2117 // Enable upload progress bar 2118 if (($seconds = $RCMAIL->config->get('upload_progress')) && ini_get('apc.rfc1867')) { 2119 if ($field_name = ini_get('apc.rfc1867_name')) { 2120 $RCMAIL->output->set_env('upload_progress_name', $field_name); 2121 $RCMAIL->output->set_env('upload_progress_time', (int) $seconds); 2122 } 2123 } 2124 } -
program/js/app.js
r5b3ac324 r4171c59 3265 3265 3266 3266 // display upload indicator and cancel button 3267 var content = this.get_label('uploading' + (files > 1 ? 'many' : '')),3267 var content = '<span>' + this.get_label('uploading' + (files > 1 ? 'many' : '')) + '</span>', 3268 3268 ts = frame_name.replace(/^rcmupload/, ''); 3269 3269 3270 if ( this.env.loadingicon)3270 if (!this.env.upload_progress_time && this.env.loadingicon) 3271 3271 content = '<img src="'+this.env.loadingicon+'" alt="" />'+content; 3272 3272 if (this.env.cancelicon) 3273 3273 content = '<a title="'+this.get_label('cancel')+'" onclick="return rcmail.cancel_attachment_upload(\''+ts+'\', \''+frame_name+'\');" href="#cancelupload"><img src="'+this.env.cancelicon+'" alt="" /></a>'+content; 3274 3274 this.add2attachment_list(ts, { name:'', html:content, complete:false }); 3275 3276 // upload progress support 3277 if (this.env.upload_progress_time) { 3278 this.upload_progress_start('upload', ts); 3279 } 3275 3280 } 3276 3281 … … 3335 3340 $("iframe[name='"+frame_name+"']").remove(); 3336 3341 return false; 3342 }; 3343 3344 this.upload_progress_start = function(action, name) 3345 { 3346 window.setTimeout(function() { rcmail.http_request(action, {_progress: name}); }, 3347 this.env.upload_progress_time * 1000); 3348 }; 3349 3350 this.upload_progress_update = function(param) 3351 { 3352 var elem = $('#'+param.name + '> span'); 3353 3354 if (!elem.length || !param.text) 3355 return; 3356 3357 elem.text(param.text); 3358 3359 if (!param.done) 3360 this.upload_progress_start(param.action, param.name); 3337 3361 }; 3338 3362 … … 5603 5627 frame_name = 'rcmupload'+ts; 5604 5628 5629 // upload progress support 5630 if (this.env.upload_progress_name) { 5631 var fname = this.env.upload_progress_name, 5632 field = $('input[name='+fname+']', form); 5633 5634 if (!field.length) { 5635 field = $('<input>').attr({type: 'hidden', name: fname}); 5636 field.appendTo(form); 5637 } 5638 5639 field.val(ts); 5640 } 5641 5605 5642 // have to do it this way for IE 5606 5643 // otherwise the form will be posted to a new window -
program/localization/en_US/labels.inc
r9caf9ca r4171c59 211 211 $labels['attachments'] = 'Attachments'; 212 212 $labels['upload'] = 'Upload'; 213 $labels['uploadprogress'] = '$percent ($current from $total)'; 213 214 $labels['close'] = 'Close'; 214 215 $labels['messageoptions'] = 'Message options...'; -
program/steps/mail/attachments.inc
r569701d r4171c59 20 20 */ 21 21 22 // Upload progress update 23 if (!empty($_GET['_progress'])) { 24 rcube_upload_progress(); 25 } 22 26 23 27 $COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GPC); -
program/steps/mail/compose.inc
ra208a4f r4171c59 1200 1200 function rcmail_compose_attachment_form($attrib) 1201 1201 { 1202 global $ OUTPUT;1202 global $RCMAIL, $OUTPUT; 1203 1203 1204 1204 // add ID if not given 1205 1205 if (!$attrib['id']) 1206 1206 $attrib['id'] = 'rcmUploadbox'; 1207 1208 // Enable upload progress bar 1209 rcube_upload_progress_init(); 1207 1210 1208 1211 // find max filesize value
Note: See TracChangeset
for help on using the changeset viewer.
