Changeset 1160:ce52e19259b9
- Timestamp:
- 06/21/13 21:47:02 (11 years ago)
- Branch:
- default
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
admin/js/_media.js
r1159 r1160 1 1 $(function() { 2 var jqXHR = null; 2 if ($('#fileupload').length==0) { 3 return; 4 } 5 3 6 $('#fileupload').fileupload({ 4 7 url: $('#fileupload').attr('action'), … … 7 10 }).bind('fileuploaddone', function(e, data) { 8 11 if (data.result.files[0].html !==undefined) { 9 $('.media-list ').append(data.result.files[0].html);12 $('.media-list p.clear').before(data.result.files[0].html); 10 13 } 11 14 }); 12 15 13 if (!$.browser.opera) { 14 var $container = $('#fileupload').parent().parent(); 15 var $msg; 16 var $container = $('#fileupload').parent().parent(); 17 var $msg; 16 18 19 if ($container.hasClass('enhanced_uploader')) { 20 $msg = dotclear.msg.enhanced_uploader_disable; 21 $('#fileupload').fileupload({disabled:false}); 22 } else { 23 $msg = dotclear.msg.enhanced_uploader_activate; 24 } 25 26 $('<div><a href="#">' + $msg + '</a></div>').click( function() { 17 27 if ($container.hasClass('enhanced_uploader')) { 28 $msg = dotclear.msg.enhanced_uploader_activate; 29 $('#upfile').attr('multiple', false); 30 31 // when a user has clicked enhanced_uploader, and has added files 32 // We must remove files in table 33 $('.table-files tr', '#fileupload').remove(); 34 $('#fileupload').fileupload({disabled:true}); 35 } else { 18 36 $msg = dotclear.msg.enhanced_uploader_disable; 37 $('#upfile').attr('multiple', true); 19 38 $('#fileupload').fileupload({disabled:false}); 20 } else {21 $msg = dotclear.msg.enhanced_uploader_activate;22 39 } 40 $(this).find('a').text($msg); 23 41 24 $('<div><a href="#">' + $msg + '</a></div>').click( function() { 25 if ($container.hasClass('enhanced_uploader')) { 26 $msg = dotclear.msg.enhanced_uploader_activate; 27 $('#upfile').attr('multiple', false); 28 29 // when a user has clicked enhanced_uploader, and has added files 30 // We must remove files in table 31 $('.table-files tr', '#fileupload').remove(); 32 $('#fileupload').fileupload({disabled:true}); 33 } else { 34 $msg = dotclear.msg.enhanced_uploader_disable; 35 $('#upfile').attr('multiple', true); 36 $('#fileupload').fileupload({disabled:false}); 37 } 38 $(this).find('a').text($msg); 39 40 $container.toggleClass('enhanced_uploader'); 41 }).appendTo($('#fileupload')); 42 } 42 $container.toggleClass('enhanced_uploader'); 43 }).appendTo($('#fileupload')); 43 44 44 45 // Replace remove links by a POST on hidden form -
admin/media.php
r1159 r1160 151 151 $message['files'][] = array('name' => $upfile['name'], 152 152 'size' => $upfile['size'], 153 'html' => mediaItemLine($core->media->getFile($new_file_id), count($dir['files']))153 'html' => mediaItemLine($core->media->getFile($new_file_id), 1) 154 154 ); 155 155 } catch (Exception $e) { … … 284 284 285 285 $items = array_values(array_merge($dir['dirs'],$dir['files'])); 286 echo '<div class="media-list">'; 286 287 if (count($items) == 0) 287 288 { … … 303 304 '</form>'. 304 305 305 '<div class="media-list">'.306 306 '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 307 307 … … 312 312 313 313 echo 314 '<p class="clear">'.__('Page(s)').' : '.$pager->getLinks().'</p>'. 315 '</div>'; 316 } 317 314 '<p class="clear">'.__('Page(s)').' : '.$pager->getLinks().'</p>'; 315 } 316 echo 317 '<p class="clear"></p>'. 318 '</div>'; 318 319 319 320 if ($core_media_writable) 320 321 { 321 322 323 322 echo '<div class="two-cols">'; 323 324 if ($user_ui_enhanceduploader) { 324 325 echo 325 326 '<div class="col enhanced_uploader">'; … … 338 339 echo 339 340 '<div class="fileupload-buttonbar">'. 340 '<label class="button -add button" for="upfile">'.__('Add files').341 '<label class="button add" for="upfile"><span>'.__('Add files').'</span>'. 341 342 '<span class="one-file"> ('.sprintf(__('Maximum size %s'),files::size(DC_MAX_UPLOAD_SIZE)).')</span>'. 342 343 '<input type="file" id="upfile" name="upfile[]"'.($user_ui_enhanceduploader?' multiple="mutiple"':'').' data-url="'.html::escapeURL($page_url).'" />'. … … 345 346 346 347 echo 347 348 348 '<p class="one-file"><label for="upfiletitle">'.__('Title:').form::field(array('upfiletitle','upfiletitle'),35,255).'</label></p>'. 349 '<p class="one-file"><label for="upfilepriv" class="classic">'.form::checkbox(array('upfilepriv','upfilepriv'),1).' '. 349 350 __('Private').'</label></p>'; 350 351 351 352 353 354 355 352 if (!$user_ui_enhanceduploader) { 353 echo 354 '<p class="one-file form-help info">'.__('To send several files at the same time, you can activate the enhanced uploader in'). 355 ' <a href="preferences.php?tab=user-options">'.__('My preferences').'</a></p>'; 356 } 356 357 357 358 echo 359 '<button type="reset" class="button cancel"><span>'.__('Cancel').'</span></button>'. 358 360 '<input class="button start" type="submit" value="'.__('Send').'"/>'. 359 361 '</div>'; 360 361 362 362 363 echo -
admin/style/jsUpload/style.css
r1159 r1160 14 14 color: #fff; 15 15 margin-right: 4px; 16 padding: .1em .5em 0 .5em; 17 font-size: 1em; 16 18 } 17 19 18 .enhanced_uploader .button-add {20 .enhanced_uploader label.button.add { 19 21 position: relative; 20 22 } … … 25 27 } 26 28 27 .enhanced_uploader .button -add input {29 .enhanced_uploader .button.add input { 28 30 position: absolute; 29 31 top: 0; … … 54 56 } 55 57 58 .enhanced_uploader .table-files .button.cancel { 59 background: transparent url('../../images/check-off.png') no-repeat left top; 60 width: 13px; 61 height: 13px; 62 margin-top: 3px; 63 border: none; 64 } 65 56 66 .enhanced_uploader .one-file { 57 67 display: none; 58 68 } 59 69 60 .table-files {70 .table-files, .button.cancel { 61 71 display: none; 62 72 } … … 66 76 } 67 77 78 .enhanced_uploader .button.cancel { 79 display: inline-block; 80 } 81 68 82 label span.one-file { 69 83 display: inline; -
inc/admin/lib.dc.page.php
r1159 r1160 711 711 {% } %} 712 712 </td> 713 <td> 714 {% if (!i) { %} 715 <div class="button cancel" title="'.__('Cancel').'"></div> 716 {% } %} 717 </td> 713 718 </tr> 714 719 {% } %}
Note: See TracChangeset
for help on using the changeset viewer.