var upload1_count = 0; var upload2_count = 0; var upload1, upload2; window.onload = function() { upload1 = new SWFUpload({ // Backend Settings upload_url: "/service/upload", post_params: param.image, // File Upload Settings file_size_limit : "2048", // 2MB file_types : "*.jpg;*.gif;*.png", file_types_description : "Image Files", file_upload_limit : "5", file_queue_limit : "5", // Event Handler Settings (all my handlers are in the Handler.js file) file_dialog_start_handler : fileDialogStart, file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_start_handler : uploadStart, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, // Button Settings button_image_url : "/static/img/uploadbtn.gif", button_placeholder_id : "spanButtonPlaceholder1", button_width: 82, button_height: 38, // Flash Settings flash_url : "/static/lib/swfupload/swfupload.swf", custom_settings : { progressTarget : "fsUploadProgress1", cancelButtonId : "btnCancel1" }, // Debug Settings debug: false }); upload2 = new SWFUpload({ // Backend Settings upload_url: "/service/upload", post_params: param.voice, // File Upload Settings file_size_limit : "20480", // 20mb file_types : "*.mp3", file_types_description : "MP3 Files", file_upload_limit : "1", file_queue_limit : "1", // Event Handler Settings (all my handlers are in the Handler.js file) file_dialog_start_handler : fileDialogStart, file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_start_handler : uploadStart, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, // Button Settings button_image_url : "/static/img/uploadbtn.gif", button_placeholder_id : "spanButtonPlaceholder2", button_width: 82, button_height: 38, // Flash Settings flash_url : "/static/lib/swfupload/swfupload.swf", custom_settings : { progressTarget : "fsUploadProgress2", cancelButtonId : "btnCancel2" }, // Debug Settings debug: false }); } var mp3player = { loaded : function(){ // Local copy of jQuery selectors, for performance. var my_jPlayer = $("#jquery_jplayer"), my_trackName = $("#jp_container .track-name"), my_playState = $("#jp_container .play-state"), my_extraPlayInfo = $("#jp_container .extra-play-info"); // Some options var opt_play_first = false, // If true, will attempt to auto-play the default track on page loads. No effect on mobile devices, like iOS. opt_auto_play = false, // If true, when a track is selected, it will auto-play. opt_text_playing = "Now playing", // Text when playing opt_text_selected = "Track selected"; // Text when not playing // Change the time format $.jPlayer.timeFormat.padMin = false; $.jPlayer.timeFormat.padSec = false; $.jPlayer.timeFormat.sepMin = " min "; $.jPlayer.timeFormat.sepSec = " sec"; // Initialize the play state text my_playState.text(opt_text_selected); // Instance jPlayer my_jPlayer.jPlayer({ ready: function () { }, timeupdate: function(event) { my_extraPlayInfo.text(parseInt(event.jPlayer.status.currentPercentAbsolute, 10) + "%"); }, play: function(event) { }, pause: function(event) { }, ended: function(event) { }, swfPath: "/static/lib/jplayer", cssSelectorAncestor: "#jp_container", supplied: "mp3", solution:"flash,html" }); // Create click handlers for the different tracks $(".jp-play").click(function(e) { my_jPlayer.jPlayer("setMedia", { mp3: $(this).attr('rel'), errorAlerts : true, warningAlerts : false }); my_jPlayer.jPlayer("play"); $('#player_status').show(); $(this).blur(); return false; }); $('.jp-stop').click(function(e){ $('#player_status').hide(); }); $('.voice_del').click(function(e) { $(this).deleteatt({ 'id':$(this).attr('rel'), 'url':'/service/delatt', 'content':'是否删除'+$(this).next('h4').html(), 'item_prefix':'thumbItems_', 'callback': function(){ upload2.setStats({successful_uploads:0}); upload2.setFileUploadLimit(1); my_jPlayer.jPlayer( "stop" ); } }); }); }, makeHtml : function(data){ html = '