Skip to content

Commit

Permalink
🦄 fix plugin code
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Mar 1, 2017
1 parent 1a3f1ef commit 2924705
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/tale/Application.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.tale;

import com.tale.init.TaleLoader;
import com.tale.utils.ExtClasspathLoader;

import java.io.File;

import static com.blade.Blade.$;

public class Application {

public static void main(String[] args) throws Exception {
TaleLoader.init();
TaleLoader.loadPlugin(new File("/Users/biezhi/workspace/projects/java/plugin_upyun/target/plguin_upyun.jar"));
$().start(Application.class);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/admin/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $.tale.prototype.alertOkAndReload = function (text) {
this.alertOk({text:text, then:function () {
setTimeout(function () {
window.location.reload();
}, 500);
}, 700);
}});
};

Expand Down
22 changes: 11 additions & 11 deletions src/main/resources/templates/admin/attach.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h4 class="page-title">文件管理</h4>
<input name="file" type="file" multiple="multiple">
</div>
<div class="dz-message">
<p>将文件拖至此处或点击上传.</p>
<p>将文件拖至此处或点击上传.${attach_url}</p>
<p>
<span style="font-size: 16px; color: #d0d0d0;">一次最多可以上传10个文件</span>
</p>
Expand Down Expand Up @@ -107,26 +107,26 @@ <h4 class="page-title">文件管理</h4>
filesizeBase:1024,//定义字节算法 默认1000
maxFiles: $.constant().MAX_FILES,//最大文件数量
maxFilesize: '${max_file_size}', //MB
// acceptedFiles: ".js,.obj,.dae" //限制文件类型 image/*,application/pdf,.psd,.obj
fallback:function(){
tale.alertError('暂不支持您的浏览器上传!');
},
uploadMultiple: true,
dictFileTooBig:'您的文件超过'+ ${max_file_size} +'MB!',
dictInvalidInputType:'不支持您上传的类型',
dictMaxFilesExceeded:'您的文件超过'+ $.constant().MAX_FILES+'个!',
init: function() {
this.on("addedfile", function(file) {
this.on('queuecomplete', function (files) {
tale.alertOkAndReload('上传成功');
});
this.on("success", function (file, result) {
console.log(file);
if(result && result.success){
if(result.payload && result.payload.length > 0){
tale.alertWarn('以下文件超出限制\r\n' + result.payload);
} else {
tale.alertOkAndReload('上传成功');
}
this.on('error', function (a, errorMessage, result) {
if(!result.success && result.msg){
tale.alertError(result.msg || '上传失败');
}
});
this.on('maxfilesreached', function () {
this.removeAllFiles(true);
tale.alertWarn('文件数量超出限制');
});
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/templates/admin/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
</li>

#for(item : plugin_menus)
<li #if(active=='plugin_${item.slug}') class="active" #end>
<a href="/admin/plugins/${item.slug}" class="waves-effect #if(active=='${item.slug}') active #end"><i class="${item.icon ?! 'fa fa-gear'}" aria-hidden="true"></i><span> ${item.name} </span></a>
<li #if(active==item.slug) class="active" #end>
<a href="/admin/plugins/${item.slug}" class="waves-effect #if(active==item.slug) active #end"><i class="${item.icon ?! 'fa fa-gear'}" aria-hidden="true"></i><span> ${item.name} </span></a>
</li>
#end
</ul>
Expand Down

0 comments on commit 2924705

Please sign in to comment.