From fac5e576f1a1943666570f79ecb55cdd54d72012 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 15 Nov 2007 22:31:57 +0000 Subject: [PATCH] #1755 - Can't upload any files using the 'Upload' tab on a folder in Files and Images section (merged from branches/2.2.0, r44824) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@44900 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CMSMain_upload.js | 9 ++++++++- javascript/TinyMCEImageEnhancement.js | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/javascript/CMSMain_upload.js b/javascript/CMSMain_upload.js index 7f22dc05..d6dca3ee 100644 --- a/javascript/CMSMain_upload.js +++ b/javascript/CMSMain_upload.js @@ -5,7 +5,14 @@ */ CMSMain_upload = Class.create(); CMSMain_upload.prototype = { - initialize: function() { + initialize: function() { + // Due to a bug in the flash plugin on Linux and Mac, we need at least version 9.0.64 to use SWFUpload + if(navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) { + pv = getFlashPlayerVersion(); + if(pv.major < 9 || (pv.major == 9 && pv.minor == 0 && pv.rev < 64)) { + return; + } + } this.iframe = window.top.document.getElementById('AssetAdmin_upload'); this.onLoad(); }, diff --git a/javascript/TinyMCEImageEnhancement.js b/javascript/TinyMCEImageEnhancement.js index d3f67efa..5f1cdd3e 100644 --- a/javascript/TinyMCEImageEnhancement.js +++ b/javascript/TinyMCEImageEnhancement.js @@ -5,7 +5,7 @@ TinyMCEImageEnhancement = Class.create(); TinyMCEImageEnhancement.prototype = { initialize: function() { - this.filesUploaed = 0; + this.filesUploaded = 0; this.processInProgress = false; Event.observe(window,'load',this.onWindowLoad.bind(this)); }, @@ -130,7 +130,18 @@ TinyMCEImageEnhancement.prototype = { * Called on window.onload */ - onWindowLoad: function() { + onWindowLoad: function() { + // Due to a bug in the flash plugin on Linux and Mac, we need at least version 9.0.64 to use SWFUpload + if(navigator.appVersion.indexOf("Mac") != -1 || navigator.appVersion.indexOf("X11") != -1 || navigator.appVersion.indexOf("Linux") != -1) { + pv = getFlashPlayerVersion(); + if(pv.major < 9 || (pv.major == 9 && pv.minor == 0 && pv.rev < 64)) { + $('AddFolderGroup').style.display = 'none'; + $('PipeSeparator').style.display = 'none'; + $('UploadGroup').style.display = 'none'; + return; + } + } + if($('FolderID') != null) { this.upload = new Upload( {