Index: openacs-4/packages/ajax-filestorage-ui/catalog/ajax-filestorage-ui.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/catalog/ajax-filestorage-ui.en_US.ISO-8859-1.xml,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/ajax-filestorage-ui/catalog/ajax-filestorage-ui.en_US.ISO-8859-1.xml 18 Mar 2009 23:53:04 -0000 1.5
+++ openacs-4/packages/ajax-filestorage-ui/catalog/ajax-filestorage-ui.en_US.ISO-8859-1.xml 18 Apr 2009 13:49:26 -0000 1.6
@@ -50,4 +50,5 @@
Uploading ...
Views
Zip File (Will be extracted after upload)
+ Folders
Index: openacs-4/packages/ajax-filestorage-ui/lib/ajaxfs-include.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/lib/ajaxfs-include.adp,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/ajax-filestorage-ui/lib/ajaxfs-include.adp 18 Mar 2009 23:53:04 -0000 1.12
+++ openacs-4/packages/ajax-filestorage-ui/lib/ajaxfs-include.adp 18 Apr 2009 13:49:26 -0000 1.13
@@ -109,7 +109,9 @@
unsubscribe_notification:"#notifications.Unsubscribe#",
tools:"#ajax-filestorage-ui.Tools#",
tag:"#ajax-filestorage-ui.Tag#",
- views:"#ajax-filestorage-ui.Views#"
+ views:"#ajax-filestorage-ui.Views#",
+ no : "#acs-kernel.common_no#",
+ folders : "#ajax-filestorage-ui.Folders#"
}
var fsInstance = new ajaxfs({@options;noquote@});
Index: openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 18 Mar 2009 23:53:04 -0000 1.23
+++ openacs-4/packages/ajax-filestorage-ui/www/resources/ajaxfs.js 18 Apr 2009 13:49:27 -0000 1.24
@@ -608,7 +608,7 @@
var treepanel = new Ext.tree.TreePanel({
id:'treepanel',
- title:'Folders',
+ title:acs_lang_text.folders || 'Folders',
autoScroll:true,
animate:true,
enableDrag:false,
@@ -1112,6 +1112,10 @@
gridpanel.store.baseParams['package_id'] = this.config.package_id;
// gridpanel.store.baseParams['tag_id'] = '';
+ gridpanel.store.on('load',function(store,records) {
+ node.attributes.attributes.size = records.length+" items";
+ },{single:true})
+
// if the tree node is still loading, wait for it to expand before loading the grid
if(node.loading) {
node.on("expand", function() { this.store.load() }, gridpanel, {single:true});
@@ -1147,6 +1151,8 @@
var err_msg_txt = acs_lang_text.confirm_delete || "Are you sure you want to delete ";
var err_msg_txt2 = acs_lang_text.foldercontains || "This folder ";
+ var error_msg_txt = acs_lang_text.delete_error || "Sorry,there was an error trying to delete this item.";
+
var treepanel = this.layout.findById('treepanel');
if(grid.id=="filepanel") {
var filepanel = grid;
@@ -1247,17 +1253,17 @@
var selectednode = treepanel.getNodeById(treenodeid);
if (selectednode) {
var parentnode = selectednode.parentNode;
- parentnode.fireEevent("click",parentnode);
parentnode.removeChild(selectednode);
}
}
}
} else {
- ext.msg.alert(acs_lang_text.error || "error","sorry, we encountered an error.");
+ ext.msg.alert(acs_lang_text.error || "Error","sorry, we encountered an error.");
}
}
- var failure = function() {
+ var failure = function(o) {
+ var resultObj = Ext.decode(o.responseText);
Ext.Msg.alert(acs_lang_text.error || "Error",error_msg_txt + "
"+resultObj.error+"");
}
@@ -1500,9 +1506,11 @@
file_types : "*.*",
button_placeholder_id:"btnSwfUpload",
button_image_url : "/resources/ajax-filestorage-ui/resources/FullyTransparent_65x29.png",
- button_text:' BROWSE',
+ button_text:'BROWSE',
button_width: 61,
button_height: 16,
+ button_text_left_padding : 3,
+ button_text_top_padding : 0,
file_dialog_start_handler : fileDialogStart,
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
@@ -1525,7 +1533,7 @@
if(this.upldWindow == null) {
- if (!this.config.multi_file_upload || checkFlashVersion() < 9 || Ext.isLinux || Ext.isMac) {
+ if (!this.config.multi_file_upload || checkFlashVersion() < 10) {
/*** Single File Upload *******/
mode = 'single';
@@ -1567,7 +1575,7 @@
var msg_txt = acs_lang_text.upload_intro || "Click Upload to select a file to upload to the selected folder on the tree.";
var modal = false;
- var title = "Upload Files";
+ var title = acs_lang_text.uploadfile ||"Upload Files";
var uploadBody = new Ext.Panel({
id:'form_multi_addfile',
@@ -1576,9 +1584,9 @@
html: "
"+msg_txt+"
"
});
- var uploadBtns = [
- '',
- {
+ var uploadBtns = [{
+ text:''
+ }, {
text: acs_lang_text.upload || 'Upload',
scope:this,
handler: function() {
@@ -1621,7 +1629,7 @@
}
} else {
- if (!this.config.multi_file_upload || checkFlashVersion() < 9 || Ext.isLinux) {
+ if (!this.config.multi_file_upload || checkFlashVersion() < 10 ) {
document.getElementById('newfileform').reset();
document.getElementById('newfileform').folder_id.value = this.currentfolder;
}
@@ -1742,6 +1750,8 @@
// rename a file or folder in the right panel
renameItem : function(panel,i,e) {
+ var error_msg_txt = acs_lang_text.permission_denied_error || "Sorry, you do not have permission to rename this folder.";
+
if(panel.id == "treepanel") {
var node = panel.getSelectionModel().getSelectedNode();
Index: openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/fileprogress.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/fileprogress.js,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/fileprogress.js 27 Dec 2008 06:27:25 -0000 1.1
+++ openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/fileprogress.js 18 Apr 2009 13:49:27 -0000 1.2
@@ -124,6 +124,7 @@
setTimeout(function() { oSelf.Disappear(); }, rate);
} else {
this.fileProgressWrapper.style.display = "none";
+ this.fileProgressWrapper.parentNode.removeChild(this.fileProgressWrapper);
}
}
Index: openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/swfupload.js
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/swfupload.js,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/swfupload.js 27 Dec 2008 06:27:25 -0000 1.2
+++ openacs-4/packages/ajax-filestorage-ui/www/resources/swfupload/swfupload.js 18 Apr 2009 13:49:27 -0000 1.3
@@ -50,7 +50,7 @@
/* *************** */
SWFUpload.instances = {};
SWFUpload.movieCount = 0;
-SWFUpload.version = "2.2.0 Beta 3";
+SWFUpload.version = "2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR = {
QUEUE_LIMIT_EXCEEDED : -100,
FILE_EXCEEDS_SIZE_LIMIT : -110,
@@ -91,6 +91,27 @@
OPAQUE : "opaque"
};
+// Private: takes a URL, determines if it is relative and converts to an absolute URL
+// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
+SWFUpload.completeURL = function(url) {
+ if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
+ return url;
+ }
+
+ var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
+
+ var indexSlash = window.location.pathname.lastIndexOf("/");
+ if (indexSlash <= 0) {
+ path = "/";
+ } else {
+ path = window.location.pathname.substr(0, indexSlash) + "/";
+ }
+
+ return /*currentURL +*/ path + url;
+
+};
+
+
/* ******************** */
/* Instance Members */
/* ******************** */
@@ -104,11 +125,13 @@
// Upload backend settings
this.ensureDefault("upload_url", "");
+ this.ensureDefault("preserve_relative_urls", false);
this.ensureDefault("file_post_name", "Filedata");
this.ensureDefault("post_params", {});
this.ensureDefault("use_query_string", false);
this.ensureDefault("requeue_on_error", false);
this.ensureDefault("http_success", []);
+ this.ensureDefault("assume_success_timeout", 0);
// File Settings
this.ensureDefault("file_types", "*.*");
@@ -131,7 +154,8 @@
this.ensureDefault("button_text_left_padding", 0);
this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
this.ensureDefault("button_disabled", false);
- this.ensureDefault("button_placeholder_id", null);
+ this.ensureDefault("button_placeholder_id", "");
+ this.ensureDefault("button_placeholder", null);
this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
@@ -161,57 +185,21 @@
this.customSettings = this.settings.custom_settings;
// Update the flash url if needed
- if (this.settings.prevent_swf_caching) {
- this.settings.flash_url = this.settings.flash_url + "?swfuploadrnd=" + Math.floor(Math.random() * 999999999);
+ if (!!this.settings.prevent_swf_caching) {
+ this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
}
- delete this.ensureDefault;
-};
-
-SWFUpload.prototype.loadFlash = function () {
- if (this.settings.button_placeholder_id !== "") {
- this.replaceWithFlash();
- } else {
- this.appendFlash();
+ if (!this.settings.preserve_relative_urls) {
+ //this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
+ this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
+ this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
}
-};
-
-// Private: appendFlash gets the HTML tag for the Flash
-// It then appends the flash to the body
-SWFUpload.prototype.appendFlash = function () {
- var targetElement, container;
-
- // Make sure an element with the ID we are going to use doesn't already exist
- if (document.getElementById(this.movieName) !== null) {
- throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
- }
-
- // Get the body tag where we will be adding the flash movie
- targetElement = document.getElementsByTagName("body")[0];
-
- if (targetElement == undefined) {
- throw "Could not find the 'body' element.";
- }
-
- // Append the container and load the flash
- container = document.createElement("div");
- container.style.width = "1px";
- container.style.height = "1px";
- container.style.overflow = "hidden";
-
- targetElement.appendChild(container);
- container.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
-
- // Fix IE Flash/Form bug
- if (window[this.movieName] == undefined) {
- window[this.movieName] = this.getMovieElement();
- }
-
+ delete this.ensureDefault;
};
-// Private: replaceWithFlash replaces the button_placeholder element with the flash movie.
-SWFUpload.prototype.replaceWithFlash = function () {
+// Private: loadFlash replaces the button_placeholder element with the flash movie.
+SWFUpload.prototype.loadFlash = function () {
var targetElement, tempParent;
// Make sure an element with the ID we are going to use doesn't already exist
@@ -220,10 +208,10 @@
}
// Get the element where we will be placing the flash movie
- targetElement = document.getElementById(this.settings.button_placeholder_id);
+ targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
if (targetElement == undefined) {
- throw "Could not find the placeholder element.";
+ throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
}
// Append the container and load the flash
@@ -242,7 +230,7 @@
SWFUpload.prototype.getFlashHTML = function () {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
return ['