diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index 2d21b1cc96..a94366dc7a 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -624,66 +624,71 @@ function setupCreateFileDialog(){ var file_obj; - var file_uploader = new Resumable({ - target: '/upload_chunk', - chunkSize: 10*1024*1024, - maxFiles: 1, - testChunks: false, - query: { - csrftoken: csrftoken - } - }); - file_uploader.assignBrowse($('#files_file-uploader-input',dialog)[0]); + if (getInternetExplorerVersion() > -1) { + $("#file_uploader").attr("disabled", "disabled"); + } else { + var file_uploader = new Resumable({ + target: '/upload_chunk', + chunkSize: 10*1024*1024, + maxFiles: 1, + testChunks: false, + query: { + csrftoken: csrftoken + } + }); - var fileName = ''; - var file_input = false; + file_uploader.assignBrowse($('#files_file-uploader-input',dialog)[0]); - file_uploader.on('fileAdded', function(file){ - fileName = file.fileName; - file_input = fileName; - }); + var fileName = ''; + var file_input = false; - file_uploader.on('uploadStart', function() { - $('#files_upload_progress_bars').append('
\ -
\ - '+tr("Uploading...")+'\ -
\ -
\ -
\ - \ + file_uploader.on('fileAdded', function(file){ + fileName = file.fileName; + file_input = fileName; + }); + + file_uploader.on('uploadStart', function() { + $('#files_upload_progress_bars').append('
\ +
\ + '+tr("Uploading...")+'\
\ -
'+fileName+'
\ -
\ -
'); - }); +
\ +
\ + \ +
\ +
'+fileName+'
\ +
\ +
'); + }); - file_uploader.on('progress', function() { - $('span.meter', $('div[id="files-'+fileName+'-progressBar"]')).css('width', file_uploader.progress()*100.0+'%') - }); + file_uploader.on('progress', function() { + $('span.meter', $('div[id="files-'+fileName+'-progressBar"]')).css('width', file_uploader.progress()*100.0+'%') + }); - file_uploader.on('fileSuccess', function(file) { - $('div[id="files-'+fileName+'-info"]').text(tr('Registering in OpenNebula')); - $.ajax({ - url: '/upload', - type: "POST", - data: { - csrftoken: csrftoken, - img : JSON.stringify(file_obj), - file: fileName, - tempfile: file.uniqueIdentifier - }, - success: function(){ - notifyMessage("File uploaded correctly"); - $('div[id="files-'+fileName+'-progressBar"]').remove(); - Sunstone.runAction("File.refresh"); - }, - error: function(response){ - onError({}, OpenNebula.Error(response)); - $('div[id="files-'+fileName+'-progressBar"]').remove(); - } - }); - }); + file_uploader.on('fileSuccess', function(file) { + $('div[id="files-'+fileName+'-info"]').text(tr('Registering in OpenNebula')); + $.ajax({ + url: '/upload', + type: "POST", + data: { + csrftoken: csrftoken, + img : JSON.stringify(file_obj), + file: fileName, + tempfile: file.uniqueIdentifier + }, + success: function(){ + notifyMessage("File uploaded correctly"); + $('div[id="files-'+fileName+'-progressBar"]').remove(); + Sunstone.runAction("File.refresh"); + }, + error: function(response){ + onError({}, OpenNebula.Error(response)); + $('div[id="files-'+fileName+'-progressBar"]').remove(); + } + }); + }); + } $('#create_file_form_easy',dialog).submit(function(){ var upload = false; diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index 07df19b891..a395851888 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -926,66 +926,70 @@ function initialize_create_image_dialog(dialog) { var img_obj; - var uploader = new Resumable({ - target: '/upload_chunk', - chunkSize: 10*1024*1024, - maxFiles: 1, - testChunks: false, - query: { - csrftoken: csrftoken - } - }); + if (getInternetExplorerVersion() > -1) { + $("#upload_image").attr("disabled", "disabled"); + } else { + var uploader = new Resumable({ + target: '/upload_chunk', + chunkSize: 10*1024*1024, + maxFiles: 1, + testChunks: false, + query: { + csrftoken: csrftoken + } + }); - uploader.assignBrowse($('#file-uploader-input',dialog)); + uploader.assignBrowse($('#file-uploader-input',dialog)); - var fileName = ''; - var file_input = false; + var fileName = ''; + var file_input = false; - uploader.on('fileAdded', function(file){ - fileName = file.fileName; - file_input = fileName; - }); + uploader.on('fileAdded', function(file){ + fileName = file.fileName; + file_input = fileName; + }); - uploader.on('uploadStart', function() { - $('#upload_progress_bars').append('
\ -
\ - '+tr("Uploading...")+'\ -
\ -
\ -
\ - \ + uploader.on('uploadStart', function() { + $('#upload_progress_bars').append('
\ +
\ + '+tr("Uploading...")+'\
\ -
'+fileName+'
\ -
\ -
'); - }); +
\ +
\ + \ +
\ +
'+fileName+'
\ +
\ +
'); + }); - uploader.on('progress', function() { - $('span.meter', $('div[id="'+fileName+'progressBar"]')).css('width', uploader.progress()*100.0+'%') - }); + uploader.on('progress', function() { + $('span.meter', $('div[id="'+fileName+'progressBar"]')).css('width', uploader.progress()*100.0+'%') + }); - uploader.on('fileSuccess', function(file) { - $('div[id="'+fileName+'-info"]').text(tr('Registering in OpenNebula')); - $.ajax({ - url: '/upload', - type: "POST", - data: { - csrftoken: csrftoken, - img : JSON.stringify(img_obj), - file: fileName, - tempfile: file.uniqueIdentifier - }, - success: function(){ - notifyMessage("Image uploaded correctly"); - $('div[id="'+fileName+'progressBar"]').remove(); - Sunstone.runAction("Image.refresh"); - }, - error: function(response){ - onError({}, OpenNebula.Error(response)); - $('div[id="'+fileName+'progressBar"]').remove(); - } - }); - }); + uploader.on('fileSuccess', function(file) { + $('div[id="'+fileName+'-info"]').text(tr('Registering in OpenNebula')); + $.ajax({ + url: '/upload', + type: "POST", + data: { + csrftoken: csrftoken, + img : JSON.stringify(img_obj), + file: fileName, + tempfile: file.uniqueIdentifier + }, + success: function(){ + notifyMessage("Image uploaded correctly"); + $('div[id="'+fileName+'progressBar"]').remove(); + Sunstone.runAction("Image.refresh"); + }, + error: function(response){ + onError({}, OpenNebula.Error(response)); + $('div[id="'+fileName+'progressBar"]').remove(); + } + }); + }); + } $('#create_image',dialog).submit(function(){ $create_image_dialog = dialog; diff --git a/src/sunstone/public/js/plugins/support-tab.js b/src/sunstone/public/js/plugins/support-tab.js index f2f3aaae74..781a2787c7 100644 --- a/src/sunstone/public/js/plugins/support-tab.js +++ b/src/sunstone/public/js/plugins/support-tab.js @@ -130,10 +130,10 @@ var support_actions = { type: "custom", call: function(){ Sunstone.popUpFormPanel( - "create_support_request_form", - "support-tab", - "create", - false, + "create_support_request_form", + "support-tab", + "create", + false, function(context){}); } }, @@ -209,7 +209,7 @@ var support_buttons = { var support_tab = { //title: ' Support"), - title: + title: ' Support' + '
'+ ''+ '
'; } + + +function getInternetExplorerVersion(){ +// Returns the version of Internet Explorer or a -1 +// (indicating the use of another browser). + var rv = -1; // Return value assumes failure. + if (navigator.appName == 'Microsoft Internet Explorer') + { + var ua = navigator.userAgent; + var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); + if (re.exec(ua) != null) + rv = parseFloat( RegExp.$1 ); + } + return rv; +}