<script type="text/javascript">$(function() {ldelim}$("#uploader").pluploadQueue({ldelim}runtimes:'html5,html4',url:'{$backend_url}/{href_entry key="be_uploader"}?t={$smarty.get.t|sanitize}',multipart: true,multipart_params: {ldelim}'UFSUID': ''{rdelim},max_files: '{if $demo eq "1"}2{else}0{/if}',chunk_size: '1024kb',rename : false,prevent_duplicates: true,dragdrop: true,max_file_size : '{$file_limit}mb',filters : [{ldelim}title : "{lang_entry key="frontend.global.v.p.c"}", extensions : "{$allowed_file_cfg}"{rdelim}],views : {ldelim}list: true,thumbs: true,active: 'thumbs'{rdelim},flash_swf_url : '{$javascript_url}/uploader/Moxie.swf',silverlight_xap_url : '{$javascript_url}/uploader/Moxie.xap'{rdelim});$("#sq").focus();var uploader = $('#uploader').pluploadQueue();uploader.bind('Init', function() {ldelim}uploader.disableBrowse(true);{rdelim});uploader.bind('UploadComplete', function() {ldelim}$.post("?t={$smarty.get.t}&do=form-update", $('.c-entry-form-edit').serialize(), function(data){ldelim}$('#cb-response-wrap-no').html(data);{rdelim});uploader.splice();$('#cb-response-wrap').show();$("#dobrowse .start").addClass("off");$("#uploader_browse").removeClass("set");$(document).keyup(function(e) {ldelim}if(e.keyCode === 27)return;{rdelim});{rdelim});uploader.bind('FilesAdded', function(up, files) {ldelim}if ($("#assign-username").val() == "") {ldelim}$("#sq").focus();alert("Please assign username first!");up.splice();return;{rdelim}if (up.settings.max_files > 0 && up.files.length >= up.settings.max_files) {ldelim}up.splice(up.settings.max_files);{rdelim}if (up.files.length > 0) {ldelim}$("#dobrowse .start").removeClass("off").addClass("set");{rdelim}{rdelim});uploader.bind('FilesRemoved', function(up, files) {ldelim}if (up.files.length < up.settings.max_files) {ldelim}{rdelim}if (up.files.length == 0) {ldelim}$("#dobrowse .start").addClass("off");$("#uploader_browse").removeClass("set");{rdelim}{rdelim});uploader.bind('BeforeUpload', function(up, files) {ldelim}var uploader = $('#uploader').pluploadQueue();uploader.settings.multipart_params.UFSUID = $("#assign-username").val();$("#UFNAME").val(files.name);$("#UFSIZE").val(files.size);$(document).keyup(function(e) {ldelim}if(e.keyCode === 27)uploader.stop();{rdelim});{rdelim});uploader.bind('UploadProgress', function(up) {ldelim}$(".plupload_total_file_size").html(parseFloat(up.total.bytesPerSec/(1024)).toFixed(2) + " KiB/s");{rdelim});uploader.bind('Error', function(up, err) {ldelim}$("#notice-message").detach();var ht = '<div class="error-message" id="error-message"><p class="error-message-text">Error #' + err.code + ': ' + err.message + '</p></div>';$(ht).insertBefore("#upload-wrapper");var uploader = $('#uploader').pluploadQueue();uploader.stop();uploader.splice();{rdelim});uploader.bind('FileUploaded', function(up) {ldelim}var the_form = "#upload-form";var the_url = $(the_form).attr("action");$.post(the_url, $(the_form).serialize(), function(data) {ldelim}$("#form-response").html(data);{rdelim});{rdelim});$("#upload_category").change(function(){ldelim}{rdelim});$("#upload_category").trigger("change");$("#sq").autocomplete({ldelim}type: "post",serviceUrl: "?do=autocomplete",onSearchStart: function() {ldelim}$(this).next().val("");$(".sb-icon-search").addClass("off").removeClass("set");$("#uploader_browse").addClass("off").removeClass("set");var uploader = $('#uploader').pluploadQueue();uploader.disableBrowse(true);uploader.stop();uploader.splice();{rdelim},onSelect: function (suggestion) {ldelim}$(this).next().val(suggestion.data);$(".sb-icon-search").removeClass("off").addClass("set");$("#uploader_browse").removeClass("off");var uploader = $('#uploader').pluploadQueue();uploader.disableBrowse(false);{rdelim}{rdelim});$("#sq").keypress(function(event) {ldelim}var keycode = (event.keyCode ? event.keyCode : event.which);if(keycode == '13') {ldelim}event.preventDefault();{rdelim}{rdelim});SelectList.init("file_category_0");{rdelim});</script>
