Skip to content

Commit

Permalink
0.2.2 リリース
Browse files Browse the repository at this point in the history
  • Loading branch information
koda-masaru committed Dec 30, 2014
1 parent 307e78e commit 679eb51
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>redcomet</groupId>
<artifactId>knowledge</artifactId>
<packaging>war</packaging>
<version>0.2.1</version>
<version>0.2.2</version>
<name>webapp for knowledge</name>
<url>https://support-project.org/</url>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package redcomet.knowledge.deploy;

import java.io.File;
import java.util.TimeZone;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import redcomet.common.config.ConfigLoader;
import redcomet.common.exception.SystemException;
import redcomet.common.log.Log;
import redcomet.common.log.LogFactory;
import redcomet.knowledge.config.AppConfig;
import redcomet.ormapping.connection.ConnectionManager;

public class InitializationListener implements ServletContextListener {
Expand Down Expand Up @@ -35,7 +38,20 @@ public void contextInitialized(ServletContextEvent contextEvent) {
TimeZone zone = TimeZone.getTimeZone("GMT");
TimeZone.setDefault(zone);


// 添付ファイル格納ディレクトリ(テンポラリディレクトリ)が存在しなければ生成
AppConfig appConfig = ConfigLoader.load(AppConfig.APP_CONFIG, AppConfig.class);
String tmpDir = appConfig.getTmpPath();
File tmp = new File(tmpDir);
if (!tmp.exists()) {
tmp.mkdirs();
LOG.info("tmp directory created." + tmpDir);
}
String idxDir = appConfig.getIndexPath();
File idx = new File(idxDir);
if (!idx.exists()) {
idx.mkdirs();
LOG.info("idx directory created." + idxDir);
}
}

}
31 changes: 18 additions & 13 deletions src/main/webapp/js/knowledge-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,24 @@ $(document).ready(function() {
$('.progress .progress-bar').text(progress + '%');

}).on('fileuploadfail', function (e, data) {
var msg = data.jqXHR.responseJSON.msg;
$.each(data.files, function (index) {
var filediv = '<div class="alert alert-warning alert-dismissible" role="alert">';
filediv += '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
filediv += '<strong>';
filediv += '<i class="fa fa-remove"></i>&nbsp;';
filediv += data.files[index].name;
filediv += '</strong>&nbsp;&nbsp;';
filediv += msg;
filediv += '</div>';
$('#files').append(filediv);
$.notify('アップロードに失敗したファイルがあります', 'warn');
});
if (data && data.jqXHR && data.jqXHR.responseJSON && data.jqXHR.responseJSON.msg) {
var msg = data.jqXHR.responseJSON.msg;
$.each(data.files, function (index) {
var filediv = '<div class="alert alert-warning alert-dismissible" role="alert">';
filediv += '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>';
filediv += '<strong>';
filediv += '<i class="fa fa-remove"></i>&nbsp;';
filediv += data.files[index].name;
filediv += '</strong>&nbsp;&nbsp;';
filediv += msg;
filediv += '</div>';
$('#files').append(filediv);
$.notify('アップロードに失敗したファイルがあります', 'warn');
});
} else {
console.log(e);
console.log(data);
}
}).prop('disabled', !$.support.fileInput).parent().addClass($.support.fileInput ? undefined : 'disabled');

});
Expand Down

0 comments on commit 679eb51

Please sign in to comment.