-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
joleye
committed
Nov 19, 2018
1 parent
7432e31
commit 667361e
Showing
15 changed files
with
9,608 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.settings/ | ||
.project | ||
.idea | ||
.idea/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
yuicompressor --type js --charset UTF-8 -v js/ye.check.js > js/ye.check.min.js | ||
yuicompressor --type js --charset UTF-8 -v src/ye.check.js > dist/ye.check.min.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
/** | ||
* jquery.action 插件,支持事件操作 | ||
* @author joleye | ||
*/ | ||
; | ||
$.fn.action = function(){ | ||
this.click(function(){ | ||
var attr = $(this).attr('act-conf'); | ||
var conf; | ||
eval('conf = {'+attr+'}'); | ||
|
||
var func = 'act_'+conf.act; | ||
|
||
act_func[func] && act_func[func](conf,this); | ||
}); | ||
}; | ||
|
||
var act_func = { | ||
act_link : function(conf){ | ||
location.href = conf.url; | ||
}, | ||
act_post : function(conf,dthis){ | ||
var ext = conf.extend?conf.extend:{}; | ||
|
||
ye.verify(conf.form,ext).do_post({ | ||
method : 'ajax', | ||
msg : { | ||
right : 'dright', | ||
error : 'derr' | ||
}, | ||
btn : { | ||
name : dthis, | ||
text : 'load...' | ||
}, | ||
success : function(env){ | ||
if(env.result){ | ||
$.messager.alert("系统提示",env.msg); | ||
}else{ | ||
$.messager.alert("错误提示",env.msg); | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
/** | ||
* jquery.action 插件,支持事件操作 | ||
* @author joleye | ||
*/ | ||
; | ||
$.fn.action = function(){ | ||
this.click(function(){ | ||
var attr = $(this).attr('act-conf'); | ||
var conf; | ||
eval('conf = {'+attr+'}'); | ||
|
||
var func = 'act_'+conf.act; | ||
|
||
act_func[func] && act_func[func](conf,this); | ||
}); | ||
}; | ||
|
||
var act_func = { | ||
act_link : function(conf){ | ||
location.href = conf.url; | ||
}, | ||
act_post : function(conf,dthis){ | ||
var ext = conf.extend?conf.extend:{}; | ||
|
||
ye.verify(conf.form,ext).do_post({ | ||
method : 'ajax', | ||
msg : { | ||
right : 'dright', | ||
error : 'derr' | ||
}, | ||
btn : { | ||
name : dthis, | ||
text : 'load...' | ||
}, | ||
success : function(env){ | ||
if(env.result){ | ||
$.messager.alert("系统提示",env.msg); | ||
}else{ | ||
$.messager.alert("错误提示",env.msg); | ||
} | ||
} | ||
}); | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,73 @@ | ||
/** | ||
* 复合复选框 - ye.check | ||
*/ | ||
|
||
(function($){ | ||
|
||
function init(name,target,onSelect){ | ||
var item = $(target); | ||
|
||
item.hide(); | ||
|
||
var ops = $.data(target); | ||
|
||
$('<span class="comp-box"><input class="icon-compositebox '+ops.status[0]+'" type="button" value=" "/></span>').insertBefore(item).click(function(){ | ||
var inp = $(this).find('input'); | ||
var cls = inp.attr('class').match(/\s+\w+$/)[0].replace(/\s+/g,''); | ||
|
||
var newcls = ye.array(ops.status).next(cls); | ||
|
||
inp.removeClass(cls).addClass(newcls); | ||
|
||
var index = 0; | ||
$('input[name='+name+']').each(function(){ | ||
|
||
if($(this).val()==ops.map[newcls]){ | ||
$(this).attr('checked',true); | ||
if(onSelect){ | ||
onSelect.call(this,index,true); | ||
} | ||
}else{ | ||
$(this).attr('checked',false); | ||
} | ||
|
||
if(onSelect && ops.map[newcls]==''){ | ||
onSelect.call(this,index,false); | ||
} | ||
|
||
index++; | ||
}); | ||
}); | ||
|
||
}; | ||
|
||
$.fn.compositebox = function(option){ | ||
var options = $.extend({ | ||
status : ['none','checked','del'] | ||
},option); | ||
|
||
var nodes = {}; | ||
this.each(function(){ | ||
nodes[this.name] = this.parentNode.parentNode; | ||
$(nodes[this.name]).hide(); | ||
}); | ||
|
||
$.each(nodes,function(k,val){ | ||
var new_option = ['none']; | ||
options.map = {'none':''}; | ||
$('input[name='+k+']').each(function(){ | ||
var b = $(this).attr('composite-box'); | ||
if(b){ | ||
new_option.push(b); | ||
options.map[b] = $(this).val(); | ||
} | ||
}); | ||
|
||
options.status = $.extend(options.status,new_option); | ||
|
||
$.data(val,options); | ||
|
||
init(k,val,options.onSelect); | ||
}); | ||
}; | ||
})($); | ||
/** | ||
* 复合复选框 - ye.check | ||
*/ | ||
|
||
(function($){ | ||
|
||
function init(name,target,onSelect){ | ||
var item = $(target); | ||
|
||
item.hide(); | ||
|
||
var ops = $.data(target); | ||
|
||
$('<span class="comp-box"><input class="icon-compositebox '+ops.status[0]+'" type="button" value=" "/></span>').insertBefore(item).click(function(){ | ||
var inp = $(this).find('input'); | ||
var cls = inp.attr('class').match(/\s+\w+$/)[0].replace(/\s+/g,''); | ||
|
||
var newcls = ye.array(ops.status).next(cls); | ||
|
||
inp.removeClass(cls).addClass(newcls); | ||
|
||
var index = 0; | ||
$('input[name='+name+']').each(function(){ | ||
|
||
if($(this).val()==ops.map[newcls]){ | ||
$(this).attr('checked',true); | ||
if(onSelect){ | ||
onSelect.call(this,index,true); | ||
} | ||
}else{ | ||
$(this).attr('checked',false); | ||
} | ||
|
||
if(onSelect && ops.map[newcls]==''){ | ||
onSelect.call(this,index,false); | ||
} | ||
|
||
index++; | ||
}); | ||
}); | ||
|
||
}; | ||
|
||
$.fn.compositebox = function(option){ | ||
var options = $.extend({ | ||
status : ['none','checked','del'] | ||
},option); | ||
|
||
var nodes = {}; | ||
this.each(function(){ | ||
nodes[this.name] = this.parentNode.parentNode; | ||
$(nodes[this.name]).hide(); | ||
}); | ||
|
||
$.each(nodes,function(k,val){ | ||
var new_option = ['none']; | ||
options.map = {'none':''}; | ||
$('input[name='+k+']').each(function(){ | ||
var b = $(this).attr('composite-box'); | ||
if(b){ | ||
new_option.push(b); | ||
options.map[b] = $(this).val(); | ||
} | ||
}); | ||
|
||
options.status = $.extend(options.status,new_option); | ||
|
||
$.data(val,options); | ||
|
||
init(k,val,options.onSelect); | ||
}); | ||
}; | ||
})($); |
Oops, something went wrong.