Bug Fix: Webcam Attachment in <= Win 7
Flash video overlay was hiding the Comments model dialog. The flash object is now hidden where <= Win 7 is detected (navigator.userAgent).
This commit is contained in:
@@ -490,9 +490,9 @@ Webcam.init();
|
||||
// Setup Dialog
|
||||
var dialog = $('<div>')
|
||||
.attr({
|
||||
id: 'disco_attachmentUpload_imageDialog',
|
||||
id: 'Disco_AttachmentUpload_ImageDialog',
|
||||
title: 'Upload Image',
|
||||
'class': 'dialog disco-attachmentUpload-imageDialog'
|
||||
'class': 'dialog Disco-AttachmentUpload-ImageDialog'
|
||||
});
|
||||
dialog.dialog({
|
||||
autoOpen: true,
|
||||
@@ -548,7 +548,7 @@ Webcam.init();
|
||||
var dialog = $('<div>')
|
||||
.attr({
|
||||
title: 'Upload File',
|
||||
'class': 'dialog disco-attachmentUpload-commentDialog'
|
||||
'class': 'dialog Disco-AttachmentUpload-CommentDialog'
|
||||
});
|
||||
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text"></input></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
|
||||
|
||||
@@ -591,6 +591,10 @@ Webcam.init();
|
||||
};
|
||||
|
||||
self._uploadImage = function (dataUri) {
|
||||
|
||||
if (self._hideFlashVideoOverlay())
|
||||
$('#webcam_movie_obj, #webcam_movie_embed').css('display', 'none');
|
||||
|
||||
var imageData = dataUri.replace(/^data\:image\/\w+\;base64\,/, '');
|
||||
|
||||
var imageBlob = new Blob([Webcam.base64DecToArr(imageData)], { type: 'image/jpeg' });
|
||||
@@ -601,6 +605,9 @@ Webcam.init();
|
||||
img.attr('src', dataUri);
|
||||
return true;
|
||||
}, function (result, comments) {
|
||||
if (self._hideFlashVideoOverlay())
|
||||
$('#webcam_movie_obj, #webcam_movie_embed').css('display', '');
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -664,6 +671,23 @@ Webcam.init();
|
||||
};
|
||||
// #endregion
|
||||
|
||||
// Flash Video hides Dom elements (comment dialog) in <= Win7
|
||||
self.__hideFlashVideoOverlay = null;
|
||||
self._hideFlashVideoOverlay = function () {
|
||||
if (self.__hideFlashVideoOverlay === null) {
|
||||
self.__hideFlashVideoOverlay = false;
|
||||
|
||||
// Test for: <= Windows 7
|
||||
try {
|
||||
var match = /(windows nt) ([\w.]+)/.exec(navigator.userAgent.toLowerCase());
|
||||
if (!!match && parseFloat(match[2]) <= 6.2)
|
||||
self.__hideFlashVideoOverlay = true;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
return self.__hideFlashVideoOverlay;
|
||||
}
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+27
-3
@@ -89,9 +89,9 @@
|
||||
// Setup Dialog
|
||||
var dialog = $('<div>')
|
||||
.attr({
|
||||
id: 'disco_attachmentUpload_imageDialog',
|
||||
id: 'Disco_AttachmentUpload_ImageDialog',
|
||||
title: 'Upload Image',
|
||||
'class': 'dialog disco-attachmentUpload-imageDialog'
|
||||
'class': 'dialog Disco-AttachmentUpload-ImageDialog'
|
||||
});
|
||||
dialog.dialog({
|
||||
autoOpen: true,
|
||||
@@ -147,7 +147,7 @@
|
||||
var dialog = $('<div>')
|
||||
.attr({
|
||||
title: 'Upload File',
|
||||
'class': 'dialog disco-attachmentUpload-commentDialog'
|
||||
'class': 'dialog Disco-AttachmentUpload-CommentDialog'
|
||||
});
|
||||
dialog.html('<table><tr><th>File Name:</th><td class="filename"></td></tr><tr><th>Comments:</th><td><input class="comments" type="text"></input></td></tr><tr><td class="thumbnail" colspan="2"><img /></td></tr></table>');
|
||||
|
||||
@@ -190,6 +190,10 @@
|
||||
};
|
||||
|
||||
self._uploadImage = function (dataUri) {
|
||||
|
||||
if (self._hideFlashVideoOverlay())
|
||||
$('#webcam_movie_obj, #webcam_movie_embed').css('display', 'none');
|
||||
|
||||
var imageData = dataUri.replace(/^data\:image\/\w+\;base64\,/, '');
|
||||
|
||||
var imageBlob = new Blob([Webcam.base64DecToArr(imageData)], { type: 'image/jpeg' });
|
||||
@@ -200,6 +204,9 @@
|
||||
img.attr('src', dataUri);
|
||||
return true;
|
||||
}, function (result, comments) {
|
||||
if (self._hideFlashVideoOverlay())
|
||||
$('#webcam_movie_obj, #webcam_movie_embed').css('display', '');
|
||||
|
||||
if (!result)
|
||||
return;
|
||||
|
||||
@@ -263,6 +270,23 @@
|
||||
};
|
||||
// #endregion
|
||||
|
||||
// Flash Video hides Dom elements (comment dialog) in <= Win7
|
||||
self.__hideFlashVideoOverlay = null;
|
||||
self._hideFlashVideoOverlay = function () {
|
||||
if (self.__hideFlashVideoOverlay === null) {
|
||||
self.__hideFlashVideoOverlay = false;
|
||||
|
||||
// Test for: <= Windows 7
|
||||
try {
|
||||
var match = /(windows nt) ([\w.]+)/.exec(navigator.userAgent.toLowerCase());
|
||||
if (!!match && parseFloat(match[2]) <= 6.2)
|
||||
self.__hideFlashVideoOverlay = true;
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
return self.__hideFlashVideoOverlay;
|
||||
}
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user