\
@@ -753,8 +677,6 @@ function setupCreateFileDialog(){
$('#files'+id+'cancel_upload').click(function(){
uploader.cancel();
})
-
- //$('#upload-progress',pb_dialog).progressbar({value:0});
},
onProgress: function(id, fileName, loaded, total){
//update upload dialog with current progress
@@ -773,7 +695,7 @@ function setupCreateFileDialog(){
$('#files'+id+'progressBar').remove();
}
- //Inform complete upload, destroy upload dialog, refresh img list
+ //Inform complete upload, destroy upload dialog, refresh file list
$('div#pb_dialog').foundation('reveal', 'close')
return false;
@@ -787,19 +709,8 @@ function setupCreateFileDialog(){
file_input = input; return false;
};
-
-
$('#create_file_submit',dialog).click(function(){
- var exit = false;
var upload = false;
- $('.img_man',this).each(function(){
- if (!$('input',this).val().length){
- notifyError(tr("There are mandatory parameters missing"));
- exit = true;
- return false;
- }
- });
- if (exit) { return false; }
var ds_id = $('#file_datastore',dialog).val();
if (!ds_id){
@@ -807,47 +718,39 @@ function setupCreateFileDialog(){
return false;
};
- var img_json = {};
+ var file_json = {};
- var name = $('#img_name',dialog).val();
- img_json["NAME"] = name;
+ var name = $('#file_name',dialog).val();
+ file_json["NAME"] = name;
- var desc = $('#img_desc',dialog).val();
+ var desc = $('#file_desc',dialog).val();
if (desc.length){
- img_json["DESCRIPTION"] = desc;
+ file_json["DESCRIPTION"] = desc;
}
- var type = $('#img_type',dialog).val();
- img_json["TYPE"]= type;
+ var type = $('#file_type',dialog).val();
+ file_json["TYPE"]= type;
switch ($('#src_path_select input:checked',dialog).val()){
case "path":
- path = $('#img_path',dialog).val();
- if (path) img_json["PATH"] = path;
+ path = $('#file_path',dialog).val();
+ if (path) file_json["PATH"] = path;
break;
case "upload":
upload=true;
break;
}
- //Time to add custom attributes
- $('#custom_var_file_box option',$create_file_dialog).each(function(){
- var attr_name = $(this).attr('name');
- var attr_value = $(this).val();
- img_json[attr_name] = attr_value;
- });
-
- img_obj = { "image" : img_json,
+ file_obj = { "image" : file_json,
"ds_id" : ds_id};
-
//we this is an file upload we trigger FileUploader
//to start the upload
if (upload){
uploader._onInputChange(file_input);
} else {
- Sunstone.runAction("File.create", img_obj);
+ Sunstone.runAction("File.create", file_obj);
};
$create_file_dialog.foundation('reveal', 'close')
@@ -863,13 +766,13 @@ function setupCreateFileDialog(){
return false;
};
- var img_obj = {
+ var file_obj = {
"image" : {
"image_raw" : template
},
"ds_id" : ds_id
};
- Sunstone.runAction("File.create",img_obj);
+ Sunstone.runAction("File.create",file_obj);
$create_file_dialog.foundation('reveal', 'close')
return false;
});
@@ -892,7 +795,7 @@ function popUpCreateFileDialog(){
$('#file_datastore_raw',$create_file_dialog).html(datastores_str);
$create_file_dialog.foundation().foundation('reveal', 'open');
- $("input#img_name",$create_file_dialog).focus();
+ $("input#file_name",$create_file_dialog).focus();
}
// Set the autorefresh interval for the datatable
diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js
index e3d1e35a4a..4ccd286793 100644
--- a/src/sunstone/public/js/plugins/images-tab.js
+++ b/src/sunstone/public/js/plugins/images-tab.js
@@ -33,172 +33,172 @@ var create_image_tmpl ='