Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MultiUpload Dialog #13851

Merged
merged 1 commit into from
Jun 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions _build/templates/default/sass/_browser.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
}

.modx-browser-thumb-wrap {
border: 1px solid transparent;
border: 1px solid $brandHover;
background: $white;
float: left;
margin: 4px 0 4px 4px;
overflow: hidden;
padding: 4px;
cursor: pointer;
}
.modx-browser-thumb-wrap.x-view-over {
border: 1px solid $brandHover;
border: 1px solid $brandSelectedColor;
padding: 4px;
}
.modx-browser-thumb-wrap.x-view-selected {
Expand Down
39 changes: 39 additions & 0 deletions _build/templates/default/sass/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,45 @@ hr {
}
}

.x-panel {
&.drag-n-drop {
z-index: 0;
&:before {
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
display: block;
content: ' ';
background: transparent url($imgPath + 'restyle/dragndrop.svg') no-repeat center;
background-size: 50% 50%;
opacity: .1;
z-index: -5;
}
& > .x-panel-bwrap {
background: transparent;
}
}
&.drag-over {
.x-form-field {
background: transparent;
}
&:after {
content: "";
top: 0;
right: 0;
bottom: 0;
left: 0;
position: absolute;
display: block;
opacity: 0.1;
background: forestgreen;
border: 5px solid darkgreen;
}
}
}

.x-panel-header {
background: none;
border-bottom: 1px solid #ddd;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

class modBrowserFilesRemoveProcessor extends modProcessor
{

/**
* @return array|string
*/
public function process()
{
$files = json_decode($this->getProperty('files'), true);
if (empty($files)) {
return $this->success();
}

$source = $this->getProperty('source', 1);
foreach ($files as $file) {
/** @var modProcessorResponse $response */
$response = $this->modx->runProcessor('browser/file/remove', [
'file' => $file,
'source' => $source,
]);
if ($response && $response->isError()) {
return $response->getResponse();
}
}

return !empty($response)
? $response->getResponse()
: $this->success();
}

}

return 'modBrowserFilesRemoveProcessor';
Binary file removed manager/assets/fileapi/FileAPI.flash.camera.swf
Binary file not shown.
Binary file removed manager/assets/fileapi/FileAPI.flash.image.swf
Binary file not shown.
Binary file removed manager/assets/fileapi/FileAPI.flash.swf
Binary file not shown.
46 changes: 41 additions & 5 deletions manager/assets/fileapi/FileAPI.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! FileAPI 2.0.19 - BSD | git://github.com/mailru/FileAPI.git
/*! FileAPI 2.0.25 - BSD | git://github.com/mailru/FileAPI.git
* FileAPI — a set of javascript tools for working with files. Multiupload, drag'n'drop and chunked file upload. Images: crop, resize and auto orientation by EXIF.
*/

Expand Down Expand Up @@ -107,6 +107,7 @@
userAgent = window.navigator.userAgent,
safari = /safari\//i.test(userAgent) && !/chrome\//i.test(userAgent),
iemobile = /iemobile\//i.test(userAgent),
insecureChrome = !safari && /chrome\//i.test(userAgent) && window.location.protocol === 'http:',

// https://github.com/blueimp/JavaScript-Load-Image/blob/master/load-image.js#L48
apiURL = (window.createObjectURL && window) || (window.URL && URL.revokeObjectURL && URL) || (window.webkitURL && webkitURL),
Expand Down Expand Up @@ -286,13 +287,14 @@
* FileAPI (core object)
*/
api = {
version: '2.0.19',
version: '2.0.25',

cors: false,
html5: true,
media: false,
formData: true,
multiPassResize: true,
insecureChrome: insecureChrome,

debug: false,
pingUrl: false,
Expand Down Expand Up @@ -1834,11 +1836,12 @@
evt[preventDefault]();

_type = 0;
onHover.call(evt[currentTarget], false, evt);

api.getDropFiles(evt, function (files, all){
onDrop.call(evt[currentTarget], files, all, evt);
});

onHover.call(evt[currentTarget], false, evt);
});
}
else {
Expand Down Expand Up @@ -3373,7 +3376,7 @@
el.style.height = _px(options.height);


if( api.html5 && html5 ){
if( api.html5 && html5 && !api.insecureChrome ){
// Create video element
var video = document.createElement('video');

Expand Down Expand Up @@ -3404,6 +3407,38 @@
callback('not_support_camera');
};

Camera.checkAlreadyCaptured = (function () {
var mediaDevices = navigator.mediaDevices,
MediaStreamTrack = window.MediaStreamTrack,
navigatorEnumerateDevices = navigator.enumerateDevices,
enumerateDevices;

if (mediaDevices && mediaDevices.enumerateDevices) {
enumerateDevices = function (callback) {
mediaDevices.enumerateDevices().then(callback);
};
} else if (MediaStreamTrack && MediaStreamTrack.getSources) {
enumerateDevices = MediaStreamTrack.getSources.bind(MediaStreamTrack);
} else if (navigatorEnumerateDevices) {
enumerateDevices = navigatorEnumerateDevices.bind(navigator);
} else {
enumerateDevices = function (fn) {
fn([]);
};
}

return function (callback) {
enumerateDevices(function (devices) {
var deviceExists = devices.some(function (device) {
return (device.kind === 'videoinput' || device.kind === 'video') && device.label;
});

callback(deviceExists);
});
};

})();


/**
* @class FileAPI.Camera.Shot
Expand Down Expand Up @@ -3501,6 +3536,7 @@
|| !api.html5 || !api.support.html5
|| (api.cors && !api.support.cors)
|| (api.media && !api.support.media)
|| api.insecureChrome
)
&& (function (){
var
Expand Down Expand Up @@ -4260,7 +4296,7 @@
var _each = api.each,
_cameraQueue = [];

if (api.support.flash && (api.media && (!api.support.media || !api.html5))) {
if (api.support.flash && (api.media && (!api.support.media || !api.html5 || api.insecureChrome))) {
(function () {
function _wrap(fn) {
var id = fn.wid = api.uid();
Expand Down
Loading