app/views/express_translate/options/languages.html.erb in express_translate-1.0.2 vs app/views/express_translate/options/languages.html.erb in express_translate-1.0.3

- old
+ new

@@ -170,78 +170,10 @@ }); $(".json").click(function(event) { event.preventDefault(); openInNewTab(window.location.origin + "/express_translate/service/" + $(event.target).attr("data") + ".json") - }); - - var obj = $(".lang"); - - obj.on('dragenter', function (e){ - e.stopPropagation(); - e.preventDefault(); - $(this).removeClass("add_files"); - }); - - obj.on('dragover', function (e){ - e.stopPropagation(); - e.preventDefault(); - $(this).addClass("add_files"); - }); - - obj.on('drop', function (e){ - $(this).removeClass("add_files"); - e.preventDefault(); - var files = e.originalEvent.dataTransfer.files; - handleFileUpload(files, obj); - }); - - obj.on('dragleave', function (e) { - $(this).removeClass("add_files"); - }); - - function handleFileUpload(files, obj) { - for (var i = 0; i < files.length; i++) { - var fd = new FormData(); - fd.append('file_yml', files[i]); - sendFileToServer(fd); - } - } - - function sendFileToServer(formData) { - var uploadURL ="/express_translate/import_yml"; - var extraData ={}; - var jqXHR = $.ajax({ - xhr: function() { - var xhrobj = $.ajaxSettings.xhr(); - if (xhrobj.upload) { - xhrobj.upload.addEventListener('progress', function(event) { - var percent = 0; - var position = event.loaded || event.position; - var total = event.total; - if (event.lengthComputable) { - percent = Math.ceil(position / total * 100); - } - }, false); - } - return xhrobj; - }, - url: uploadURL, - type: "POST", - contentType:false, - processData: false, - cache: false, - data: formData, - success: function(data){ - console.log(data) - $(".import").html("Import"); - setTimeout(function(){ - // window.location.reload(); - }, 100); - } - }); - } - + }); } runJavascriptsLanguage(); </script> \ No newline at end of file