From 48f6aad1948fba8440b05b3fdec8b30fd2481c1d Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Wed, 25 Jun 2008 04:11:58 +0000 Subject: [PATCH] Merged revisions 54959 via svnmerge from svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.2.2 ........ r54959 | sminnee | 2008-05-22 18:13:24 +1200 (Thu, 22 May 2008) | 1 line Disable / fix flash uploading ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@56920 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CMSMain_upload.js | 3 +++ javascript/TinyMCEImageEnhancement.js | 31 ++++++++++++++------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/javascript/CMSMain_upload.js b/javascript/CMSMain_upload.js index 5146011f..1ae3b16a 100644 --- a/javascript/CMSMain_upload.js +++ b/javascript/CMSMain_upload.js @@ -6,6 +6,9 @@ CMSMain_upload = Class.create(); CMSMain_upload.prototype = { initialize: function() { + // This is disabled until we get it working reliably + return; + // We require flash 9 pv = getFlashPlayerVersion(); if(pv.major < 9) return; diff --git a/javascript/TinyMCEImageEnhancement.js b/javascript/TinyMCEImageEnhancement.js index 45d4d289..de913d4f 100644 --- a/javascript/TinyMCEImageEnhancement.js +++ b/javascript/TinyMCEImageEnhancement.js @@ -87,7 +87,7 @@ TinyMCEImageEnhancement.prototype = { var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(); var seconds = date.getSeconds() < 10 == 1 ? '0' + date.getSeconds() : date.getSeconds(); var currentDate = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds; - var folderName = $('NewFolderName').value; + var folderName = $('NewFolderName').value; this.folderID = folderID; var options = { method: 'post', @@ -106,7 +106,7 @@ TinyMCEImageEnhancement.prototype = { onFolderAddSuccess: function(transport) { statusMessage('Creating new folder'); - $('TreeDropdownField_Form_EditorToolbarImageForm_FolderID').itemTree = null; + $('TreeDropdownField_Form_EditorToolbarImageForm_FolderID').itemTree = null; $('TreeDropdownField_Form_EditorToolbarImageForm_FolderID').setValue(this.folderID); $('NewFolderName').value = ''; Element.show('AddFolder'); @@ -130,17 +130,17 @@ TinyMCEImageEnhancement.prototype = { * Called on window.onload */ - 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; - } - } + 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( @@ -163,6 +163,7 @@ TinyMCEImageEnhancement.prototype = { this.processInProgress = true; this.upload.setFolderID(this.getParentID()); $('UploadFiles').innerHTML = "Uploading ... 1/" + this.upload.getFilesToUpload(); + this.upload.startUpload(); }, uploadFileCompleteCallback: function(file,serverData) { @@ -193,13 +194,13 @@ TinyMCEImageEnhancement.prototype = { } //END OF HACK $('Image').reapplyBehaviour(); - this.addToTinyMCE = this.addToTinyMCE.bind(this); + this.addToTinyMCE = this.addToTinyMCE.bind(this); /* Don't insert images for now - this inserts the wrong image as images are now sorted by filename rather than date uploaded. var childNodes = $('Image').childNodes[0].childNodes; var newImages = $A(childNodes).slice(childNodes.length - this.filesUploaded); newImages.each(function(item) { tinyMCEImageEnhancement.addToTinyMCE(item.childNodes[0]); - }); + }); */ this.processInProgress = false; },