# HG changeset patch # User rougeronj # Date 1360923474 -3600 # Node ID 3b88847289d1287c9631d2264ef8f1fd9347b835 # Parent 5bb3aec02883b8faf1d3a9ecdcf2109b0709113d Add references to chunked_uploads diff -r 5bb3aec02883 -r 3b88847289d1 src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html --- a/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Thu Feb 14 16:37:27 2013 +0100 +++ b/src/ldt/ldt/ldt_utils/templates/ldt/ldt_utils/create_content.html Fri Feb 15 11:17:54 2013 +0100 @@ -177,8 +177,8 @@ - - - - + + + + {% endblock %} diff -r 5bb3aec02883 -r 3b88847289d1 src/ldt/ldt/ldt_utils/urls.py --- a/src/ldt/ldt/ldt_utils/urls.py Thu Feb 14 16:37:27 2013 +0100 +++ b/src/ldt/ldt/ldt_utils/urls.py Fri Feb 15 11:17:54 2013 +0100 @@ -75,5 +75,5 @@ url(r'^space/upload/$', 'views.content.upload'), url(r'^space/removetempfile/$', 'views.content.remove_temp_file'), url(r'^space/getduration/$', 'views.content.get_duration'), - (r'^chunked_uploads/', include('chunked_uploads.urls')), + url(r'^chunked_uploads/', include('chunked_uploads.urls')), ) diff -r 5bb3aec02883 -r 3b88847289d1 src/ldt/ldt/settings.py --- a/src/ldt/ldt/settings.py Thu Feb 14 16:37:27 2013 +0100 +++ b/src/ldt/ldt/settings.py Fri Feb 15 11:17:54 2013 +0100 @@ -35,6 +35,7 @@ 'guardian', 'sorl.thumbnail', 'tastypie', + 'chunked_uploads', ) MIDDLEWARE_CLASSES = ( diff -r 5bb3aec02883 -r 3b88847289d1 src/ldt/ldt/static/ldt/css/ldtform.css --- a/src/ldt/ldt/static/ldt/css/ldtform.css Thu Feb 14 16:37:27 2013 +0100 +++ b/src/ldt/ldt/static/ldt/css/ldtform.css Fri Feb 15 11:17:54 2013 +0100 @@ -163,7 +163,7 @@ } #media_fields_div { - width : 338px; + width : 300px; height : 50px; margin-top: 10px 0px; padding-left: 10px; diff -r 5bb3aec02883 -r 3b88847289d1 src/ldt/ldt/static/ldt/js/projectscontents.js --- a/src/ldt/ldt/static/ldt/js/projectscontents.js Thu Feb 14 16:37:27 2013 +0100 +++ b/src/ldt/ldt/static/ldt/js/projectscontents.js Fri Feb 15 11:17:54 2013 +0100 @@ -1,4 +1,4 @@ - + function init_events_base(base_node, embed_url) { $('.imageline',base_node).each(function(i) { @@ -395,17 +395,11 @@ var h = $(element).innerHeight() + 10; var w = $(element).innerWidth() + 10; } - + nm.sizes.minH = h + 10; nm.sizes.minW = w; iframe.height(h); iframe.width(w); - - if ($.browser.mozilla && createcontent) { - $(".nyroModalCont", parent.window.document).height(h+10); - } else { - nm.resize(true); - } } // @@ -421,7 +415,8 @@ $("#close_button").click(function (e) { e.preventDefault(); parent.$.nmTop().close(); - }); + }); + $("#submit_button_write").click(function(e) { $(".submitcontent-loader-content").show(); resize_modal_window($("#add_content"), true); @@ -439,103 +434,22 @@ $('#my_form').bind('submit', function() { window.submit_asked = true; if($('#id_content-media_input_type').val()=="upload"){ - if(window.upload_from_local_done==false){ - // The form has sent but the uploading has not ended. - if($('#upload_progress_info').children().size()>0){ - $('#progress_info').remove(); - } - $('#upload_progress_info').append('
' + wait_label + '.
' + cancel_label + '.
' + success_label + '.
'); - $("#upload_progress_bar > div").css({ 'background': '#90ffa8' }); - window.upload_from_local_done = true; - // Now that the file is uploaded, we submit the form if asked - if(window.submit_asked==true){ - $('#my_form').submit(); - } - else{ - // We ask the uploaded media's duration - if(window.ask_duration_url){ - $.ajax({ - type: "GET", - url: window.ask_duration_url, - data: "filename="+ $('#id_media-local_file_name').val(), - cache: false, - success: function(data, status, request){ - if(data && data!=""){ - $('#id_content-duration').val(data); - } - } - }); - } - } - } - catch (ex) { - //this.debug(ex); - } - }, - file_queued_handler : displayUploadPath, - file_dialog_complete_handler: function() { - window.submit_asked = false; - this.startUpload(); - } - //upload_complete_handler: function() { this.startUpload(); }, - }); } + function displayUploadPath(file) { try { $('#id_media-local_file_name').val(file.name); @@ -544,62 +458,6 @@ //this.debug(ex); } } -function startLocalUpload(){ - swfupload.startUpload(); -} -function uploadProgress(file, bytesLoaded, bytesTotal) { - try { - var percent = Math.ceil((bytesLoaded / bytesTotal) * 100); - $("#upload_progress_bar").progressbar({ value: percent }); - } - catch (ex) { - //this.debug(ex); - } -} -function cancelSwfUpload(){ - swfupload.cancelUpload(); - if($('#media_field_upload').has($('#cancelupload')).length==0){ - $('#cancelupload').remove(); - } -} -function uploadError(file, errorCode, message) { - try { - if($('#upload_progress_info').children().size()>0){ - $('#progress_info').remove(); - } - switch (errorCode) { - case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: - $('#upload_progress_info').append('' + "Error Code: HTTP Error, File name: " + file.name + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED: - $('#upload_progress_info').append('' + "Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.IO_ERROR: - $('#upload_progress_info').append('' + "Error Code: IO Error, File name: " + file.name + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR: - $('#upload_progress_info').append('' + "Error Code: Security Error, File name: " + file.name + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED: - $('#upload_progress_info').append('' + "Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED: - $('#upload_progress_info').append('' + "Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '
'); - break; - case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: - $('#upload_progress_info').append('' + "Error Code: FILE_CANCELLED" + '
'); - break; - case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED: - $('#upload_progress_info').append('' + "STOPPED" + '
'); - break; - default: - $('#upload_progress_info').append('' + "unhandled error: File name: " + file.name + ", File size: " + file.size + ", Message: " + message + '
'); - break; - } - } catch (ex) { - //this.debug(ex); - } -} // Test the value of the URL from the form to load a picture in case it is a youtube video function testUrlValue(e){