app/assets/javascripts/caboose/admin_media_index.js in caboose-cms-0.9.202 vs app/assets/javascripts/caboose/admin_media_index.js in caboose-cms-0.9.203
- old
+ new
@@ -22,12 +22,11 @@
ajax_limit: 20,
init: function(params) {
var that = this;
for (var i in params)
- this[i] = params[i];
-
+ this[i] = params[i];
$("#uploader")
.empty()
.append($('<p/>')
.append($('<a/>').addClass('caboose-btn').attr('href', '#').html('Upload').click(function(e) { e.preventDefault(); that.toggle_uploader(); }))
.append($('<a/>').addClass('caboose-btn').attr('href', '#').html('Select All').click(function(e) { e.preventDefault(); that.select_all_media(); }))
@@ -37,10 +36,11 @@
that.refresh();
},
refresh: function()
{
+ //console.log("REFRESHING EVERYTHING");
var that = this;
that.refresh_categories();
that.refresh_media();
that.print_controls();
},
@@ -62,10 +62,11 @@
});
},
refresh_media: function()
{
+ //console.log("REFRESHING MEDIA");
var that = this;
$.ajax({
url: '/admin/media/json',
type: 'get',
async: false,
@@ -78,11 +79,10 @@
});
},
change_sort_order: function(list) {
var that = this;
- // console.log(list.toString());
$.ajax({
url: '/admin/media-categories/' + that.cat_id + '/sort-order',
type: 'put',
data: {
sort: list
@@ -160,11 +160,12 @@
mime_types: [{ title: "Upload files", extensions: "jpg,jpeg,png,gif,tif,tiff,mp3,wav,pdf,doc,docx,odt,odp,ods,ppt,pptx,xls,xlsx,zip,tgz,csv,txt" }] // Specify what files to browse for
},
flash_swf_url: '../../js/Moxie.swf', // Flash settings
silverlight_xap_url: '../../js/Moxie.xap', // Silverlight settings
init: {
- BeforeUpload: function(up, file) {
+ BeforeUpload: function(up, file) {
+ //console.log("BeforeUpload");
//up.settings.multipart_params["Content-Type"] = file.type;
$.ajax({
url: '/admin/media/pre-upload',
type: 'post',
data: {
@@ -173,17 +174,19 @@
file_type: file.type
},
success: function(resp) {},
async: false
});
- controller.refresh();
+ // controller.refresh();
},
FileUploaded: function(ip, file)
{
- that.refresh();
+ //console.log("FileUploaded");
+ // that.refresh();
},
UploadComplete: function(up, files) {
- that.refresh();
+ //console.log("UploadComplete");
+ that.refresh_media();
that.ajax_count = 0;
if (that.uploader)
{
$("#the_uploader").slideUp(400, function() {
$("#the_uploader").plupload('destroy');