Révision 0125e073
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/media/css/media.css | ||
---|---|---|
21 | 21 |
|
22 | 22 |
/* Workaround for Modal dialog underneith the Ctools modal dialog with jQuery 1.10. |
23 | 23 |
@TODO Remove this if ever ctools issue #1397370 ever gets fixed. */ |
24 |
.ui-front { |
|
24 |
.ui-front.media-wrapper {
|
|
25 | 25 |
z-index: 10001 !important; |
26 | 26 |
} |
27 | 27 |
|
drupal7/sites/all/modules/media/js/media.browser.js | ||
---|---|---|
40 | 40 |
}); |
41 | 41 |
|
42 | 42 |
$('.media-browser-tab').each( Drupal.media.browser.validateButtons ); |
43 |
|
|
44 |
// Keep keyboard focus from going to the browser chrome. |
|
45 |
$('body', context).once(function () { |
|
46 |
$(window).bind('keydown', function (event) { |
|
47 |
if (event.keyCode === 9) { |
|
48 |
var tabbables = $(':tabbable'), |
|
49 |
first = tabbables.filter(':first'), |
|
50 |
last = tabbables.filter(':last'), |
|
51 |
new_event; |
|
52 |
if ((event.target === last[0] && !event.shiftKey) || (event.target === first[0] && event.shiftKey)) { |
|
53 |
// If we're at the end of the tab list, then send a keyboard event |
|
54 |
// to the parent iframe. |
|
55 |
if (parent_iframe = Drupal.media.browser.getParentIframe(window)) { |
|
56 |
$('.ui-dialog-titlebar-close', $(parent_iframe).closest('.ui-dialog')).focus(); |
|
57 |
event.preventDefault(); |
|
58 |
return false; |
|
59 |
} |
|
60 |
} |
|
61 |
} |
|
62 |
}); |
|
63 |
}); |
|
43 | 64 |
} |
44 | 65 |
// Wait for additional params to be passed in. |
45 | 66 |
}; |
drupal7/sites/all/modules/media/js/media.popups.js | ||
---|---|---|
374 | 374 |
var defaults = {width: '100%', scrolling: 'auto'}; |
375 | 375 |
var options = $.extend({}, defaults, options); |
376 | 376 |
|
377 |
return $('<iframe class="media-modal-frame"/>') |
|
377 |
return $('<iframe class="media-modal-frame" tabindex="0"/>')
|
|
378 | 378 |
.attr('src', src) |
379 | 379 |
.attr('width', options.width) |
380 | 380 |
.attr('id', id) |
drupal7/sites/all/modules/media/js/plugins/media.views.js | ||
---|---|---|
93 | 93 |
Drupal.media.browser.selectMedia([]); |
94 | 94 |
|
95 | 95 |
// Reset all 'selected'-status. |
96 |
$('.view-content .media-item', view).removeClass('selected'); |
|
96 |
$('.view-content .media-item', view).removeClass('selected').parent().attr('aria-checked', 'false');
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
/** |
... | ... | |
140 | 140 |
}); |
141 | 141 |
|
142 | 142 |
|
143 |
// Catch the click on a media item |
|
144 |
$('.view-content .media-item', view).bind('click', function () { |
|
143 |
function onSelectMediaItem() { |
|
145 | 144 |
var fid = $(this).closest('.media-item[data-fid]').data('fid'), |
146 | 145 |
selectedFiles = new Array(); |
147 | 146 |
|
148 | 147 |
// Remove all currently selected files |
149 |
$('.view-content .media-item', view).removeClass('selected'); |
|
148 |
$('.view-content .media-item', view).removeClass('selected').parent().attr('aria-checked', 'false');
|
|
150 | 149 |
|
151 | 150 |
// Mark it as selected |
152 |
$(this).addClass('selected'); |
|
151 |
$(this).addClass('selected').parent().attr('aria-checked', 'true');
|
|
153 | 152 |
|
154 | 153 |
// Multiselect! |
155 | 154 |
if (Drupal.settings.media.browser.params.multiselect) { |
... | ... | |
160 | 159 |
// If the current file exists in the list of already selected |
161 | 160 |
// files, we deselect instead of selecting |
162 | 161 |
if (currentFid == fid) { |
163 |
$(this).removeClass('selected'); |
|
162 |
$(this).removeClass('selected').parent().attr('aria-checked', 'false');
|
|
164 | 163 |
// If we change the fid, the later matching won't |
165 | 164 |
// add it back again because it can't find it. |
166 | 165 |
fid = NaN; |
... | ... | |
173 | 172 |
selectedFiles.push(Drupal.media.browser.selectedMedia[index]); |
174 | 173 |
|
175 | 174 |
// Mark it as selected |
176 |
$('.view-content *[data-fid=' + currentFid + '].media-item', view).addClass('selected'); |
|
175 |
$('.view-content *[data-fid=' + currentFid + '].media-item', view).addClass('selected').parent().attr('aria-checked', 'true');
|
|
177 | 176 |
} |
178 | 177 |
} |
179 | 178 |
} |
... | ... | |
194 | 193 |
} |
195 | 194 |
} |
196 | 195 |
Drupal.media.browser.selectMedia(selectedFiles); |
196 |
} |
|
197 |
|
|
198 |
// Catch the click or space bar press on a media item. |
|
199 |
$('.view-content .media-item', view).bind('click', onSelectMediaItem); |
|
200 |
$('.view-content .media-item', view).parent().bind('keydown', function (evt) { |
|
201 |
if (evt.which == 32 || evt.which == 13) { |
|
202 |
onSelectMediaItem.call($('.media-item', this).get(0), evt); |
|
203 |
return false; |
|
204 |
} |
|
197 | 205 |
}); |
198 | 206 |
|
199 | 207 |
// Add the processed class, so we dont accidentally process the same element twice.. |
drupal7/sites/all/modules/media/media-views-view-media-browser.tpl.php | ||
---|---|---|
13 | 13 |
<div class="clearfix"> |
14 | 14 |
<?php print $list_type_prefix; ?> |
15 | 15 |
<?php foreach ($rows as $id => $row): ?> |
16 |
<li id="media-item-<?php print $row->fid; ?>" class="<?php print $classes_array[$id]; ?>"> |
|
16 |
<li id="media-item-<?php print $row->fid; ?>" class="<?php print $classes_array[$id]; ?>" tabindex="0" role="<?php print $aria_role; ?>" aria-checked="false">
|
|
17 | 17 |
<?php print $row->preview; ?> |
18 | 18 |
</li> |
19 | 19 |
<?php endforeach; ?> |
drupal7/sites/all/modules/media/media.info | ||
---|---|---|
24 | 24 |
; We have to add a fake version so Git checkouts do not fail Media dependencies |
25 | 25 |
version = 7.x-2.x-dev |
26 | 26 |
|
27 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
28 |
version = "7.x-2.12"
|
|
27 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
28 |
version = "7.x-2.13"
|
|
29 | 29 |
core = "7.x" |
30 | 30 |
project = "media" |
31 |
datestamp = "1507905248"
|
|
31 |
datestamp = "1508430548"
|
|
32 | 32 |
|
drupal7/sites/all/modules/media/media.module | ||
---|---|---|
607 | 607 |
* @see media_parse_to_uri() |
608 | 608 |
* @see media_add_from_url_submit() |
609 | 609 |
*/ |
610 |
function media_parse_to_file($url) { |
|
610 |
function media_parse_to_file($url, $params = array()) {
|
|
611 | 611 |
try { |
612 | 612 |
$uri = media_parse_to_uri($url); |
613 | 613 |
} |
... | ... | |
646 | 646 |
return; |
647 | 647 |
} |
648 | 648 |
$source_file = file_uri_to_object($source_uri); |
649 |
$scheme = variable_get('file_default_scheme', 'public') . '://'; |
|
649 |
if(isset($params['to_directory'])){ |
|
650 |
$scheme = variable_get('file_default_scheme', 'public') . '://' . $params['to_directory'] . '/'; |
|
651 |
} |
|
652 |
else{ |
|
653 |
$scheme = variable_get('file_default_scheme', 'public') . '://'; |
|
654 |
} |
|
650 | 655 |
$uri = file_stream_wrapper_uri_normalize($scheme . $source_file->filename); |
651 | 656 |
// Now to its new home. |
657 |
file_prepare_directory($scheme, FILE_CREATE_DIRECTORY || FILE_MODIFY_PERMISSIONS); |
|
652 | 658 |
$file = file_move($source_file, $uri, FILE_EXISTS_RENAME); |
653 | 659 |
} |
654 | 660 |
|
drupal7/sites/all/modules/media/media.views.inc | ||
---|---|---|
98 | 98 |
drupal_add_js(array('media' => array('files' => array_values($files))), 'setting'); |
99 | 99 |
|
100 | 100 |
// Add the browser parameters to the settings and that this display exists. |
101 |
$params = media_get_browser_params(); |
|
101 | 102 |
drupal_add_js(array( |
102 | 103 |
'media' => array( |
103 | 104 |
'browser' => array( |
... | ... | |
126 | 127 |
$vars['wrapper_suffix'] = '</div>'; |
127 | 128 |
$vars['list_type_prefix'] = '<' . $handler->options['type'] . ' id="media-browser-library-list" class="' . implode(' ', $class) . '">'; |
128 | 129 |
$vars['list_type_suffix'] = '</' . $handler->options['type'] . '>'; |
130 |
$vars['aria_role'] = $params['multiselect'] ? 'checkbox' : 'radio'; |
|
129 | 131 |
|
130 | 132 |
// Run theming variables through a standard Views preprocess function. |
131 | 133 |
template_preprocess_views_view_unformatted($vars); |
drupal7/sites/all/modules/media/modules/media_bulk_upload/includes/media_bulk_upload.admin.inc | ||
---|---|---|
19 | 19 |
'#required' => TRUE, |
20 | 20 |
); |
21 | 21 |
|
22 |
$form['to_directory'] = array( |
|
23 |
'#type' => 'textfield', |
|
24 |
'#title' => t('To Directory'), |
|
25 |
'#description' => t('Enter the subdirectory of /sites/default/files where files will be copied. If empty the default directory will be use.'), |
|
26 |
'#required' => FALSE, |
|
27 |
); |
|
28 |
|
|
22 | 29 |
$form['pattern'] = array( |
23 | 30 |
'#type' => 'textarea', |
24 | 31 |
'#title' => t('Pattern'), |
... | ... | |
76 | 83 |
form_set_error('pattern', t('No files were found in %directory matching the regular expression %pattern', array('%directory' => $directory, '%pattern' => $pattern_quoted))); |
77 | 84 |
} |
78 | 85 |
$form_state['storage']['files'] = $files; |
86 |
$form_state['storage']['to_directory'] = $form_state['values']['to_directory']; |
|
79 | 87 |
} |
80 | 88 |
} |
81 | 89 |
|
... | ... | |
85 | 93 |
function media_bulk_upload_import_submit($form, &$form_state) { |
86 | 94 |
if ($form_state['values']['op'] == t('Confirm')) { |
87 | 95 |
$files = $form_state['storage']['files']; |
96 |
$params = array(); |
|
97 |
$params['to_directory'] = $form_state['storage']['to_directory']; |
|
88 | 98 |
$batch = array( |
89 | 99 |
'title' => t('Importing'), |
90 | 100 |
'operations' => array( |
91 |
array('media_bulk_upload_import_batch_import_files', array($files)), |
|
101 |
array('media_bulk_upload_import_batch_import_files', array($files, $params)),
|
|
92 | 102 |
), |
93 | 103 |
'finished' => 'media_bulk_upload_import_batch_import_complete', |
94 | 104 |
'file' => drupal_get_path('module', 'media_bulk_upload') . '/includes/media_bulk_upload.admin.inc', |
... | ... | |
103 | 113 |
/** |
104 | 114 |
* BatchAPI callback op for media import. |
105 | 115 |
*/ |
106 |
function media_bulk_upload_import_batch_import_files($files, &$context) { |
|
116 |
function media_bulk_upload_import_batch_import_files($files, $params, &$context) {
|
|
107 | 117 |
if (!isset($context['sandbox']['files'])) { |
108 | 118 |
// This runs the first time the batch runs. |
109 | 119 |
// This is stupid, but otherwise, I don't think it will work... |
... | ... | |
121 | 131 |
|
122 | 132 |
foreach ($to_process as $file) { |
123 | 133 |
try { |
124 |
$file_obj = media_parse_to_file($file); |
|
134 |
$file_obj = media_parse_to_file($file, $params);
|
|
125 | 135 |
$context['results']['success'][] = $file; |
126 | 136 |
if (!$image_in_message) { |
127 | 137 |
// @todo Is this load step really necessary? When there's time, test |
drupal7/sites/all/modules/media/modules/media_bulk_upload/media_bulk_upload.info | ||
---|---|---|
15 | 15 |
files[] = includes/MediaBrowserBulkUpload.inc |
16 | 16 |
files[] = tests/media_bulk_upload.test |
17 | 17 |
|
18 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
19 |
version = "7.x-2.12"
|
|
18 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
19 |
version = "7.x-2.13"
|
|
20 | 20 |
core = "7.x" |
21 | 21 |
project = "media" |
22 |
datestamp = "1507905248"
|
|
22 |
datestamp = "1508430548"
|
|
23 | 23 |
|
drupal7/sites/all/modules/media/modules/media_internet/media_internet.info | ||
---|---|---|
12 | 12 |
files[] = includes/MediaInternetValidationException.inc |
13 | 13 |
files[] = tests/media_internet.test |
14 | 14 |
|
15 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
16 |
version = "7.x-2.12"
|
|
15 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
16 |
version = "7.x-2.13"
|
|
17 | 17 |
core = "7.x" |
18 | 18 |
project = "media" |
19 |
datestamp = "1507905248"
|
|
19 |
datestamp = "1508430548"
|
|
20 | 20 |
|
drupal7/sites/all/modules/media/modules/media_internet/tests/media_internet_test.info | ||
---|---|---|
7 | 7 |
files[] = includes/MediaInternetTestStreamWrapper.inc |
8 | 8 |
files[] = includes/MediaInternetTestHandler.inc |
9 | 9 |
|
10 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
11 |
version = "7.x-2.12"
|
|
10 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
11 |
version = "7.x-2.13"
|
|
12 | 12 |
core = "7.x" |
13 | 13 |
project = "media" |
14 |
datestamp = "1507905248"
|
|
14 |
datestamp = "1508430548"
|
|
15 | 15 |
|
drupal7/sites/all/modules/media/modules/media_migrate_file_types/media_migrate_file_types.info | ||
---|---|---|
8 | 8 |
|
9 | 9 |
configure = admin/structure/file-types/upgrade |
10 | 10 |
|
11 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
12 |
version = "7.x-2.12"
|
|
11 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
12 |
version = "7.x-2.13"
|
|
13 | 13 |
core = "7.x" |
14 | 14 |
project = "media" |
15 |
datestamp = "1507905248"
|
|
15 |
datestamp = "1508430548"
|
|
16 | 16 |
|
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.info | ||
---|---|---|
16 | 16 |
|
17 | 17 |
configure = admin/config/media/browser |
18 | 18 |
|
19 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
20 |
version = "7.x-2.12"
|
|
19 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
20 |
version = "7.x-2.13"
|
|
21 | 21 |
core = "7.x" |
22 | 22 |
project = "media" |
23 |
datestamp = "1507905248"
|
|
23 |
datestamp = "1508430548"
|
|
24 | 24 |
|
drupal7/sites/all/modules/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info | ||
---|---|---|
3 | 3 |
package = Media |
4 | 4 |
core = 7.x |
5 | 5 |
|
6 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
7 |
version = "7.x-2.12"
|
|
6 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
7 |
version = "7.x-2.13"
|
|
8 | 8 |
core = "7.x" |
9 | 9 |
project = "media" |
10 |
datestamp = "1507905248"
|
|
10 |
datestamp = "1508430548"
|
|
11 | 11 |
|
drupal7/sites/all/modules/media/modules/mediafield/mediafield.info | ||
---|---|---|
4 | 4 |
core = 7.x |
5 | 5 |
dependencies[] = media |
6 | 6 |
|
7 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
8 |
version = "7.x-2.12"
|
|
7 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
8 |
version = "7.x-2.13"
|
|
9 | 9 |
core = "7.x" |
10 | 10 |
project = "media" |
11 |
datestamp = "1507905248"
|
|
11 |
datestamp = "1508430548"
|
|
12 | 12 |
|
drupal7/sites/all/modules/media/tests/media_module_test.info | ||
---|---|---|
6 | 6 |
|
7 | 7 |
files[] = includes/MediaModuleTest.inc |
8 | 8 |
|
9 |
; Information added by Drupal.org packaging script on 2017-10-13
|
|
10 |
version = "7.x-2.12"
|
|
9 |
; Information added by Drupal.org packaging script on 2017-10-19
|
|
10 |
version = "7.x-2.13"
|
|
11 | 11 |
core = "7.x" |
12 | 12 |
project = "media" |
13 |
datestamp = "1507905248"
|
|
13 |
datestamp = "1508430548"
|
|
14 | 14 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules