From 58c39593b36c09cbe0ba7b6da93c64fa7e7f766f Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 15 Nov 2007 22:30:08 +0000 Subject: [PATCH] Update SWFUpload to 7.0-beta-3 (merged from branches/2.2.0, r44795) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@44896 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/AssetAdmin.php | 12 +++--------- code/LeftAndMain.php | 14 +++++--------- code/StatisticsAdmin.php | 2 +- javascript/Upload.js | 6 +++--- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/code/AssetAdmin.php b/code/AssetAdmin.php index 43090613..a1c2e73e 100755 --- a/code/AssetAdmin.php +++ b/code/AssetAdmin.php @@ -46,16 +46,10 @@ class AssetAdmin extends LeftAndMain { Requirements::javascript("cms/javascript/AssetAdmin_left.js"); Requirements::javascript("cms/javascript/AssetAdmin_right.js"); + Requirements::javascript("cms/javascript/CMSMain_upload.js"); + Requirements::javascript("cms/javascript/Upload.js"); Requirements::javascript("sapphire/javascript/Security_login.js"); - - // We don't want SWFUpload on linux, since it doesn't work - $browscap = new Browscap(); - $hitdata = $browscap->getBrowser(null, true); - if(!($hitdata['Platform'] && stristr($hitdata['Platform'], 'linux'))) { - Requirements::javascript("cms/javascript/CMSMain_upload.js"); - Requirements::javascript("cms/javascript/Upload.js"); - Requirements::javascript("jsparty/SWFUpload/SWFUpload.js"); - } + Requirements::javascript("jsparty/swfupload/swfupload.js"); // Include the right JS] // Hayden: This didn't appear to be used at all diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index cc6dbb1d..e419c01a 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -81,6 +81,9 @@ abstract class LeftAndMain extends Controller { Requirements::javascript('jsparty/tabstrip/tabstrip.js'); Requirements::css('jsparty/tabstrip/tabstrip.css'); + Requirements::css('cms/css/TinyMCEImageEnhancement.css'); + Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); + Requirements::javascript('cms/javascript/LeftAndMain.js'); Requirements::javascript('cms/javascript/LeftAndMain_left.js'); Requirements::javascript('cms/javascript/LeftAndMain_right.js'); @@ -128,15 +131,8 @@ abstract class LeftAndMain extends Controller { Requirements::javascript('sapphire/javascript/SelectionGroup.js'); Requirements::css('sapphire/css/SelectionGroup.css'); - // We don't want SWFUpload on linux, since it doesn't work - $browscap = new Browscap(); - $hitdata = $browscap->getBrowser(null, true); - if(!($hitdata['Platform'] && stristr($hitdata['Platform'], 'linux'))) { - Requirements::css('cms/css/TinyMCEImageEnhancement.css'); - Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); - Requirements::javascript('jsparty/SWFUpload/SWFUpload.js'); - Requirements::javascript('cms/javascript/Upload.js'); - } + Requirements::javascript('jsparty/swfupload/swfupload.js'); + Requirements::javascript('cms/javascript/Upload.js'); Requirements::themedCSS('typography'); diff --git a/code/StatisticsAdmin.php b/code/StatisticsAdmin.php index 2c401731..731f2527 100644 --- a/code/StatisticsAdmin.php +++ b/code/StatisticsAdmin.php @@ -51,7 +51,7 @@ class StatisticsAdmin extends LeftAndMain { Requirements::css("sapphire/css/SubmittedFormReportField.css"); Requirements::css('cms/css/TinyMCEImageEnhancement.css'); - Requirements::javascript("jsparty/SWFUpload/SWFUpload.js"); + Requirements::javascript("jsparty/swfupload/swfupload.js"); Requirements::javascript("cms/javascript/Upload.js"); Requirements::javascript("sapphire/javascript/Security_login.js"); Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js'); diff --git a/javascript/Upload.js b/javascript/Upload.js index d6698847..d5d9b22e 100644 --- a/javascript/Upload.js +++ b/javascript/Upload.js @@ -60,8 +60,8 @@ Upload.prototype = { file_validation_handler : Prototype.emptyFunction, file_cancelled_handler: Prototype.emptyFunction, - flash_url : 'jsparty/SWFUpload/SWFUpload.swf', // Relative to this file - ui_function: this.buildUI.bind(this), + flash_url : 'jsparty/swfupload/swfupload.swf', // Relative to this file + swfupload_loaded_handler: this.buildUI.bind(this), debug: false }); }, @@ -209,7 +209,7 @@ Upload.prototype = { */ browse: function() { - this.swfu.browse(); + this.swfu.selectFiles(); }, /**