若依开源1.1.1发布
617
src/main/resources/static/ajax/libs/beautifyhtml/beautifyhtml.js
Normal file
@ -0,0 +1,617 @@
|
||||
/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
|
||||
/*
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007-2013 Einar Lielmanis and contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
(the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
||||
Style HTML
|
||||
---------------
|
||||
|
||||
Written by Nochum Sossonko, (nsossonko@hotmail.com)
|
||||
|
||||
Based on code initially developed by: Einar Lielmanis, <elfz@laacz.lv>
|
||||
http://jsbeautifier.org/
|
||||
|
||||
Usage:
|
||||
style_html(html_source);
|
||||
|
||||
style_html(html_source, options);
|
||||
|
||||
The options are:
|
||||
indent_size (default 4) — indentation size,
|
||||
indent_char (default space) — character to indent with,
|
||||
max_char (default 250) - maximum amount of characters per line (0 = disable)
|
||||
brace_style (default "collapse") - "collapse" | "expand" | "end-expand"
|
||||
put braces on the same line as control statements (default), or put braces on own line (Allman / ANSI style), or just put end braces on own line.
|
||||
unformatted (defaults to inline tags) - list of tags, that shouldn't be reformatted
|
||||
indent_scripts (default normal) - "keep"|"separate"|"normal"
|
||||
|
||||
e.g.
|
||||
|
||||
style_html(html_source, {
|
||||
'indent_size': 2,
|
||||
'indent_char': ' ',
|
||||
'max_char': 78,
|
||||
'brace_style': 'expand',
|
||||
'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u']
|
||||
});
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
function style_html(html_source, options, js_beautify, css_beautify) {
|
||||
//Wrapper function to invoke all the necessary constructors and deal with the output.
|
||||
|
||||
var multi_parser,
|
||||
indent_size,
|
||||
indent_character,
|
||||
max_char,
|
||||
brace_style,
|
||||
unformatted;
|
||||
|
||||
options = options || {};
|
||||
indent_size = options.indent_size || 4;
|
||||
indent_character = options.indent_char || ' ';
|
||||
brace_style = options.brace_style || 'collapse';
|
||||
max_char = options.max_char === 0 ? Infinity : options.max_char || 250;
|
||||
unformatted = options.unformatted || ['a', 'span', 'bdo', 'em', 'strong', 'dfn', 'code', 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'q', 'sub', 'sup', 'tt', 'i', 'b', 'big', 'small', 'u', 's', 'strike', 'font', 'ins', 'del', 'pre', 'address', 'dt', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
|
||||
|
||||
function Parser() {
|
||||
|
||||
this.pos = 0; //Parser position
|
||||
this.token = '';
|
||||
this.current_mode = 'CONTENT'; //reflects the current Parser mode: TAG/CONTENT
|
||||
this.tags = { //An object to hold tags, their position, and their parent-tags, initiated with default values
|
||||
parent: 'parent1',
|
||||
parentcount: 1,
|
||||
parent1: ''
|
||||
};
|
||||
this.tag_type = '';
|
||||
this.token_text = this.last_token = this.last_text = this.token_type = '';
|
||||
|
||||
this.Utils = { //Uilities made available to the various functions
|
||||
whitespace: "\n\r\t ".split(''),
|
||||
single_token: 'br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?='.split(','), //all the single tags for HTML
|
||||
extra_liners: 'head,body,/html'.split(','), //for tags that need a line of whitespace before them
|
||||
in_array: function (what, arr) {
|
||||
for (var i=0; i<arr.length; i++) {
|
||||
if (what === arr[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
this.get_content = function () { //function to capture regular content between tags
|
||||
|
||||
var input_char = '',
|
||||
content = [],
|
||||
space = false; //if a space is needed
|
||||
|
||||
while (this.input.charAt(this.pos) !== '<') {
|
||||
if (this.pos >= this.input.length) {
|
||||
return content.length?content.join(''):['', 'TK_EOF'];
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
||||
if (content.length) {
|
||||
space = true;
|
||||
}
|
||||
this.line_char_count--;
|
||||
continue; //don't want to insert unnecessary space
|
||||
}
|
||||
else if (space) {
|
||||
if (this.line_char_count >= this.max_char) { //insert a line when the max_char is reached
|
||||
content.push('\n');
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
content.push(this.indent_string);
|
||||
}
|
||||
this.line_char_count = 0;
|
||||
}
|
||||
else{
|
||||
content.push(' ');
|
||||
this.line_char_count++;
|
||||
}
|
||||
space = false;
|
||||
}
|
||||
content.push(input_char); //letter at-a-time (or string) inserted to an array
|
||||
}
|
||||
return content.length?content.join(''):'';
|
||||
};
|
||||
|
||||
this.get_contents_to = function (name) { //get the full content of a script or style to pass to js_beautify
|
||||
if (this.pos === this.input.length) {
|
||||
return ['', 'TK_EOF'];
|
||||
}
|
||||
var input_char = '';
|
||||
var content = '';
|
||||
var reg_match = new RegExp('</' + name + '\\s*>', 'igm');
|
||||
reg_match.lastIndex = this.pos;
|
||||
var reg_array = reg_match.exec(this.input);
|
||||
var end_script = reg_array?reg_array.index:this.input.length; //absolute end of script
|
||||
if(this.pos < end_script) { //get everything in between the script tags
|
||||
content = this.input.substring(this.pos, end_script);
|
||||
this.pos = end_script;
|
||||
}
|
||||
return content;
|
||||
};
|
||||
|
||||
this.record_tag = function (tag){ //function to record a tag and its parent in this.tags Object
|
||||
if (this.tags[tag + 'count']) { //check for the existence of this tag type
|
||||
this.tags[tag + 'count']++;
|
||||
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
||||
}
|
||||
else { //otherwise initialize this tag type
|
||||
this.tags[tag + 'count'] = 1;
|
||||
this.tags[tag + this.tags[tag + 'count']] = this.indent_level; //and record the present indent level
|
||||
}
|
||||
this.tags[tag + this.tags[tag + 'count'] + 'parent'] = this.tags.parent; //set the parent (i.e. in the case of a div this.tags.div1parent)
|
||||
this.tags.parent = tag + this.tags[tag + 'count']; //and make this the current parent (i.e. in the case of a div 'div1')
|
||||
};
|
||||
|
||||
this.retrieve_tag = function (tag) { //function to retrieve the opening tag to the corresponding closer
|
||||
if (this.tags[tag + 'count']) { //if the openener is not in the Object we ignore it
|
||||
var temp_parent = this.tags.parent; //check to see if it's a closable tag.
|
||||
while (temp_parent) { //till we reach '' (the initial value);
|
||||
if (tag + this.tags[tag + 'count'] === temp_parent) { //if this is it use it
|
||||
break;
|
||||
}
|
||||
temp_parent = this.tags[temp_parent + 'parent']; //otherwise keep on climbing up the DOM Tree
|
||||
}
|
||||
if (temp_parent) { //if we caught something
|
||||
this.indent_level = this.tags[tag + this.tags[tag + 'count']]; //set the indent_level accordingly
|
||||
this.tags.parent = this.tags[temp_parent + 'parent']; //and set the current parent
|
||||
}
|
||||
delete this.tags[tag + this.tags[tag + 'count'] + 'parent']; //delete the closed tags parent reference...
|
||||
delete this.tags[tag + this.tags[tag + 'count']]; //...and the tag itself
|
||||
if (this.tags[tag + 'count'] === 1) {
|
||||
delete this.tags[tag + 'count'];
|
||||
}
|
||||
else {
|
||||
this.tags[tag + 'count']--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.get_tag = function (peek) { //function to get a full tag and parse its type
|
||||
var input_char = '',
|
||||
content = [],
|
||||
comment = '',
|
||||
space = false,
|
||||
tag_start, tag_end,
|
||||
orig_pos = this.pos,
|
||||
orig_line_char_count = this.line_char_count;
|
||||
|
||||
peek = peek !== undefined ? peek : false;
|
||||
|
||||
do {
|
||||
if (this.pos >= this.input.length) {
|
||||
if (peek) {
|
||||
this.pos = orig_pos;
|
||||
this.line_char_count = orig_line_char_count;
|
||||
}
|
||||
return content.length?content.join(''):['', 'TK_EOF'];
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
this.line_char_count++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) { //don't want to insert unnecessary space
|
||||
space = true;
|
||||
this.line_char_count--;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (input_char === "'" || input_char === '"') {
|
||||
if (!content[1] || content[1] !== '!') { //if we're in a comment strings don't get treated specially
|
||||
input_char += this.get_unformatted(input_char);
|
||||
space = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (input_char === '=') { //no space before =
|
||||
space = false;
|
||||
}
|
||||
|
||||
if (content.length && content[content.length-1] !== '=' && input_char !== '>' && space) {
|
||||
//no space after = or before >
|
||||
if (this.line_char_count >= this.max_char) {
|
||||
this.print_newline(false, content);
|
||||
this.line_char_count = 0;
|
||||
}
|
||||
else {
|
||||
content.push(' ');
|
||||
this.line_char_count++;
|
||||
}
|
||||
space = false;
|
||||
}
|
||||
if (input_char === '<') {
|
||||
tag_start = this.pos - 1;
|
||||
}
|
||||
content.push(input_char); //inserts character at-a-time (or string)
|
||||
} while (input_char !== '>');
|
||||
|
||||
var tag_complete = content.join('');
|
||||
var tag_index;
|
||||
if (tag_complete.indexOf(' ') !== -1) { //if there's whitespace, thats where the tag name ends
|
||||
tag_index = tag_complete.indexOf(' ');
|
||||
}
|
||||
else { //otherwise go with the tag ending
|
||||
tag_index = tag_complete.indexOf('>');
|
||||
}
|
||||
var tag_check = tag_complete.substring(1, tag_index).toLowerCase();
|
||||
if (tag_complete.charAt(tag_complete.length-2) === '/' ||
|
||||
this.Utils.in_array(tag_check, this.Utils.single_token)) { //if this tag name is a single tag type (either in the list or has a closing /)
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
}
|
||||
else if (tag_check === 'script') { //for later script handling
|
||||
if ( ! peek) {
|
||||
this.record_tag(tag_check);
|
||||
this.tag_type = 'SCRIPT';
|
||||
}
|
||||
}
|
||||
else if (tag_check === 'style') { //for future style handling (for now it justs uses get_content)
|
||||
if ( ! peek) {
|
||||
this.record_tag(tag_check);
|
||||
this.tag_type = 'STYLE';
|
||||
}
|
||||
}
|
||||
else if (this.is_unformatted(tag_check, unformatted)) { // do not reformat the "unformatted" tags
|
||||
comment = this.get_unformatted('</'+tag_check+'>', tag_complete); //...delegate to get_unformatted function
|
||||
content.push(comment);
|
||||
// Preserve collapsed whitespace either before or after this tag.
|
||||
if (tag_start > 0 && this.Utils.in_array(this.input.charAt(tag_start - 1), this.Utils.whitespace)){
|
||||
content.splice(0, 0, this.input.charAt(tag_start - 1));
|
||||
}
|
||||
tag_end = this.pos - 1;
|
||||
if (this.Utils.in_array(this.input.charAt(tag_end + 1), this.Utils.whitespace)){
|
||||
content.push(this.input.charAt(tag_end + 1));
|
||||
}
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
else if (tag_check.charAt(0) === '!') { //peek for <!-- comment
|
||||
if (tag_check.indexOf('[if') !== -1) { //peek for <!--[if conditional comment
|
||||
if (tag_complete.indexOf('!IE') !== -1) { //this type needs a closing --> so...
|
||||
comment = this.get_unformatted('-->', tag_complete); //...delegate to get_unformatted
|
||||
content.push(comment);
|
||||
}
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'START';
|
||||
}
|
||||
}
|
||||
else if (tag_check.indexOf('[endif') !== -1) {//peek for <!--[endif end conditional comment
|
||||
this.tag_type = 'END';
|
||||
this.unindent();
|
||||
}
|
||||
else if (tag_check.indexOf('[cdata[') !== -1) { //if it's a <[cdata[ comment...
|
||||
comment = this.get_unformatted(']]>', tag_complete); //...delegate to get_unformatted function
|
||||
content.push(comment);
|
||||
if ( ! peek) {
|
||||
this.tag_type = 'SINGLE'; //<![CDATA[ comments are treated like single tags
|
||||
}
|
||||
}
|
||||
else {
|
||||
comment = this.get_unformatted('-->', tag_complete);
|
||||
content.push(comment);
|
||||
this.tag_type = 'SINGLE';
|
||||
}
|
||||
}
|
||||
else if ( ! peek) {
|
||||
if (tag_check.charAt(0) === '/') { //this tag is a double tag so check for tag-ending
|
||||
this.retrieve_tag(tag_check.substring(1)); //remove it and all ancestors
|
||||
this.tag_type = 'END';
|
||||
}
|
||||
else { //otherwise it's a start-tag
|
||||
this.record_tag(tag_check); //push it on the tag stack
|
||||
this.tag_type = 'START';
|
||||
}
|
||||
if (this.Utils.in_array(tag_check, this.Utils.extra_liners)) { //check if this double needs an extra line
|
||||
this.print_newline(true, this.output);
|
||||
}
|
||||
}
|
||||
|
||||
if (peek) {
|
||||
this.pos = orig_pos;
|
||||
this.line_char_count = orig_line_char_count;
|
||||
}
|
||||
|
||||
return content.join(''); //returns fully formatted tag
|
||||
};
|
||||
|
||||
this.get_unformatted = function (delimiter, orig_tag) { //function to return unformatted content in its entirety
|
||||
|
||||
if (orig_tag && orig_tag.toLowerCase().indexOf(delimiter) !== -1) {
|
||||
return '';
|
||||
}
|
||||
var input_char = '';
|
||||
var content = '';
|
||||
var space = true;
|
||||
do {
|
||||
|
||||
if (this.pos >= this.input.length) {
|
||||
return content;
|
||||
}
|
||||
|
||||
input_char = this.input.charAt(this.pos);
|
||||
this.pos++;
|
||||
|
||||
if (this.Utils.in_array(input_char, this.Utils.whitespace)) {
|
||||
if (!space) {
|
||||
this.line_char_count--;
|
||||
continue;
|
||||
}
|
||||
if (input_char === '\n' || input_char === '\r') {
|
||||
content += '\n';
|
||||
/* Don't change tab indention for unformatted blocks. If using code for html editing, this will greatly affect <pre> tags if they are specified in the 'unformatted array'
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
content += this.indent_string;
|
||||
}
|
||||
space = false; //...and make sure other indentation is erased
|
||||
*/
|
||||
this.line_char_count = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
content += input_char;
|
||||
this.line_char_count++;
|
||||
space = true;
|
||||
|
||||
|
||||
} while (content.toLowerCase().indexOf(delimiter) === -1);
|
||||
return content;
|
||||
};
|
||||
|
||||
this.get_token = function () { //initial handler for token-retrieval
|
||||
var token;
|
||||
|
||||
if (this.last_token === 'TK_TAG_SCRIPT' || this.last_token === 'TK_TAG_STYLE') { //check if we need to format javascript
|
||||
var type = this.last_token.substr(7);
|
||||
token = this.get_contents_to(type);
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
return [token, 'TK_' + type];
|
||||
}
|
||||
if (this.current_mode === 'CONTENT') {
|
||||
token = this.get_content();
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
else {
|
||||
return [token, 'TK_CONTENT'];
|
||||
}
|
||||
}
|
||||
|
||||
if (this.current_mode === 'TAG') {
|
||||
token = this.get_tag();
|
||||
if (typeof token !== 'string') {
|
||||
return token;
|
||||
}
|
||||
else {
|
||||
var tag_name_type = 'TK_TAG_' + this.tag_type;
|
||||
return [token, tag_name_type];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.get_full_indent = function (level) {
|
||||
level = this.indent_level + level || 0;
|
||||
if (level < 1) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return Array(level + 1).join(this.indent_string);
|
||||
};
|
||||
|
||||
this.is_unformatted = function(tag_check, unformatted) {
|
||||
//is this an HTML5 block-level link?
|
||||
if (!this.Utils.in_array(tag_check, unformatted)){
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tag_check.toLowerCase() !== 'a' || !this.Utils.in_array('a', unformatted)){
|
||||
return true;
|
||||
}
|
||||
|
||||
//at this point we have an tag; is its first child something we want to remain
|
||||
//unformatted?
|
||||
var next_tag = this.get_tag(true /* peek. */);
|
||||
|
||||
// tets next_tag to see if it is just html tag (no external content)
|
||||
var tag = (next_tag || "").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);
|
||||
|
||||
// if next_tag comes back but is not an isolated tag, then
|
||||
// let's treat the 'a' tag as having content
|
||||
// and respect the unformatted option
|
||||
if (!tag || this.Utils.in_array(tag, unformatted)){
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
this.printer = function (js_source, indent_character, indent_size, max_char, brace_style) { //handles input/output and some other printing functions
|
||||
|
||||
this.input = js_source || ''; //gets the input for the Parser
|
||||
this.output = [];
|
||||
this.indent_character = indent_character;
|
||||
this.indent_string = '';
|
||||
this.indent_size = indent_size;
|
||||
this.brace_style = brace_style;
|
||||
this.indent_level = 0;
|
||||
this.max_char = max_char;
|
||||
this.line_char_count = 0; //count to see if max_char was exceeded
|
||||
|
||||
for (var i=0; i<this.indent_size; i++) {
|
||||
this.indent_string += this.indent_character;
|
||||
}
|
||||
|
||||
this.print_newline = function (ignore, arr) {
|
||||
this.line_char_count = 0;
|
||||
if (!arr || !arr.length) {
|
||||
return;
|
||||
}
|
||||
if (!ignore) { //we might want the extra line
|
||||
while (this.Utils.in_array(arr[arr.length-1], this.Utils.whitespace)) {
|
||||
arr.pop();
|
||||
}
|
||||
}
|
||||
arr.push('\n');
|
||||
for (var i=0; i<this.indent_level; i++) {
|
||||
arr.push(this.indent_string);
|
||||
}
|
||||
};
|
||||
|
||||
this.print_token = function (text) {
|
||||
this.output.push(text);
|
||||
};
|
||||
|
||||
this.indent = function () {
|
||||
this.indent_level++;
|
||||
};
|
||||
|
||||
this.unindent = function () {
|
||||
if (this.indent_level > 0) {
|
||||
this.indent_level--;
|
||||
}
|
||||
};
|
||||
};
|
||||
return this;
|
||||
}
|
||||
|
||||
/*_____________________--------------------_____________________*/
|
||||
|
||||
multi_parser = new Parser(); //wrapping functions Parser
|
||||
multi_parser.printer(html_source, indent_character, indent_size, max_char, brace_style); //initialize starting values
|
||||
|
||||
while (true) {
|
||||
var t = multi_parser.get_token();
|
||||
multi_parser.token_text = t[0];
|
||||
multi_parser.token_type = t[1];
|
||||
|
||||
if (multi_parser.token_type === 'TK_EOF') {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (multi_parser.token_type) {
|
||||
case 'TK_TAG_START':
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.indent();
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_STYLE':
|
||||
case 'TK_TAG_SCRIPT':
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_END':
|
||||
//Print new line only if the tag has no content and has child
|
||||
if (multi_parser.last_token === 'TK_CONTENT' && multi_parser.last_text === '') {
|
||||
var tag_name = multi_parser.token_text.match(/\w+/)[0];
|
||||
var tag_extracted_from_last_output = multi_parser.output[multi_parser.output.length -1].match(/<\s*(\w+)/);
|
||||
if (tag_extracted_from_last_output === null || tag_extracted_from_last_output[1] !== tag_name) {
|
||||
multi_parser.print_newline(true, multi_parser.output);
|
||||
}
|
||||
}
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_TAG_SINGLE':
|
||||
// Don't add a newline before elements that should remain unformatted.
|
||||
var tag_check = multi_parser.token_text.match(/^\s*<([a-z]+)/i);
|
||||
if (!tag_check || !multi_parser.Utils.in_array(tag_check[1], unformatted)){
|
||||
multi_parser.print_newline(false, multi_parser.output);
|
||||
}
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
multi_parser.current_mode = 'CONTENT';
|
||||
break;
|
||||
case 'TK_CONTENT':
|
||||
if (multi_parser.token_text !== '') {
|
||||
multi_parser.print_token(multi_parser.token_text);
|
||||
}
|
||||
multi_parser.current_mode = 'TAG';
|
||||
break;
|
||||
case 'TK_STYLE':
|
||||
case 'TK_SCRIPT':
|
||||
if (multi_parser.token_text !== '') {
|
||||
multi_parser.output.push('\n');
|
||||
var text = multi_parser.token_text,
|
||||
_beautifier,
|
||||
script_indent_level = 1;
|
||||
if (multi_parser.token_type === 'TK_SCRIPT') {
|
||||
_beautifier = typeof js_beautify === 'function' && js_beautify;
|
||||
} else if (multi_parser.token_type === 'TK_STYLE') {
|
||||
_beautifier = typeof css_beautify === 'function' && css_beautify;
|
||||
}
|
||||
|
||||
if (options.indent_scripts === "keep") {
|
||||
script_indent_level = 0;
|
||||
} else if (options.indent_scripts === "separate") {
|
||||
script_indent_level = -multi_parser.indent_level;
|
||||
}
|
||||
|
||||
var indentation = multi_parser.get_full_indent(script_indent_level);
|
||||
if (_beautifier) {
|
||||
// call the Beautifier if avaliable
|
||||
text = _beautifier(text.replace(/^\s*/, indentation), options);
|
||||
} else {
|
||||
// simply indent the string otherwise
|
||||
var white = text.match(/^\s*/)[0];
|
||||
var _level = white.match(/[^\n\r]*$/)[0].split(multi_parser.indent_string).length - 1;
|
||||
var reindent = multi_parser.get_full_indent(script_indent_level -_level);
|
||||
text = text.replace(/^\s*/, indentation)
|
||||
.replace(/\r\n|\r|\n/g, '\n' + reindent)
|
||||
.replace(/\s*$/, '');
|
||||
}
|
||||
if (text) {
|
||||
multi_parser.print_token(text);
|
||||
multi_parser.print_newline(true, multi_parser.output);
|
||||
}
|
||||
}
|
||||
multi_parser.current_mode = 'TAG';
|
||||
break;
|
||||
}
|
||||
multi_parser.last_token = multi_parser.token_type;
|
||||
multi_parser.last_text = multi_parser.token_text;
|
||||
}
|
||||
return multi_parser.output.join('');
|
||||
}
|
||||
|
||||
// If we're running a web page and don't have either of the above, add our one global
|
||||
window.html_beautify = function(html_source, options) {
|
||||
return style_html(html_source, options, window.js_beautify, window.css_beautify);
|
||||
};
|
||||
|
||||
}());
|
BIN
src/main/resources/static/ajax/libs/bootstrap-table/.DS_Store
vendored
Normal file
1
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.css
vendored
Normal file
8
src/main/resources/static/ajax/libs/bootstrap-table/bootstrap-table.min.js
vendored
Normal file
146
src/main/resources/static/ajax/libs/bootstrap-table/extensions/editable/bootstrap-table-editable.js
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/vitalets/x-editable
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
editable: true,
|
||||
onEditableInit: function() {
|
||||
return false;
|
||||
},
|
||||
onEditableSave: function(field, row, oldValue, $el) {
|
||||
return false;
|
||||
},
|
||||
onEditableShown: function(field, row, $el, editable) {
|
||||
return false;
|
||||
},
|
||||
onEditableHidden: function(field, row, $el, reason) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'editable-init.bs.table': 'onEditableInit',
|
||||
'editable-save.bs.table': 'onEditableSave',
|
||||
'editable-shown.bs.table': 'onEditableShown',
|
||||
'editable-hidden.bs.table': 'onEditableHidden'
|
||||
});
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initTable = BootstrapTable.prototype.initTable,
|
||||
_initBody = BootstrapTable.prototype.initBody;
|
||||
|
||||
BootstrapTable.prototype.initTable = function() {
|
||||
var that = this;
|
||||
_initTable.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var editableOptions = {},
|
||||
editableDataMarkup = [],
|
||||
editableDataPrefix = 'editable-';
|
||||
|
||||
var processDataOptions = function(key, value) {
|
||||
// Replace camel case with dashes.
|
||||
var dashKey = key.replace(/([A-Z])/g, function($1) {
|
||||
return "-" + $1.toLowerCase();
|
||||
});
|
||||
if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
|
||||
var dataKey = dashKey.replace(editableDataPrefix, 'data-');
|
||||
editableOptions[dataKey] = value;
|
||||
}
|
||||
};
|
||||
|
||||
$.each(that.options, processDataOptions);
|
||||
|
||||
column.formatter = column.formatter || function(value, row, index) {
|
||||
return value;
|
||||
};
|
||||
column._formatter = column._formatter ? column._formatter : column.formatter;
|
||||
column.formatter = function(value, row, index) {
|
||||
var result = column._formatter ? column._formatter(value, row, index) : value;
|
||||
|
||||
$.each(column, processDataOptions);
|
||||
|
||||
$.each(editableOptions, function(key, value) {
|
||||
editableDataMarkup.push(' ' + key + '="' + value + '"');
|
||||
});
|
||||
|
||||
var _dont_edit_formatter = false;
|
||||
if (column.editable.hasOwnProperty('noeditFormatter')) {
|
||||
_dont_edit_formatter = column.editable.noeditFormatter(value, row, index);
|
||||
}
|
||||
|
||||
if (_dont_edit_formatter === false) {
|
||||
return ['<a href="javascript:void(0)"',
|
||||
' data-name="' + column.field + '"',
|
||||
' data-pk="' + row[that.options.idField] + '"',
|
||||
' data-value="' + result + '"',
|
||||
editableDataMarkup.join(''),
|
||||
'>' + '</a>'
|
||||
].join('');
|
||||
} else {
|
||||
return _dont_edit_formatter;
|
||||
}
|
||||
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.initBody = function() {
|
||||
var that = this;
|
||||
_initBody.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(this.columns, function(i, column) {
|
||||
if (!column.editable) {
|
||||
return;
|
||||
}
|
||||
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('save').on('save', function(e, params) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index],
|
||||
oldValue = row[column.field];
|
||||
|
||||
$(this).data('value', params.submitValue);
|
||||
row[column.field] = params.submitValue;
|
||||
that.trigger('editable-save', column.field, row, oldValue, $(this));
|
||||
that.resetFooter();
|
||||
});
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('shown').on('shown', function(e, editable) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index];
|
||||
|
||||
that.trigger('editable-shown', column.field, row, $(this), editable);
|
||||
});
|
||||
that.$body.find('a[data-name="' + column.field + '"]').editable(column.editable)
|
||||
.off('hidden').on('hidden', function(e, reason) {
|
||||
var data = that.getData(),
|
||||
index = $(this).parents('tr[data-index]').data('index'),
|
||||
row = data[index];
|
||||
|
||||
that.trigger('editable-hidden', column.field, row, $(this), reason);
|
||||
});
|
||||
});
|
||||
this.trigger('editable-init');
|
||||
};
|
||||
|
||||
})(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";a.extend(a.fn.bootstrapTable.defaults,{editable:!0,onEditableInit:function(){return!1},onEditableSave:function(){return!1},onEditableShown:function(){return!1},onEditableHidden:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"editable-init.bs.table":"onEditableInit","editable-save.bs.table":"onEditableSave","editable-shown.bs.table":"onEditableShown","editable-hidden.bs.table":"onEditableHidden"});var b=a.fn.bootstrapTable.Constructor,c=b.prototype.initTable,d=b.prototype.initBody;b.prototype.initTable=function(){var b=this;c.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&a.each(this.columns,function(c,d){if(d.editable){var e={},f=[],g="editable-",h=function(a,b){var c=a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()});if(c.slice(0,g.length)==g){var d=c.replace(g,"data-");e[d]=b}};a.each(b.options,h),d.formatter=d.formatter||function(a){return a},d._formatter=d._formatter?d._formatter:d.formatter,d.formatter=function(c,g,i){var j=d._formatter?d._formatter(c,g,i):c;a.each(d,h),a.each(e,function(a,b){f.push(" "+a+'="'+b+'"')});var k=!1;return d.editable.hasOwnProperty("noeditFormatter")&&(k=d.editable.noeditFormatter(c,g,i)),k===!1?['<a href="javascript:void(0)"',' data-name="'+d.field+'"',' data-pk="'+g[b.options.idField]+'"',' data-value="'+j+'"',f.join(""),"></a>"].join(""):k}}})},b.prototype.initBody=function(){var b=this;d.apply(this,Array.prototype.slice.apply(arguments)),this.options.editable&&(a.each(this.columns,function(c,d){d.editable&&(b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("save").on("save",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g],i=h[d.field];a(this).data("value",e.submitValue),h[d.field]=e.submitValue,b.trigger("editable-save",d.field,h,i,a(this)),b.resetFooter()}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("shown").on("shown",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-shown",d.field,h,a(this),e)}),b.$body.find('a[data-name="'+d.field+'"]').editable(d.editable).off("hidden").on("hidden",function(c,e){var f=b.getData(),g=a(this).parents("tr[data-index]").data("index"),h=f[g];b.trigger("editable-hidden",d.field,h,a(this),e)}))}),this.trigger("editable-init"))}}(jQuery);
|
114
src/main/resources/static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
/**
|
||||
* @author zhixin wen <wenzhixin2010@gmail.com>
|
||||
* extensions: https://github.com/kayalshri/tableExport.jquery.plugin
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
var sprintf = $.fn.bootstrapTable.utils.sprintf;
|
||||
|
||||
var TYPE_NAME = {
|
||||
csv: 'CSV',
|
||||
txt: 'TXT',
|
||||
doc: 'Word',
|
||||
excel: 'Excel'
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
showExport: false,
|
||||
exportDataType: 'all', // basic, all, selected
|
||||
exportTypes: ['csv', 'txt', 'doc', 'excel'],
|
||||
exportOptions: {}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
export: 'glyphicon glyphicon-save'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatExport: function () {
|
||||
return 'Export data';
|
||||
}
|
||||
});
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initToolbar = BootstrapTable.prototype.initToolbar;
|
||||
|
||||
BootstrapTable.prototype.initToolbar = function () {
|
||||
this.showToolbar = this.options.showExport;
|
||||
|
||||
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (this.options.showExport) {
|
||||
var that = this,
|
||||
$btnGroup = this.$toolbar.find('>.btn-group'),
|
||||
$export = $btnGroup.find('div.export');
|
||||
|
||||
if (!$export.length) {
|
||||
$export = $([
|
||||
'<div class="export btn-group">',
|
||||
'<button class="btn' +
|
||||
sprintf(' btn-%s', this.options.buttonsClass) +
|
||||
sprintf(' btn-%s', this.options.iconSize) +
|
||||
' dropdown-toggle" ' +
|
||||
'title="' + this.options.formatExport() + '" ' +
|
||||
'data-toggle="dropdown" type="button">',
|
||||
sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
|
||||
'<span class="caret"></span>',
|
||||
'</button>',
|
||||
'<ul class="dropdown-menu" role="menu">',
|
||||
'</ul>',
|
||||
'</div>'].join('')).appendTo($btnGroup);
|
||||
|
||||
var $menu = $export.find('.dropdown-menu'),
|
||||
exportTypes = this.options.exportTypes;
|
||||
|
||||
if (typeof this.options.exportTypes === 'string') {
|
||||
var types = this.options.exportTypes.slice(1, -1).replace(/ /g, '').split(',');
|
||||
|
||||
exportTypes = [];
|
||||
$.each(types, function (i, value) {
|
||||
exportTypes.push(value.slice(1, -1));
|
||||
});
|
||||
}
|
||||
$.each(exportTypes, function (i, type) {
|
||||
if (TYPE_NAME.hasOwnProperty(type)) {
|
||||
$menu.append(['<li data-type="' + type + '">',
|
||||
'<a href="javascript:void(0)">',
|
||||
TYPE_NAME[type],
|
||||
'</a>',
|
||||
'</li>'].join(''));
|
||||
}
|
||||
});
|
||||
|
||||
$menu.find('li').click(function () {
|
||||
var type = $(this).data('type'),
|
||||
doExport = function () {
|
||||
that.$el.tableExport($.extend({}, that.options.exportOptions, {
|
||||
type: type,
|
||||
escape: false
|
||||
}));
|
||||
};
|
||||
|
||||
if (that.options.exportDataType === 'all' && that.options.pagination) {
|
||||
that.$el.one(that.options.sidePagination === 'server' ? 'post-body.bs.table' : 'page-change.bs.table', function () {
|
||||
doExport();
|
||||
that.togglePagination();
|
||||
});
|
||||
that.togglePagination();
|
||||
} else if (that.options.exportDataType === 'selected') {
|
||||
var data = that.getData(),
|
||||
selectedData = that.getAllSelections();
|
||||
|
||||
that.load(selectedData);
|
||||
doExport();
|
||||
that.load(data);
|
||||
} else {
|
||||
doExport();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
136
src/main/resources/static/ajax/libs/bootstrap-table/extensions/mobile/bootstrap-table-mobile.js
vendored
Normal file
@ -0,0 +1,136 @@
|
||||
/**
|
||||
* @author: Dennis Hernández
|
||||
* @webSite: http://djhvscf.github.io/Blog
|
||||
* @version: v1.1.0
|
||||
*/
|
||||
|
||||
!function ($) {
|
||||
|
||||
'use strict';
|
||||
|
||||
var showHideColumns = function (that, checked) {
|
||||
if (that.options.columnsHidden.length > 0 ) {
|
||||
$.each(that.columns, function (i, column) {
|
||||
if (that.options.columnsHidden.indexOf(column.field) !== -1) {
|
||||
if (column.visible !== checked) {
|
||||
that.toggleColumn($.fn.bootstrapTable.utils.getFieldIndex(that.columns, column.field), checked, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var resetView = function (that) {
|
||||
if (that.options.height || that.options.showFooter) {
|
||||
setTimeout(function(){
|
||||
that.resetView.call(that);
|
||||
}, 1);
|
||||
}
|
||||
};
|
||||
|
||||
var changeView = function (that, width, height) {
|
||||
if (that.options.minHeight) {
|
||||
if ((width <= that.options.minWidth) && (height <= that.options.minHeight)) {
|
||||
conditionCardView(that);
|
||||
} else if ((width > that.options.minWidth) && (height > that.options.minHeight)) {
|
||||
conditionFullView(that);
|
||||
}
|
||||
} else {
|
||||
if (width <= that.options.minWidth) {
|
||||
conditionCardView(that);
|
||||
} else if (width > that.options.minWidth) {
|
||||
conditionFullView(that);
|
||||
}
|
||||
}
|
||||
|
||||
resetView(that);
|
||||
};
|
||||
|
||||
var conditionCardView = function (that) {
|
||||
changeTableView(that, false);
|
||||
showHideColumns(that, false);
|
||||
};
|
||||
|
||||
var conditionFullView = function (that) {
|
||||
changeTableView(that, true);
|
||||
showHideColumns(that, true);
|
||||
};
|
||||
|
||||
var changeTableView = function (that, cardViewState) {
|
||||
that.options.cardView = cardViewState;
|
||||
that.toggleView();
|
||||
};
|
||||
|
||||
var debounce = function(func,wait) {
|
||||
var timeout;
|
||||
return function() {
|
||||
var context = this,
|
||||
args = arguments;
|
||||
var later = function() {
|
||||
timeout = null;
|
||||
func.apply(context,args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
mobileResponsive: false,
|
||||
minWidth: 562,
|
||||
minHeight: undefined,
|
||||
heightThreshold: 100, // just slightly larger than mobile chrome's auto-hiding toolbar
|
||||
checkOnInit: true,
|
||||
columnsHidden: []
|
||||
});
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_init = BootstrapTable.prototype.init;
|
||||
|
||||
BootstrapTable.prototype.init = function () {
|
||||
_init.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.mobileResponsive) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.minWidth) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.options.minWidth < 100 && this.options.resizable) {
|
||||
console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
|
||||
this.options.minWidth = 100;
|
||||
}
|
||||
|
||||
var that = this,
|
||||
old = {
|
||||
width: $(window).width(),
|
||||
height: $(window).height()
|
||||
};
|
||||
|
||||
$(window).on('resize orientationchange',debounce(function (evt) {
|
||||
// reset view if height has only changed by at least the threshold.
|
||||
var height = $(this).height(),
|
||||
width = $(this).width();
|
||||
|
||||
if (Math.abs(old.height - height) > that.options.heightThreshold || old.width != width) {
|
||||
changeView(that, width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
},200));
|
||||
|
||||
if (this.options.checkOnInit) {
|
||||
var height = $(window).height(),
|
||||
width = $(window).width();
|
||||
changeView(this, width, height);
|
||||
old = {
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
}
|
||||
};
|
||||
}(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";var b=function(b,c){b.options.columnsHidden.length>0&&a.each(b.columns,function(d,e){-1!==b.options.columnsHidden.indexOf(e.field)&&e.visible!==c&&b.toggleColumn(a.fn.bootstrapTable.utils.getFieldIndex(b.columns,e.field),c,!0)})},c=function(a){(a.options.height||a.options.showFooter)&&setTimeout(function(){a.resetView.call(a)},1)},d=function(a,b,d){a.options.minHeight?b<=a.options.minWidth&&d<=a.options.minHeight?e(a):b>a.options.minWidth&&d>a.options.minHeight&&f(a):b<=a.options.minWidth?e(a):b>a.options.minWidth&&f(a),c(a)},e=function(a){g(a,!1),b(a,!1)},f=function(a){g(a,!0),b(a,!0)},g=function(a,b){a.options.cardView=b,a.toggleView()},h=function(a,b){var c;return function(){var d=this,e=arguments,f=function(){c=null,a.apply(d,e)};clearTimeout(c),c=setTimeout(f,b)}};a.extend(a.fn.bootstrapTable.defaults,{mobileResponsive:!1,minWidth:562,minHeight:void 0,heightThreshold:100,checkOnInit:!0,columnsHidden:[]});var i=a.fn.bootstrapTable.Constructor,j=i.prototype.init;i.prototype.init=function(){if(j.apply(this,Array.prototype.slice.apply(arguments)),this.options.mobileResponsive&&this.options.minWidth){this.options.minWidth<100&&this.options.resizable&&(console.log("The minWidth when the resizable extension is active should be greater or equal than 100"),this.options.minWidth=100);var b=this,c={width:a(window).width(),height:a(window).height()};if(a(window).on("resize orientationchange",h(function(){var e=a(this).height(),f=a(this).width();(Math.abs(c.height-e)>b.options.heightThreshold||c.width!=f)&&(d(b,f,e),c={width:f,height:e})},200)),this.options.checkOnInit){var e=a(window).height(),f=a(window).width();d(this,f,e),c={width:f,height:e}}}}}(jQuery);
|
211
src/main/resources/static/ajax/libs/bootstrap-table/extensions/toolbar/bootstrap-table-toolbar.js
vendored
Normal file
@ -0,0 +1,211 @@
|
||||
/**
|
||||
* @author: aperez <aperez@datadec.es>
|
||||
* @version: v2.0.0
|
||||
*
|
||||
* @update Dennis Hernández <http://djhvscf.github.io/Blog>
|
||||
*/
|
||||
|
||||
!function($) {
|
||||
'use strict';
|
||||
|
||||
var firstLoad = false;
|
||||
|
||||
var sprintf = $.fn.bootstrapTable.utils.sprintf;
|
||||
|
||||
var showAvdSearch = function(pColumns, searchTitle, searchText, that) {
|
||||
if (!$("#avdSearchModal" + "_" + that.options.idTable).hasClass("modal")) {
|
||||
var vModal = sprintf("<div id=\"avdSearchModal%s\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"mySmallModalLabel\" aria-hidden=\"true\">", "_" + that.options.idTable);
|
||||
vModal += "<div class=\"modal-dialog modal-xs\">";
|
||||
vModal += " <div class=\"modal-content\">";
|
||||
vModal += " <div class=\"modal-header\">";
|
||||
vModal += " <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\" >×</button>";
|
||||
vModal += sprintf(" <h4 class=\"modal-title\">%s</h4>", searchTitle);
|
||||
vModal += " </div>";
|
||||
vModal += " <div class=\"modal-body modal-body-custom\">";
|
||||
vModal += sprintf(" <div class=\"container-fluid\" id=\"avdSearchModalContent%s\" style=\"padding-right: 0px;padding-left: 0px;\" >", "_" + that.options.idTable);
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += " </div>";
|
||||
vModal += "</div>";
|
||||
|
||||
$("body").append($(vModal));
|
||||
|
||||
var vFormAvd = createFormAvd(pColumns, searchText, that),
|
||||
timeoutId = 0;;
|
||||
|
||||
$('#avdSearchModalContent' + "_" + that.options.idTable).append(vFormAvd.join(''));
|
||||
|
||||
$('#' + that.options.idForm).off('keyup blur', 'input').on('keyup blur', 'input', function (event) {
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(function () {
|
||||
that.onColumnAdvancedSearch(event);
|
||||
}, that.options.searchTimeOut);
|
||||
});
|
||||
|
||||
$("#btnCloseAvd" + "_" + that.options.idTable).click(function() {
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal('hide');
|
||||
});
|
||||
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal();
|
||||
} else {
|
||||
$("#avdSearchModal" + "_" + that.options.idTable).modal();
|
||||
}
|
||||
};
|
||||
|
||||
var createFormAvd = function(pColumns, searchText, that) {
|
||||
var htmlForm = [];
|
||||
htmlForm.push(sprintf('<form class="form-horizontal" id="%s" action="%s" >', that.options.idForm, that.options.actionForm));
|
||||
for (var i in pColumns) {
|
||||
var vObjCol = pColumns[i];
|
||||
if (!vObjCol.checkbox && vObjCol.visible && vObjCol.searchable) {
|
||||
htmlForm.push('<div class="form-group">');
|
||||
htmlForm.push(sprintf('<label class="col-sm-4 control-label">%s</label>', vObjCol.title));
|
||||
htmlForm.push('<div class="col-sm-6">');
|
||||
htmlForm.push(sprintf('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">', vObjCol.field, vObjCol.title, vObjCol.field));
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</div>');
|
||||
}
|
||||
}
|
||||
|
||||
htmlForm.push('<div class="form-group">');
|
||||
htmlForm.push('<div class="col-sm-offset-9 col-sm-3">');
|
||||
htmlForm.push(sprintf('<button type="button" id="btnCloseAvd%s" class="btn btn-default" >%s</button>', "_" + that.options.idTable, searchText));
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</div>');
|
||||
htmlForm.push('</form>');
|
||||
|
||||
return htmlForm;
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, {
|
||||
advancedSearch: false,
|
||||
idForm: 'advancedSearch',
|
||||
actionForm: '',
|
||||
idTable: undefined,
|
||||
onColumnAdvancedSearch: function (field, text) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults.icons, {
|
||||
advancedSearchIcon: 'glyphicon-chevron-down'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.Constructor.EVENTS, {
|
||||
'column-advanced-search.bs.table': 'onColumnAdvancedSearch'
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.locales, {
|
||||
formatAdvancedSearch: function() {
|
||||
return 'Advanced search';
|
||||
},
|
||||
formatAdvancedCloseButton: function() {
|
||||
return "Close";
|
||||
}
|
||||
});
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
|
||||
|
||||
var BootstrapTable = $.fn.bootstrapTable.Constructor,
|
||||
_initToolbar = BootstrapTable.prototype.initToolbar,
|
||||
_load = BootstrapTable.prototype.load,
|
||||
_initSearch = BootstrapTable.prototype.initSearch;
|
||||
|
||||
BootstrapTable.prototype.initToolbar = function() {
|
||||
_initToolbar.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.search) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.options.idTable) {
|
||||
return;
|
||||
}
|
||||
|
||||
var that = this,
|
||||
html = [];
|
||||
|
||||
html.push(sprintf('<div class="columns columns-%s btn-group pull-%s" role="group">', this.options.buttonsAlign, this.options.buttonsAlign));
|
||||
html.push(sprintf('<button class="btn btn-default%s' + '" type="button" name="advancedSearch" title="%s">', that.options.iconSize === undefined ? '' : ' btn-' + that.options.iconSize, that.options.formatAdvancedSearch()));
|
||||
html.push(sprintf('<i class="%s %s"></i>', that.options.iconsPrefix, that.options.icons.advancedSearchIcon))
|
||||
html.push('</button></div>');
|
||||
|
||||
that.$toolbar.prepend(html.join(''));
|
||||
|
||||
that.$toolbar.find('button[name="advancedSearch"]')
|
||||
.off('click').on('click', function() {
|
||||
showAvdSearch(that.columns, that.options.formatAdvancedSearch(), that.options.formatAdvancedCloseButton(), that);
|
||||
});
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.load = function(data) {
|
||||
_load.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof this.options.idTable === 'undefined') {
|
||||
return;
|
||||
} else {
|
||||
if (!firstLoad) {
|
||||
var height = parseInt($(".bootstrap-table").height());
|
||||
height += 10;
|
||||
$("#" + this.options.idTable).bootstrapTable("resetView", {height: height});
|
||||
firstLoad = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.initSearch = function () {
|
||||
_initSearch.apply(this, Array.prototype.slice.apply(arguments));
|
||||
|
||||
if (!this.options.advancedSearch) {
|
||||
return;
|
||||
}
|
||||
|
||||
var that = this;
|
||||
var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
|
||||
|
||||
this.data = fp ? $.grep(this.data, function (item, i) {
|
||||
for (var key in fp) {
|
||||
var fval = fp[key].toLowerCase();
|
||||
var value = item[key];
|
||||
value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
|
||||
that.header.formatters[$.inArray(key, that.header.fields)],
|
||||
[value, item, i], value);
|
||||
|
||||
if (!($.inArray(key, that.header.fields) !== -1 &&
|
||||
(typeof value === 'string' || typeof value === 'number') &&
|
||||
(value + '').toLowerCase().indexOf(fval) !== -1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}) : this.data;
|
||||
};
|
||||
|
||||
BootstrapTable.prototype.onColumnAdvancedSearch = function (event) {
|
||||
var text = $.trim($(event.currentTarget).val());
|
||||
var $field = $(event.currentTarget)[0].id;
|
||||
|
||||
if ($.isEmptyObject(this.filterColumnsPartial)) {
|
||||
this.filterColumnsPartial = {};
|
||||
}
|
||||
if (text) {
|
||||
this.filterColumnsPartial[$field] = text;
|
||||
} else {
|
||||
delete this.filterColumnsPartial[$field];
|
||||
}
|
||||
|
||||
this.options.pageNumber = 1;
|
||||
this.onSearch(event);
|
||||
this.updatePagination();
|
||||
this.trigger('column-advanced-search', $field, text);
|
||||
};
|
||||
}(jQuery);
|
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* bootstrap-table - v1.11.0 - 2016-07-02
|
||||
* https://github.com/wenzhixin/bootstrap-table
|
||||
* Copyright (c) 2016 zhixin wen
|
||||
* Licensed MIT License
|
||||
*/
|
||||
!function(a){"use strict";var b=!1,c=a.fn.bootstrapTable.utils.sprintf,d=function(b,d,f,g){if(a("#avdSearchModal_"+g.options.idTable).hasClass("modal"))a("#avdSearchModal_"+g.options.idTable).modal();else{var h=c('<div id="avdSearchModal%s" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">',"_"+g.options.idTable);h+='<div class="modal-dialog modal-xs">',h+=' <div class="modal-content">',h+=' <div class="modal-header">',h+=' <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >×</button>',h+=c(' <h4 class="modal-title">%s</h4>',d),h+=" </div>",h+=' <div class="modal-body modal-body-custom">',h+=c(' <div class="container-fluid" id="avdSearchModalContent%s" style="padding-right: 0px;padding-left: 0px;" >',"_"+g.options.idTable),h+=" </div>",h+=" </div>",h+=" </div>",h+=" </div>",h+="</div>",a("body").append(a(h));var i=e(b,f,g),j=0;a("#avdSearchModalContent_"+g.options.idTable).append(i.join("")),a("#"+g.options.idForm).off("keyup blur","input").on("keyup blur","input",function(a){clearTimeout(j),j=setTimeout(function(){g.onColumnAdvancedSearch(a)},g.options.searchTimeOut)}),a("#btnCloseAvd_"+g.options.idTable).click(function(){a("#avdSearchModal_"+g.options.idTable).modal("hide")}),a("#avdSearchModal_"+g.options.idTable).modal()}},e=function(a,b,d){var e=[];e.push(c('<form class="form-horizontal" id="%s" action="%s" >',d.options.idForm,d.options.actionForm));for(var f in a){var g=a[f];!g.checkbox&&g.visible&&g.searchable&&(e.push('<div class="form-group">'),e.push(c('<label class="col-sm-4 control-label">%s</label>',g.title)),e.push('<div class="col-sm-6">'),e.push(c('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">',g.field,g.title,g.field)),e.push("</div>"),e.push("</div>"))}return e.push('<div class="form-group">'),e.push('<div class="col-sm-offset-9 col-sm-3">'),e.push(c('<button type="button" id="btnCloseAvd%s" class="btn btn-default" >%s</button>',"_"+d.options.idTable,b)),e.push("</div>"),e.push("</div>"),e.push("</form>"),e};a.extend(a.fn.bootstrapTable.defaults,{advancedSearch:!1,idForm:"advancedSearch",actionForm:"",idTable:void 0,onColumnAdvancedSearch:function(){return!1}}),a.extend(a.fn.bootstrapTable.defaults.icons,{advancedSearchIcon:"glyphicon-chevron-down"}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"column-advanced-search.bs.table":"onColumnAdvancedSearch"}),a.extend(a.fn.bootstrapTable.locales,{formatAdvancedSearch:function(){return"Advanced search"},formatAdvancedCloseButton:function(){return"Close"}}),a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales);var f=a.fn.bootstrapTable.Constructor,g=f.prototype.initToolbar,h=f.prototype.load,i=f.prototype.initSearch;f.prototype.initToolbar=function(){if(g.apply(this,Array.prototype.slice.apply(arguments)),this.options.search&&this.options.advancedSearch&&this.options.idTable){var a=this,b=[];b.push(c('<div class="columns columns-%s btn-group pull-%s" role="group">',this.options.buttonsAlign,this.options.buttonsAlign)),b.push(c('<button class="btn btn-default%s" type="button" name="advancedSearch" title="%s">',void 0===a.options.iconSize?"":" btn-"+a.options.iconSize,a.options.formatAdvancedSearch())),b.push(c('<i class="%s %s"></i>',a.options.iconsPrefix,a.options.icons.advancedSearchIcon)),b.push("</button></div>"),a.$toolbar.prepend(b.join("")),a.$toolbar.find('button[name="advancedSearch"]').off("click").on("click",function(){d(a.columns,a.options.formatAdvancedSearch(),a.options.formatAdvancedCloseButton(),a)})}},f.prototype.load=function(){if(h.apply(this,Array.prototype.slice.apply(arguments)),this.options.advancedSearch&&"undefined"!=typeof this.options.idTable&&!b){var c=parseInt(a(".bootstrap-table").height());c+=10,a("#"+this.options.idTable).bootstrapTable("resetView",{height:c}),b=!0}},f.prototype.initSearch=function(){if(i.apply(this,Array.prototype.slice.apply(arguments)),this.options.advancedSearch){var b=this,c=a.isEmptyObject(this.filterColumnsPartial)?null:this.filterColumnsPartial;this.data=c?a.grep(this.data,function(d,e){for(var f in c){var g=c[f].toLowerCase(),h=d[f];if(h=a.fn.bootstrapTable.utils.calculateObjectValue(b.header,b.header.formatters[a.inArray(f,b.header.fields)],[h,d,e],h),-1===a.inArray(f,b.header.fields)||"string"!=typeof h&&"number"!=typeof h||-1===(h+"").toLowerCase().indexOf(g))return!1}return!0}):this.data}},f.prototype.onColumnAdvancedSearch=function(b){var c=a.trim(a(b.currentTarget).val()),d=a(b.currentTarget)[0].id;a.isEmptyObject(this.filterColumnsPartial)&&(this.filterColumnsPartial={}),c?this.filterColumnsPartial[d]=c:delete this.filterColumnsPartial[d],this.options.pageNumber=1,this.onSearch(b),this.updatePagination(),this.trigger("column-advanced-search",d,c)}}(jQuery);
|
42
src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.js
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
$.fn.bootstrapTable.locales['zh-CN'] = {
|
||||
formatLoadingMessage: function () {
|
||||
return '正在努力地加载数据中,请稍候……';
|
||||
},
|
||||
formatRecordsPerPage: function (pageNumber) {
|
||||
return pageNumber + ' 条记录每页';
|
||||
},
|
||||
formatShowingRows: function (pageFrom, pageTo, totalRows) {
|
||||
return '第 ' + pageFrom + ' 到 ' + pageTo + ' 条,共 ' + totalRows + ' 条记录。';
|
||||
},
|
||||
formatSearch: function () {
|
||||
return '搜索';
|
||||
},
|
||||
formatNoMatches: function () {
|
||||
return '没有找到匹配的记录';
|
||||
},
|
||||
formatPaginationSwitch: function () {
|
||||
return '隐藏/显示分页';
|
||||
},
|
||||
formatRefresh: function () {
|
||||
return '刷新';
|
||||
},
|
||||
formatToggle: function () {
|
||||
return '切换';
|
||||
},
|
||||
formatColumns: function () {
|
||||
return '列';
|
||||
},
|
||||
formatExport: function () {
|
||||
return '导出数据';
|
||||
},
|
||||
formatClearFilters: function () {
|
||||
return '清空过滤';
|
||||
}
|
||||
};
|
||||
|
||||
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);
|
||||
|
||||
})(jQuery);
|
1
src/main/resources/static/ajax/libs/bootstrap-table/locale/bootstrap-table-zh-CN.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function($){$.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(pageNumber){return pageNumber+" 条记录每页"},formatShowingRows:function(pageFrom,pageTo,totalRows){return"第 "+pageFrom+" 到 "+pageTo+" 条,共 "+totalRows+" 条记录。"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"},formatExport:function(){return"导出数据"},formatClearFilters:function(){return"清空过滤"}};$.extend($.fn.bootstrapTable.defaults,$.fn.bootstrapTable.locales["zh-CN"])})(jQuery);
|
1671
src/main/resources/static/ajax/libs/datapicker/bootstrap-datepicker.js
vendored
Normal file
789
src/main/resources/static/ajax/libs/datapicker/datepicker3.css
Normal file
@ -0,0 +1,789 @@
|
||||
/*!
|
||||
* Datepicker for Bootstrap
|
||||
*
|
||||
* Copyright 2012 Stefan Petre
|
||||
* Improvements by Andrew Rowls
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*/
|
||||
.datepicker {
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
direction: ltr;
|
||||
/*.dow {
|
||||
border-top: 1px solid #ddd !important;
|
||||
}*/
|
||||
}
|
||||
.datepicker-inline {
|
||||
width: 220px;
|
||||
}
|
||||
.datepicker.datepicker-rtl {
|
||||
direction: rtl;
|
||||
}
|
||||
.datepicker.datepicker-rtl table tr td span {
|
||||
float: right;
|
||||
}
|
||||
.datepicker-dropdown {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.datepicker-dropdown:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-top: 0;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
}
|
||||
.datepicker-dropdown:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #fff;
|
||||
border-top: 0;
|
||||
position: absolute;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-left:before {
|
||||
left: 6px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-left:after {
|
||||
left: 7px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-right:before {
|
||||
right: 6px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-right:after {
|
||||
right: 7px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-top:before {
|
||||
top: -7px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-top:after {
|
||||
top: -6px;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-bottom:before {
|
||||
bottom: -7px;
|
||||
border-bottom: 0;
|
||||
border-top: 7px solid #999;
|
||||
}
|
||||
.datepicker-dropdown.datepicker-orient-bottom:after {
|
||||
bottom: -6px;
|
||||
border-bottom: 0;
|
||||
border-top: 6px solid #fff;
|
||||
}
|
||||
.datepicker > div {
|
||||
display: none;
|
||||
}
|
||||
.datepicker.days div.datepicker-days {
|
||||
display: block;
|
||||
}
|
||||
.datepicker.months div.datepicker-months {
|
||||
display: block;
|
||||
}
|
||||
.datepicker.years div.datepicker-years {
|
||||
display: block;
|
||||
}
|
||||
.datepicker table {
|
||||
margin: 0;
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.datepicker table tr td,
|
||||
.datepicker table tr th {
|
||||
text-align: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
}
|
||||
.table-striped .datepicker table tr td,
|
||||
.table-striped .datepicker table tr th {
|
||||
background-color: transparent;
|
||||
}
|
||||
.datepicker table tr td.day:hover,
|
||||
.datepicker table tr td.day.focused {
|
||||
background: #eeeeee;
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker table tr td.old,
|
||||
.datepicker table tr td.new {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker table tr td.disabled,
|
||||
.datepicker table tr td.disabled:hover {
|
||||
background: none;
|
||||
color: #999999;
|
||||
cursor: default;
|
||||
}
|
||||
.datepicker table tr td.today,
|
||||
.datepicker table tr td.today:hover,
|
||||
.datepicker table tr td.today.disabled,
|
||||
.datepicker table tr td.today.disabled:hover {
|
||||
color: #000000;
|
||||
background-color: #ffdb99;
|
||||
border-color: #ffb733;
|
||||
}
|
||||
.datepicker table tr td.today:hover,
|
||||
.datepicker table tr td.today:hover:hover,
|
||||
.datepicker table tr td.today.disabled:hover,
|
||||
.datepicker table tr td.today.disabled:hover:hover,
|
||||
.datepicker table tr td.today:focus,
|
||||
.datepicker table tr td.today:hover:focus,
|
||||
.datepicker table tr td.today.disabled:focus,
|
||||
.datepicker table tr td.today.disabled:hover:focus,
|
||||
.datepicker table tr td.today:active,
|
||||
.datepicker table tr td.today:hover:active,
|
||||
.datepicker table tr td.today.disabled:active,
|
||||
.datepicker table tr td.today.disabled:hover:active,
|
||||
.datepicker table tr td.today.active,
|
||||
.datepicker table tr td.today:hover.active,
|
||||
.datepicker table tr td.today.disabled.active,
|
||||
.datepicker table tr td.today.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.today,
|
||||
.open .dropdown-toggle.datepicker table tr td.today:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.today.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
|
||||
color: #000000;
|
||||
background-color: #ffcd70;
|
||||
border-color: #f59e00;
|
||||
}
|
||||
.datepicker table tr td.today:active,
|
||||
.datepicker table tr td.today:hover:active,
|
||||
.datepicker table tr td.today.disabled:active,
|
||||
.datepicker table tr td.today.disabled:hover:active,
|
||||
.datepicker table tr td.today.active,
|
||||
.datepicker table tr td.today:hover.active,
|
||||
.datepicker table tr td.today.disabled.active,
|
||||
.datepicker table tr td.today.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.today,
|
||||
.open .dropdown-toggle.datepicker table tr td.today:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.today.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.today.disabled:hover {
|
||||
background-image: none;
|
||||
}
|
||||
.datepicker table tr td.today.disabled,
|
||||
.datepicker table tr td.today:hover.disabled,
|
||||
.datepicker table tr td.today.disabled.disabled,
|
||||
.datepicker table tr td.today.disabled:hover.disabled,
|
||||
.datepicker table tr td.today[disabled],
|
||||
.datepicker table tr td.today:hover[disabled],
|
||||
.datepicker table tr td.today.disabled[disabled],
|
||||
.datepicker table tr td.today.disabled:hover[disabled],
|
||||
fieldset[disabled] .datepicker table tr td.today,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
|
||||
.datepicker table tr td.today.disabled:hover,
|
||||
.datepicker table tr td.today:hover.disabled:hover,
|
||||
.datepicker table tr td.today.disabled.disabled:hover,
|
||||
.datepicker table tr td.today.disabled:hover.disabled:hover,
|
||||
.datepicker table tr td.today[disabled]:hover,
|
||||
.datepicker table tr td.today:hover[disabled]:hover,
|
||||
.datepicker table tr td.today.disabled[disabled]:hover,
|
||||
.datepicker table tr td.today.disabled:hover[disabled]:hover,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover:hover,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover:hover,
|
||||
.datepicker table tr td.today.disabled:focus,
|
||||
.datepicker table tr td.today:hover.disabled:focus,
|
||||
.datepicker table tr td.today.disabled.disabled:focus,
|
||||
.datepicker table tr td.today.disabled:hover.disabled:focus,
|
||||
.datepicker table tr td.today[disabled]:focus,
|
||||
.datepicker table tr td.today:hover[disabled]:focus,
|
||||
.datepicker table tr td.today.disabled[disabled]:focus,
|
||||
.datepicker table tr td.today.disabled:hover[disabled]:focus,
|
||||
fieldset[disabled] .datepicker table tr td.today:focus,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover:focus,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:focus,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover:focus,
|
||||
.datepicker table tr td.today.disabled:active,
|
||||
.datepicker table tr td.today:hover.disabled:active,
|
||||
.datepicker table tr td.today.disabled.disabled:active,
|
||||
.datepicker table tr td.today.disabled:hover.disabled:active,
|
||||
.datepicker table tr td.today[disabled]:active,
|
||||
.datepicker table tr td.today:hover[disabled]:active,
|
||||
.datepicker table tr td.today.disabled[disabled]:active,
|
||||
.datepicker table tr td.today.disabled:hover[disabled]:active,
|
||||
fieldset[disabled] .datepicker table tr td.today:active,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover:active,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:active,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover:active,
|
||||
.datepicker table tr td.today.disabled.active,
|
||||
.datepicker table tr td.today:hover.disabled.active,
|
||||
.datepicker table tr td.today.disabled.disabled.active,
|
||||
.datepicker table tr td.today.disabled:hover.disabled.active,
|
||||
.datepicker table tr td.today[disabled].active,
|
||||
.datepicker table tr td.today:hover[disabled].active,
|
||||
.datepicker table tr td.today.disabled[disabled].active,
|
||||
.datepicker table tr td.today.disabled:hover[disabled].active,
|
||||
fieldset[disabled] .datepicker table tr td.today.active,
|
||||
fieldset[disabled] .datepicker table tr td.today:hover.active,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled.active,
|
||||
fieldset[disabled] .datepicker table tr td.today.disabled:hover.active {
|
||||
background-color: #ffdb99;
|
||||
border-color: #ffb733;
|
||||
}
|
||||
.datepicker table tr td.today:hover:hover {
|
||||
color: #000;
|
||||
}
|
||||
.datepicker table tr td.today.active:hover {
|
||||
color: #fff;
|
||||
}
|
||||
.datepicker table tr td.range,
|
||||
.datepicker table tr td.range:hover,
|
||||
.datepicker table tr td.range.disabled,
|
||||
.datepicker table tr td.range.disabled:hover {
|
||||
background: #eeeeee;
|
||||
border-radius: 0;
|
||||
}
|
||||
.datepicker table tr td.range.today,
|
||||
.datepicker table tr td.range.today:hover,
|
||||
.datepicker table tr td.range.today.disabled,
|
||||
.datepicker table tr td.range.today.disabled:hover {
|
||||
color: #000000;
|
||||
background-color: #f7ca77;
|
||||
border-color: #f1a417;
|
||||
border-radius: 0;
|
||||
}
|
||||
.datepicker table tr td.range.today:hover,
|
||||
.datepicker table tr td.range.today:hover:hover,
|
||||
.datepicker table tr td.range.today.disabled:hover,
|
||||
.datepicker table tr td.range.today.disabled:hover:hover,
|
||||
.datepicker table tr td.range.today:focus,
|
||||
.datepicker table tr td.range.today:hover:focus,
|
||||
.datepicker table tr td.range.today.disabled:focus,
|
||||
.datepicker table tr td.range.today.disabled:hover:focus,
|
||||
.datepicker table tr td.range.today:active,
|
||||
.datepicker table tr td.range.today:hover:active,
|
||||
.datepicker table tr td.range.today.disabled:active,
|
||||
.datepicker table tr td.range.today.disabled:hover:active,
|
||||
.datepicker table tr td.range.today.active,
|
||||
.datepicker table tr td.range.today:hover.active,
|
||||
.datepicker table tr td.range.today.disabled.active,
|
||||
.datepicker table tr td.range.today.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
|
||||
color: #000000;
|
||||
background-color: #f4bb51;
|
||||
border-color: #bf800c;
|
||||
}
|
||||
.datepicker table tr td.range.today:active,
|
||||
.datepicker table tr td.range.today:hover:active,
|
||||
.datepicker table tr td.range.today.disabled:active,
|
||||
.datepicker table tr td.range.today.disabled:hover:active,
|
||||
.datepicker table tr td.range.today.active,
|
||||
.datepicker table tr td.range.today:hover.active,
|
||||
.datepicker table tr td.range.today.disabled.active,
|
||||
.datepicker table tr td.range.today.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.range.today.disabled:hover {
|
||||
background-image: none;
|
||||
}
|
||||
.datepicker table tr td.range.today.disabled,
|
||||
.datepicker table tr td.range.today:hover.disabled,
|
||||
.datepicker table tr td.range.today.disabled.disabled,
|
||||
.datepicker table tr td.range.today.disabled:hover.disabled,
|
||||
.datepicker table tr td.range.today[disabled],
|
||||
.datepicker table tr td.range.today:hover[disabled],
|
||||
.datepicker table tr td.range.today.disabled[disabled],
|
||||
.datepicker table tr td.range.today.disabled:hover[disabled],
|
||||
fieldset[disabled] .datepicker table tr td.range.today,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
|
||||
.datepicker table tr td.range.today.disabled:hover,
|
||||
.datepicker table tr td.range.today:hover.disabled:hover,
|
||||
.datepicker table tr td.range.today.disabled.disabled:hover,
|
||||
.datepicker table tr td.range.today.disabled:hover.disabled:hover,
|
||||
.datepicker table tr td.range.today[disabled]:hover,
|
||||
.datepicker table tr td.range.today:hover[disabled]:hover,
|
||||
.datepicker table tr td.range.today.disabled[disabled]:hover,
|
||||
.datepicker table tr td.range.today.disabled:hover[disabled]:hover,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover:hover,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:hover,
|
||||
.datepicker table tr td.range.today.disabled:focus,
|
||||
.datepicker table tr td.range.today:hover.disabled:focus,
|
||||
.datepicker table tr td.range.today.disabled.disabled:focus,
|
||||
.datepicker table tr td.range.today.disabled:hover.disabled:focus,
|
||||
.datepicker table tr td.range.today[disabled]:focus,
|
||||
.datepicker table tr td.range.today:hover[disabled]:focus,
|
||||
.datepicker table tr td.range.today.disabled[disabled]:focus,
|
||||
.datepicker table tr td.range.today.disabled:hover[disabled]:focus,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:focus,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover:focus,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:focus,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:focus,
|
||||
.datepicker table tr td.range.today.disabled:active,
|
||||
.datepicker table tr td.range.today:hover.disabled:active,
|
||||
.datepicker table tr td.range.today.disabled.disabled:active,
|
||||
.datepicker table tr td.range.today.disabled:hover.disabled:active,
|
||||
.datepicker table tr td.range.today[disabled]:active,
|
||||
.datepicker table tr td.range.today:hover[disabled]:active,
|
||||
.datepicker table tr td.range.today.disabled[disabled]:active,
|
||||
.datepicker table tr td.range.today.disabled:hover[disabled]:active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover:active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover:active,
|
||||
.datepicker table tr td.range.today.disabled.active,
|
||||
.datepicker table tr td.range.today:hover.disabled.active,
|
||||
.datepicker table tr td.range.today.disabled.disabled.active,
|
||||
.datepicker table tr td.range.today.disabled:hover.disabled.active,
|
||||
.datepicker table tr td.range.today[disabled].active,
|
||||
.datepicker table tr td.range.today:hover[disabled].active,
|
||||
.datepicker table tr td.range.today.disabled[disabled].active,
|
||||
.datepicker table tr td.range.today.disabled:hover[disabled].active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today:hover.active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled.active,
|
||||
fieldset[disabled] .datepicker table tr td.range.today.disabled:hover.active {
|
||||
background-color: #f7ca77;
|
||||
border-color: #f1a417;
|
||||
}
|
||||
.datepicker table tr td.selected,
|
||||
.datepicker table tr td.selected:hover,
|
||||
.datepicker table tr td.selected.disabled,
|
||||
.datepicker table tr td.selected.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #999999;
|
||||
border-color: #555555;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker table tr td.selected:hover,
|
||||
.datepicker table tr td.selected:hover:hover,
|
||||
.datepicker table tr td.selected.disabled:hover,
|
||||
.datepicker table tr td.selected.disabled:hover:hover,
|
||||
.datepicker table tr td.selected:focus,
|
||||
.datepicker table tr td.selected:hover:focus,
|
||||
.datepicker table tr td.selected.disabled:focus,
|
||||
.datepicker table tr td.selected.disabled:hover:focus,
|
||||
.datepicker table tr td.selected:active,
|
||||
.datepicker table tr td.selected:hover:active,
|
||||
.datepicker table tr td.selected.disabled:active,
|
||||
.datepicker table tr td.selected.disabled:hover:active,
|
||||
.datepicker table tr td.selected.active,
|
||||
.datepicker table tr td.selected:hover.active,
|
||||
.datepicker table tr td.selected.disabled.active,
|
||||
.datepicker table tr td.selected.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #858585;
|
||||
border-color: #373737;
|
||||
}
|
||||
.datepicker table tr td.selected:active,
|
||||
.datepicker table tr td.selected:hover:active,
|
||||
.datepicker table tr td.selected.disabled:active,
|
||||
.datepicker table tr td.selected.disabled:hover:active,
|
||||
.datepicker table tr td.selected.active,
|
||||
.datepicker table tr td.selected:hover.active,
|
||||
.datepicker table tr td.selected.disabled.active,
|
||||
.datepicker table tr td.selected.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.selected.disabled:hover {
|
||||
background-image: none;
|
||||
}
|
||||
.datepicker table tr td.selected.disabled,
|
||||
.datepicker table tr td.selected:hover.disabled,
|
||||
.datepicker table tr td.selected.disabled.disabled,
|
||||
.datepicker table tr td.selected.disabled:hover.disabled,
|
||||
.datepicker table tr td.selected[disabled],
|
||||
.datepicker table tr td.selected:hover[disabled],
|
||||
.datepicker table tr td.selected.disabled[disabled],
|
||||
.datepicker table tr td.selected.disabled:hover[disabled],
|
||||
fieldset[disabled] .datepicker table tr td.selected,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
|
||||
.datepicker table tr td.selected.disabled:hover,
|
||||
.datepicker table tr td.selected:hover.disabled:hover,
|
||||
.datepicker table tr td.selected.disabled.disabled:hover,
|
||||
.datepicker table tr td.selected.disabled:hover.disabled:hover,
|
||||
.datepicker table tr td.selected[disabled]:hover,
|
||||
.datepicker table tr td.selected:hover[disabled]:hover,
|
||||
.datepicker table tr td.selected.disabled[disabled]:hover,
|
||||
.datepicker table tr td.selected.disabled:hover[disabled]:hover,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover:hover,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:hover,
|
||||
.datepicker table tr td.selected.disabled:focus,
|
||||
.datepicker table tr td.selected:hover.disabled:focus,
|
||||
.datepicker table tr td.selected.disabled.disabled:focus,
|
||||
.datepicker table tr td.selected.disabled:hover.disabled:focus,
|
||||
.datepicker table tr td.selected[disabled]:focus,
|
||||
.datepicker table tr td.selected:hover[disabled]:focus,
|
||||
.datepicker table tr td.selected.disabled[disabled]:focus,
|
||||
.datepicker table tr td.selected.disabled:hover[disabled]:focus,
|
||||
fieldset[disabled] .datepicker table tr td.selected:focus,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover:focus,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:focus,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:focus,
|
||||
.datepicker table tr td.selected.disabled:active,
|
||||
.datepicker table tr td.selected:hover.disabled:active,
|
||||
.datepicker table tr td.selected.disabled.disabled:active,
|
||||
.datepicker table tr td.selected.disabled:hover.disabled:active,
|
||||
.datepicker table tr td.selected[disabled]:active,
|
||||
.datepicker table tr td.selected:hover[disabled]:active,
|
||||
.datepicker table tr td.selected.disabled[disabled]:active,
|
||||
.datepicker table tr td.selected.disabled:hover[disabled]:active,
|
||||
fieldset[disabled] .datepicker table tr td.selected:active,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover:active,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:active,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover:active,
|
||||
.datepicker table tr td.selected.disabled.active,
|
||||
.datepicker table tr td.selected:hover.disabled.active,
|
||||
.datepicker table tr td.selected.disabled.disabled.active,
|
||||
.datepicker table tr td.selected.disabled:hover.disabled.active,
|
||||
.datepicker table tr td.selected[disabled].active,
|
||||
.datepicker table tr td.selected:hover[disabled].active,
|
||||
.datepicker table tr td.selected.disabled[disabled].active,
|
||||
.datepicker table tr td.selected.disabled:hover[disabled].active,
|
||||
fieldset[disabled] .datepicker table tr td.selected.active,
|
||||
fieldset[disabled] .datepicker table tr td.selected:hover.active,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled.active,
|
||||
fieldset[disabled] .datepicker table tr td.selected.disabled:hover.active {
|
||||
background-color: #999999;
|
||||
border-color: #555555;
|
||||
}
|
||||
.datepicker table tr td.active,
|
||||
.datepicker table tr td.active:hover,
|
||||
.datepicker table tr td.active.disabled,
|
||||
.datepicker table tr td.active.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #428bca;
|
||||
border-color: #357ebd;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker table tr td.active:hover,
|
||||
.datepicker table tr td.active:hover:hover,
|
||||
.datepicker table tr td.active.disabled:hover,
|
||||
.datepicker table tr td.active.disabled:hover:hover,
|
||||
.datepicker table tr td.active:focus,
|
||||
.datepicker table tr td.active:hover:focus,
|
||||
.datepicker table tr td.active.disabled:focus,
|
||||
.datepicker table tr td.active.disabled:hover:focus,
|
||||
.datepicker table tr td.active:active,
|
||||
.datepicker table tr td.active:hover:active,
|
||||
.datepicker table tr td.active.disabled:active,
|
||||
.datepicker table tr td.active.disabled:hover:active,
|
||||
.datepicker table tr td.active.active,
|
||||
.datepicker table tr td.active:hover.active,
|
||||
.datepicker table tr td.active.disabled.active,
|
||||
.datepicker table tr td.active.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.active:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.active.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #3276b1;
|
||||
border-color: #285e8e;
|
||||
}
|
||||
.datepicker table tr td.active:active,
|
||||
.datepicker table tr td.active:hover:active,
|
||||
.datepicker table tr td.active.disabled:active,
|
||||
.datepicker table tr td.active.disabled:hover:active,
|
||||
.datepicker table tr td.active.active,
|
||||
.datepicker table tr td.active:hover.active,
|
||||
.datepicker table tr td.active.disabled.active,
|
||||
.datepicker table tr td.active.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.active,
|
||||
.open .dropdown-toggle.datepicker table tr td.active:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td.active.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td.active.disabled:hover {
|
||||
background-image: none;
|
||||
}
|
||||
.datepicker table tr td.active.disabled,
|
||||
.datepicker table tr td.active:hover.disabled,
|
||||
.datepicker table tr td.active.disabled.disabled,
|
||||
.datepicker table tr td.active.disabled:hover.disabled,
|
||||
.datepicker table tr td.active[disabled],
|
||||
.datepicker table tr td.active:hover[disabled],
|
||||
.datepicker table tr td.active.disabled[disabled],
|
||||
.datepicker table tr td.active.disabled:hover[disabled],
|
||||
fieldset[disabled] .datepicker table tr td.active,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
|
||||
.datepicker table tr td.active.disabled:hover,
|
||||
.datepicker table tr td.active:hover.disabled:hover,
|
||||
.datepicker table tr td.active.disabled.disabled:hover,
|
||||
.datepicker table tr td.active.disabled:hover.disabled:hover,
|
||||
.datepicker table tr td.active[disabled]:hover,
|
||||
.datepicker table tr td.active:hover[disabled]:hover,
|
||||
.datepicker table tr td.active.disabled[disabled]:hover,
|
||||
.datepicker table tr td.active.disabled:hover[disabled]:hover,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover:hover,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover:hover,
|
||||
.datepicker table tr td.active.disabled:focus,
|
||||
.datepicker table tr td.active:hover.disabled:focus,
|
||||
.datepicker table tr td.active.disabled.disabled:focus,
|
||||
.datepicker table tr td.active.disabled:hover.disabled:focus,
|
||||
.datepicker table tr td.active[disabled]:focus,
|
||||
.datepicker table tr td.active:hover[disabled]:focus,
|
||||
.datepicker table tr td.active.disabled[disabled]:focus,
|
||||
.datepicker table tr td.active.disabled:hover[disabled]:focus,
|
||||
fieldset[disabled] .datepicker table tr td.active:focus,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover:focus,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:focus,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover:focus,
|
||||
.datepicker table tr td.active.disabled:active,
|
||||
.datepicker table tr td.active:hover.disabled:active,
|
||||
.datepicker table tr td.active.disabled.disabled:active,
|
||||
.datepicker table tr td.active.disabled:hover.disabled:active,
|
||||
.datepicker table tr td.active[disabled]:active,
|
||||
.datepicker table tr td.active:hover[disabled]:active,
|
||||
.datepicker table tr td.active.disabled[disabled]:active,
|
||||
.datepicker table tr td.active.disabled:hover[disabled]:active,
|
||||
fieldset[disabled] .datepicker table tr td.active:active,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover:active,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:active,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover:active,
|
||||
.datepicker table tr td.active.disabled.active,
|
||||
.datepicker table tr td.active:hover.disabled.active,
|
||||
.datepicker table tr td.active.disabled.disabled.active,
|
||||
.datepicker table tr td.active.disabled:hover.disabled.active,
|
||||
.datepicker table tr td.active[disabled].active,
|
||||
.datepicker table tr td.active:hover[disabled].active,
|
||||
.datepicker table tr td.active.disabled[disabled].active,
|
||||
.datepicker table tr td.active.disabled:hover[disabled].active,
|
||||
fieldset[disabled] .datepicker table tr td.active.active,
|
||||
fieldset[disabled] .datepicker table tr td.active:hover.active,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled.active,
|
||||
fieldset[disabled] .datepicker table tr td.active.disabled:hover.active {
|
||||
background-color: #428bca;
|
||||
border-color: #357ebd;
|
||||
}
|
||||
.datepicker table tr td span {
|
||||
display: block;
|
||||
width: 23%;
|
||||
height: 54px;
|
||||
line-height: 54px;
|
||||
float: left;
|
||||
margin: 1%;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.datepicker table tr td span:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.datepicker table tr td span.disabled,
|
||||
.datepicker table tr td span.disabled:hover {
|
||||
background: none;
|
||||
color: #999999;
|
||||
cursor: default;
|
||||
}
|
||||
.datepicker table tr td span.active,
|
||||
.datepicker table tr td span.active:hover,
|
||||
.datepicker table tr td span.active.disabled,
|
||||
.datepicker table tr td span.active.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #428bca;
|
||||
border-color: #357ebd;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.datepicker table tr td span.active:hover,
|
||||
.datepicker table tr td span.active:hover:hover,
|
||||
.datepicker table tr td span.active.disabled:hover,
|
||||
.datepicker table tr td span.active.disabled:hover:hover,
|
||||
.datepicker table tr td span.active:focus,
|
||||
.datepicker table tr td span.active:hover:focus,
|
||||
.datepicker table tr td span.active.disabled:focus,
|
||||
.datepicker table tr td span.active.disabled:hover:focus,
|
||||
.datepicker table tr td span.active:active,
|
||||
.datepicker table tr td span.active:hover:active,
|
||||
.datepicker table tr td span.active.disabled:active,
|
||||
.datepicker table tr td span.active.disabled:hover:active,
|
||||
.datepicker table tr td span.active.active,
|
||||
.datepicker table tr td span.active:hover.active,
|
||||
.datepicker table tr td span.active.disabled.active,
|
||||
.datepicker table tr td span.active.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
|
||||
color: #ffffff;
|
||||
background-color: #3276b1;
|
||||
border-color: #285e8e;
|
||||
}
|
||||
.datepicker table tr td span.active:active,
|
||||
.datepicker table tr td span.active:hover:active,
|
||||
.datepicker table tr td span.active.disabled:active,
|
||||
.datepicker table tr td span.active.disabled:hover:active,
|
||||
.datepicker table tr td span.active.active,
|
||||
.datepicker table tr td span.active:hover.active,
|
||||
.datepicker table tr td span.active.disabled.active,
|
||||
.datepicker table tr td span.active.disabled:hover.active,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active:hover,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active.disabled,
|
||||
.open .dropdown-toggle.datepicker table tr td span.active.disabled:hover {
|
||||
background-image: none;
|
||||
}
|
||||
.datepicker table tr td span.active.disabled,
|
||||
.datepicker table tr td span.active:hover.disabled,
|
||||
.datepicker table tr td span.active.disabled.disabled,
|
||||
.datepicker table tr td span.active.disabled:hover.disabled,
|
||||
.datepicker table tr td span.active[disabled],
|
||||
.datepicker table tr td span.active:hover[disabled],
|
||||
.datepicker table tr td span.active.disabled[disabled],
|
||||
.datepicker table tr td span.active.disabled:hover[disabled],
|
||||
fieldset[disabled] .datepicker table tr td span.active,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
|
||||
.datepicker table tr td span.active.disabled:hover,
|
||||
.datepicker table tr td span.active:hover.disabled:hover,
|
||||
.datepicker table tr td span.active.disabled.disabled:hover,
|
||||
.datepicker table tr td span.active.disabled:hover.disabled:hover,
|
||||
.datepicker table tr td span.active[disabled]:hover,
|
||||
.datepicker table tr td span.active:hover[disabled]:hover,
|
||||
.datepicker table tr td span.active.disabled[disabled]:hover,
|
||||
.datepicker table tr td span.active.disabled:hover[disabled]:hover,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover:hover,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:hover,
|
||||
.datepicker table tr td span.active.disabled:focus,
|
||||
.datepicker table tr td span.active:hover.disabled:focus,
|
||||
.datepicker table tr td span.active.disabled.disabled:focus,
|
||||
.datepicker table tr td span.active.disabled:hover.disabled:focus,
|
||||
.datepicker table tr td span.active[disabled]:focus,
|
||||
.datepicker table tr td span.active:hover[disabled]:focus,
|
||||
.datepicker table tr td span.active.disabled[disabled]:focus,
|
||||
.datepicker table tr td span.active.disabled:hover[disabled]:focus,
|
||||
fieldset[disabled] .datepicker table tr td span.active:focus,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover:focus,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:focus,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:focus,
|
||||
.datepicker table tr td span.active.disabled:active,
|
||||
.datepicker table tr td span.active:hover.disabled:active,
|
||||
.datepicker table tr td span.active.disabled.disabled:active,
|
||||
.datepicker table tr td span.active.disabled:hover.disabled:active,
|
||||
.datepicker table tr td span.active[disabled]:active,
|
||||
.datepicker table tr td span.active:hover[disabled]:active,
|
||||
.datepicker table tr td span.active.disabled[disabled]:active,
|
||||
.datepicker table tr td span.active.disabled:hover[disabled]:active,
|
||||
fieldset[disabled] .datepicker table tr td span.active:active,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover:active,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:active,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover:active,
|
||||
.datepicker table tr td span.active.disabled.active,
|
||||
.datepicker table tr td span.active:hover.disabled.active,
|
||||
.datepicker table tr td span.active.disabled.disabled.active,
|
||||
.datepicker table tr td span.active.disabled:hover.disabled.active,
|
||||
.datepicker table tr td span.active[disabled].active,
|
||||
.datepicker table tr td span.active:hover[disabled].active,
|
||||
.datepicker table tr td span.active.disabled[disabled].active,
|
||||
.datepicker table tr td span.active.disabled:hover[disabled].active,
|
||||
fieldset[disabled] .datepicker table tr td span.active.active,
|
||||
fieldset[disabled] .datepicker table tr td span.active:hover.active,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled.active,
|
||||
fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
|
||||
background-color: #428bca;
|
||||
border-color: #357ebd;
|
||||
}
|
||||
.datepicker table tr td span.old,
|
||||
.datepicker table tr td span.new {
|
||||
color: #999999;
|
||||
}
|
||||
.datepicker th.datepicker-switch {
|
||||
width: 145px;
|
||||
}
|
||||
.datepicker thead tr:first-child th,
|
||||
.datepicker tfoot tr th {
|
||||
cursor: pointer;
|
||||
}
|
||||
.datepicker thead tr:first-child th:hover,
|
||||
.datepicker tfoot tr th:hover {
|
||||
background: #eeeeee;
|
||||
}
|
||||
.datepicker .cw {
|
||||
font-size: 10px;
|
||||
width: 12px;
|
||||
padding: 0 2px 0 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.datepicker thead tr:first-child th.cw {
|
||||
cursor: default;
|
||||
background-color: transparent;
|
||||
}
|
||||
.input-group.date .input-group-addon i {
|
||||
cursor: pointer;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.input-daterange input {
|
||||
text-align: center;
|
||||
}
|
||||
.input-daterange input:first-child {
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
.input-daterange input:last-child {
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
.input-daterange .input-group-addon {
|
||||
width: auto;
|
||||
min-width: 16px;
|
||||
padding: 4px 5px;
|
||||
font-weight: normal;
|
||||
line-height: 1.428571429;
|
||||
text-align: center;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
vertical-align: middle;
|
||||
background-color: #eeeeee;
|
||||
border-width: 1px 0;
|
||||
margin-left: -5px;
|
||||
margin-right: -5px;
|
||||
}
|
||||
.datepicker.dropdown-menu {
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
float: left;
|
||||
display: none;
|
||||
min-width: 160px;
|
||||
list-style: none;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #ccc;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
*border-right-width: 2px;
|
||||
*border-bottom-width: 2px;
|
||||
color: #333333;
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 1.428571429;
|
||||
}
|
||||
.datepicker.dropdown-menu th,
|
||||
.datepicker.dropdown-menu td {
|
||||
padding: 4px 5px;
|
||||
}
|
59
src/main/resources/static/ajax/libs/iCheck/custom.css
Normal file
@ -0,0 +1,59 @@
|
||||
/* iCheck plugin Square skin, green
|
||||
----------------------------------- */
|
||||
.icheckbox_square-green,
|
||||
.iradio_square-green {
|
||||
display: inline-block;
|
||||
*display: inline;
|
||||
vertical-align: middle;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
background: url(green.png) no-repeat;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icheckbox_square-green {
|
||||
background-position: 0 0;
|
||||
}
|
||||
.icheckbox_square-green.hover {
|
||||
background-position: -24px 0;
|
||||
}
|
||||
.icheckbox_square-green.checked {
|
||||
background-position: -48px 0;
|
||||
}
|
||||
.icheckbox_square-green.disabled {
|
||||
background-position: -72px 0;
|
||||
cursor: default;
|
||||
}
|
||||
.icheckbox_square-green.checked.disabled {
|
||||
background-position: -96px 0;
|
||||
}
|
||||
|
||||
.iradio_square-green {
|
||||
background-position: -120px 0;
|
||||
}
|
||||
.iradio_square-green.hover {
|
||||
background-position: -144px 0;
|
||||
}
|
||||
.iradio_square-green.checked {
|
||||
background-position: -168px 0;
|
||||
}
|
||||
.iradio_square-green.disabled {
|
||||
background-position: -192px 0;
|
||||
cursor: default;
|
||||
}
|
||||
.iradio_square-green.checked.disabled {
|
||||
background-position: -216px 0;
|
||||
}
|
||||
|
||||
/* HiDPI support */
|
||||
@media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) {
|
||||
.icheckbox_square-green,
|
||||
.iradio_square-green {
|
||||
background-image: url(green%402x.png);
|
||||
-webkit-background-size: 240px 24px;
|
||||
background-size: 240px 24px;
|
||||
}
|
||||
}
|
BIN
src/main/resources/static/ajax/libs/iCheck/green.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
src/main/resources/static/ajax/libs/iCheck/green@2x.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
11
src/main/resources/static/ajax/libs/iCheck/icheck.min.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
/*! iCheck v1.0.2 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
|
||||
(function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate,
|
||||
v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true");
|
||||
g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap();
|
||||
f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i";
|
||||
_add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c=
|
||||
f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this,
|
||||
b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='<div class="'+l+'" '+(u?'role="'+c[_type]+'" ':"");u&&z.each(function(){h+=
|
||||
'aria-labelledby="';this.id?h+=this.id:(this.id=y,h+=y);h+='"'});h=a.wrap(h+"/>")[_callback]("ifCreated").parent().append(e.insert);d=f('<ins class="'+C+'"/>').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return;
|
||||
A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d=
|
||||
b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
|
@ -0,0 +1,17 @@
|
||||
.treegrid-indent {width:16px; height: 16px; display: inline-block; position: relative;}
|
||||
|
||||
.treegrid-expander {width:16px; height: 16px; display: inline-block; position: relative; cursor: pointer;}
|
||||
|
||||
.treegrid-expander-expanded{background-image: url(img/collapse.png); }
|
||||
.treegrid-expander-collapsed{background-image: url(img/expand.png);}
|
||||
.treegrid-selected{background: #f5f5f5 !important;}
|
||||
.treegrid-table{border:0 !important;margin-bottom:0}
|
||||
.treegrid-table tbody {display:block;height:auto;overflow-y:auto;}
|
||||
.treegrid-table thead, .treegrid-table tbody tr {display:table;width:100%;table-layout:fixed;}
|
||||
.treegrid-thead th{line-height:40px;border: 0 !important;background:#f3f3f4 !important;border-radius: 4px;border-left:1px solid #e7eaec !important;border-bottom:2px solid #e7eaec !important;text-align: center;}
|
||||
.treegrid-thead tr :first-child{border-left:0 !important}
|
||||
.treegrid-tbody td{border: 0 !important;border-left:1px solid #e7eaec !important;border-bottom:1px solid #e7eaec !important;overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;}
|
||||
.treegrid-tbody tr :first-child{border-left:0 !important}
|
||||
|
@ -0,0 +1,258 @@
|
||||
(function($) {
|
||||
"use strict";
|
||||
|
||||
$.fn.bootstrapTreeTable = function(options, param) {
|
||||
// 如果是调用方法
|
||||
if (typeof options == 'string') {
|
||||
return $.fn.bootstrapTreeTable.methods[options](this, param);
|
||||
}
|
||||
|
||||
// 如果是初始化组件
|
||||
options = $.extend({}, $.fn.bootstrapTreeTable.defaults, options || {});
|
||||
// 是否有radio或checkbox
|
||||
var hasSelectItem = false;
|
||||
var target = $(this);
|
||||
// 在外层包装一下div,样式用的bootstrap-table的
|
||||
var _main_div = $("<div class='fixed-table-container'></div>");
|
||||
target.before(_main_div);
|
||||
_main_div.append(target);
|
||||
target.addClass("table table-hover treegrid-table table-bordered");
|
||||
if (options.striped) {
|
||||
target.addClass('table-striped');
|
||||
}
|
||||
// 工具条在外层包装一下div,样式用的bootstrap-table的
|
||||
if(options.toolbar){
|
||||
var _tool_div = $("<div class='fixed-table-toolbar' style='display:none;'></div>");
|
||||
var _tool_left_div = $("<div class='bs-bars pull-left'></div>");
|
||||
_tool_left_div.append($(options.toolbar));
|
||||
_tool_div.append(_tool_left_div);
|
||||
_main_div.before(_tool_div);
|
||||
}
|
||||
// 得到根节点
|
||||
target.getRootNodes = function(data) {
|
||||
// 指定Root节点值
|
||||
var _root = options.rootCodeValue?options.rootCodeValue:null
|
||||
var result = [];
|
||||
$.each(data, function(index, item) {
|
||||
// 这里兼容几种常见Root节点写法
|
||||
// 默认的几种判断
|
||||
var _defaultRootFlag = item[options.parentCode] == '0'
|
||||
|| item[options.parentCode] == 0
|
||||
|| item[options.parentCode] == null
|
||||
|| item[options.parentCode] == '';
|
||||
if (!item[options.parentCode] || (_root?(item[options.parentCode] == options.rootCodeValue):_defaultRootFlag)){
|
||||
result.push(item);
|
||||
}
|
||||
// 添加一个默认属性,用来判断当前节点有没有被显示
|
||||
item.isShow = false;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
var j = 0;
|
||||
// 递归获取子节点并且设置子节点
|
||||
target.getChildNodes = function(data, parentNode, parentIndex, tbody) {
|
||||
$.each(data, function(i, item) {
|
||||
if (item[options.parentCode] == parentNode[options.code]) {
|
||||
var tr = $('<tr></tr>');
|
||||
var nowParentIndex = (parentIndex + (j++) + 1);
|
||||
tr.addClass('treegrid-' + nowParentIndex);
|
||||
tr.addClass('treegrid-parent-' + parentIndex);
|
||||
target.renderRow(tr,item);
|
||||
item.isShow = true;
|
||||
tbody.append(tr);
|
||||
target.getChildNodes(data, item, nowParentIndex, tbody)
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
// 绘制行
|
||||
target.renderRow = function(tr,item){
|
||||
$.each(options.columns, function(index, column) {
|
||||
// 判断有没有选择列
|
||||
if(index==0&&column.field=='selectItem'){
|
||||
hasSelectItem = true;
|
||||
var td = $('<td style="text-align:center;width:36px"></td>');
|
||||
if(column.radio){
|
||||
var _ipt = $('<input name="select_item" type="radio" value="'+item[options.id]+'"></input>');
|
||||
td.append(_ipt);
|
||||
}
|
||||
if(column.checkbox){
|
||||
var _ipt = $('<input name="select_item" type="checkbox" value="'+item[options.id]+'"></input>');
|
||||
td.append(_ipt);
|
||||
}
|
||||
tr.append(td);
|
||||
}else{
|
||||
var td = $('<td style="'+((column.width)?('width:'+column.width):'')+'"></td>');
|
||||
// 增加formatter渲染
|
||||
if (column.formatter) {
|
||||
td.html(column.formatter.call(this, item, index));
|
||||
} else {
|
||||
td.text(item[column.field]);
|
||||
}
|
||||
tr.append(td);
|
||||
}
|
||||
});
|
||||
}
|
||||
// 加载数据
|
||||
target.load = function(parms){
|
||||
// 加载数据前先清空
|
||||
target.html("");
|
||||
// 构造表头
|
||||
var thr = $('<tr></tr>');
|
||||
$.each(options.columns, function(i, item) {
|
||||
var th = null;
|
||||
// 判断有没有选择列
|
||||
if(i==0&&item.field=='selectItem'){
|
||||
hasSelectItem = true;
|
||||
th = $('<th style="width:36px"></th>');
|
||||
}else{
|
||||
th = $('<th style="padding:10px;'+((item.width)?('width:'+item.width):'')+'"></th>');
|
||||
}
|
||||
th.text(item.title);
|
||||
thr.append(th);
|
||||
});
|
||||
var thead = $('<thead class="treegrid-thead"></thead>');
|
||||
thead.append(thr);
|
||||
target.append(thead);
|
||||
// 构造表体
|
||||
var tbody = $('<tbody class="treegrid-tbody"></tbody>');
|
||||
target.append(tbody);
|
||||
// 添加加载loading
|
||||
var _loading = '<tr><td colspan="'+options.columns.length+'"><div style="display: block;text-align: center;">正在努力地加载数据中,请稍候……</div></td></tr>'
|
||||
tbody.html(_loading);
|
||||
// 默认高度
|
||||
if(options.height){
|
||||
tbody.css("height",options.height);
|
||||
}
|
||||
$.ajax({
|
||||
type : options.type,
|
||||
url : options.url,
|
||||
data : parms?parms:options.ajaxParams,
|
||||
dataType : "JSON",
|
||||
success : function(data, textStatus, jqXHR) {
|
||||
// 加载完数据先清空
|
||||
tbody.html("");
|
||||
if(!data||data.length<=0){
|
||||
var _empty = '<tr><td colspan="'+options.columns.length+'"><div style="display: block;text-align: center;">没有记录</div></td></tr>'
|
||||
tbody.html(_empty);
|
||||
return;
|
||||
}
|
||||
var rootNode = target.getRootNodes(data);
|
||||
$.each(rootNode, function(i, item) {
|
||||
var tr = $('<tr></tr>');
|
||||
tr.addClass('treegrid-' + (j + "_" + i));
|
||||
target.renderRow(tr,item);
|
||||
item.isShow = true;
|
||||
tbody.append(tr);
|
||||
target.getChildNodes(data, item, (j + "_" + i), tbody);
|
||||
});
|
||||
// 下边的操作主要是为了查询时让一些没有根节点的节点显示
|
||||
$.each(data, function(i, item) {
|
||||
if(!item.isShow){
|
||||
var tr = $('<tr></tr>');
|
||||
tr.addClass('treegrid-' + (j + "_" + i));
|
||||
target.renderRow(tr,item);
|
||||
tbody.append(tr);
|
||||
}
|
||||
});
|
||||
target.append(tbody);
|
||||
// 初始化treegrid
|
||||
target.treegrid({
|
||||
treeColumn: options.expandColumn?options.expandColumn:(hasSelectItem?1:0),//如果有radio或checkbox默认第二列层级显示,当前是在用户未设置的提前下
|
||||
expanderExpandedClass : options.expanderExpandedClass,
|
||||
expanderCollapsedClass : options.expanderCollapsedClass
|
||||
});
|
||||
if (!options.expandAll) {
|
||||
target.treegrid('collapseAll');
|
||||
}
|
||||
//动态设置表头宽度
|
||||
//thead.css("width", tbody.children(":first").css("width"));
|
||||
// 行点击选中事件
|
||||
target.find("tbody").find("tr").click(function(){
|
||||
if(hasSelectItem){
|
||||
var _ipt = $(this).find("input[name='select_item']");
|
||||
if(_ipt.attr("type")=="radio"){
|
||||
_ipt.prop('checked',true);
|
||||
target.find("tbody").find("tr").removeClass("treegrid-selected");
|
||||
$(this).addClass("treegrid-selected");
|
||||
}else{
|
||||
if(_ipt.prop('checked')){
|
||||
_ipt.prop('checked',false);
|
||||
$(this).removeClass("treegrid-selected");
|
||||
}else{
|
||||
_ipt.prop('checked',true);
|
||||
$(this).addClass("treegrid-selected");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
error:function(xhr,textStatus){
|
||||
var _errorMsg = '<tr><td colspan="'+options.columns.length+'"><div style="display: block;text-align: center;">'+xhr.responseText+'</div></td></tr>'
|
||||
tbody.html(_errorMsg);
|
||||
debugger;
|
||||
},
|
||||
});
|
||||
}
|
||||
if (options.url) {
|
||||
target.load();
|
||||
} else {
|
||||
// 也可以通过defaults里面的data属性通过传递一个数据集合进来对组件进行初始化....有兴趣可以自己实现,思路和上述类似
|
||||
}
|
||||
|
||||
return target;
|
||||
};
|
||||
|
||||
// 组件方法封装........
|
||||
$.fn.bootstrapTreeTable.methods = {
|
||||
// 返回选中记录的id(返回的id由配置中的id属性指定)
|
||||
// 为了兼容bootstrap-table的写法,统一返回数组,这里只返回了指定的id
|
||||
getSelections : function(target, data) {
|
||||
// 所有被选中的记录input
|
||||
var _ipt = target.find("tbody").find("tr").find("input[name='select_item']:checked");
|
||||
var chk_value =[];
|
||||
// 如果是radio
|
||||
if(_ipt.attr("type")=="radio"){
|
||||
chk_value.push({id:_ipt.val()});
|
||||
}else{
|
||||
_ipt.each(function(_i,_item){
|
||||
chk_value.push({id:$(_item).val()});
|
||||
});
|
||||
}
|
||||
return chk_value;
|
||||
},
|
||||
// 刷新记录
|
||||
refresh : function(target, parms) {
|
||||
if(parms){
|
||||
target.load(parms);
|
||||
}else{
|
||||
target.load();
|
||||
}
|
||||
},
|
||||
// 重置表格视图
|
||||
resetHeight : function(target, height) {
|
||||
target.find("tbody").css("height", height + 'px');
|
||||
}
|
||||
// 组件的其他方法也可以进行类似封装........
|
||||
};
|
||||
|
||||
$.fn.bootstrapTreeTable.defaults = {
|
||||
id : 'menuId',// 选取记录返回的值
|
||||
code : 'menuId',// 用于设置父子关系
|
||||
parentCode : 'parentId',// 用于设置父子关系
|
||||
rootCodeValue: null,//设置根节点code值----可指定根节点,默认为null,"",0,"0"
|
||||
data : [], // 构造table的数据集合
|
||||
type : "GET", // 请求数据的ajax类型
|
||||
url : null, // 请求数据的ajax的url
|
||||
ajaxParams : {}, // 请求数据的ajax的data属性
|
||||
expandColumn : null,// 在哪一列上面显示展开按钮
|
||||
expandAll : true, // 是否全部展开
|
||||
striped : false, // 是否各行渐变色
|
||||
columns : [],
|
||||
toolbar: null,//顶部工具条
|
||||
height: 0,
|
||||
expanderExpandedClass : 'glyphicon glyphicon-chevron-down',// 展开的按钮的图标
|
||||
expanderCollapsedClass : 'glyphicon glyphicon-chevron-right'// 缩起的按钮的图标
|
||||
|
||||
};
|
||||
})(jQuery);
|
@ -0,0 +1,619 @@
|
||||
/*
|
||||
* jQuery treegrid Plugin 0.2.0
|
||||
* https://github.com/maxazan/jquery-treegrid
|
||||
*
|
||||
* Copyright 2013, Pomazan Max
|
||||
* Licensed under the MIT licenses.
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
var methods = {
|
||||
/**
|
||||
* Initialize tree
|
||||
*
|
||||
* @param {Object} options
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
initTree: function(options) {
|
||||
var settings = $.extend({}, this.treegrid.defaults, options);
|
||||
return this.each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('setTreeContainer', $(this));
|
||||
$this.treegrid('setSettings', settings);
|
||||
settings.getRootNodes.apply(this, [$(this)]).treegrid('initNode', settings);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Initialize node
|
||||
*
|
||||
* @param {Object} settings
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
initNode: function(settings) {
|
||||
return this.each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('setTreeContainer', settings.getTreeGridContainer.apply(this));
|
||||
$this.treegrid('getChildNodes').treegrid('initNode', settings);
|
||||
$this.treegrid('initExpander').treegrid('initIndent').treegrid('initEvents').treegrid('initState').treegrid("initSettingsEvents");
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Initialize node events
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initEvents: function() {
|
||||
var $this = $(this);
|
||||
//Save state on change
|
||||
$this.on("change", function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('render');
|
||||
if ($this.treegrid('getSetting', 'saveState')) {
|
||||
$this.treegrid('saveState');
|
||||
}
|
||||
});
|
||||
//Default behavior on collapse
|
||||
$this.on("collapse", function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('treegrid-expanded');
|
||||
$this.addClass('treegrid-collapsed');
|
||||
});
|
||||
//Default behavior on expand
|
||||
$this.on("expand", function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('treegrid-collapsed');
|
||||
$this.addClass('treegrid-expanded');
|
||||
});
|
||||
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize events from settings
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initSettingsEvents: function() {
|
||||
var $this = $(this);
|
||||
//Save state on change
|
||||
$this.on("change", function() {
|
||||
var $this = $(this);
|
||||
if (typeof ($this.treegrid('getSetting', 'onChange')) === "function") {
|
||||
$this.treegrid('getSetting', 'onChange').apply($this);
|
||||
}
|
||||
});
|
||||
//Default behavior on collapse
|
||||
$this.on("collapse", function() {
|
||||
var $this = $(this);
|
||||
if (typeof ($this.treegrid('getSetting', 'onCollapse')) === "function") {
|
||||
$this.treegrid('getSetting', 'onCollapse').apply($this);
|
||||
}
|
||||
});
|
||||
//Default behavior on expand
|
||||
$this.on("expand", function() {
|
||||
var $this = $(this);
|
||||
if (typeof ($this.treegrid('getSetting', 'onExpand')) === "function") {
|
||||
$this.treegrid('getSetting', 'onExpand').apply($this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize expander for node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initExpander: function() {
|
||||
var $this = $(this);
|
||||
var cell = $this.find('td').get($this.treegrid('getSetting', 'treeColumn'));
|
||||
var tpl = $this.treegrid('getSetting', 'expanderTemplate');
|
||||
var expander = $this.treegrid('getSetting', 'getExpander').apply(this);
|
||||
if (expander) {
|
||||
expander.remove();
|
||||
}
|
||||
$(tpl).prependTo(cell).click(function() {
|
||||
$($(this).closest('tr')).treegrid('toggle');
|
||||
});
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize indent for node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initIndent: function() {
|
||||
var $this = $(this);
|
||||
$this.find('.treegrid-indent').remove();
|
||||
for (var i = 0; i < $(this).treegrid('getDepth'); i++) {
|
||||
$($this.treegrid('getSetting', 'indentTemplate')).insertBefore($this.find('.treegrid-expander'));
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialise state of node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveState') && !$this.treegrid('isFirstInit')) {
|
||||
$this.treegrid('restoreState');
|
||||
} else {
|
||||
if ($this.treegrid('getSetting', 'initialState') === "expanded") {
|
||||
$this.treegrid('expand');
|
||||
} else {
|
||||
$this.treegrid('collapse');
|
||||
}
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Return true if this tree was never been initialised
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFirstInit: function() {
|
||||
var tree = $(this).treegrid('getTreeContainer');
|
||||
if (tree.data('first_init') === undefined) {
|
||||
tree.data('first_init', $.cookie(tree.treegrid('getSetting', 'saveStateName')) === undefined);
|
||||
}
|
||||
return tree.data('first_init');
|
||||
},
|
||||
/**
|
||||
* Save state of current node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
saveState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveStateMethod') === 'cookie') {
|
||||
|
||||
var stateArrayString = $.cookie($this.treegrid('getSetting', 'saveStateName')) || '';
|
||||
var stateArray = (stateArrayString === '' ? [] : stateArrayString.split(','));
|
||||
var nodeId = $this.treegrid('getNodeId');
|
||||
|
||||
if ($this.treegrid('isExpanded')) {
|
||||
if ($.inArray(nodeId, stateArray) === -1) {
|
||||
stateArray.push(nodeId);
|
||||
}
|
||||
} else if ($this.treegrid('isCollapsed')) {
|
||||
if ($.inArray(nodeId, stateArray) !== -1) {
|
||||
stateArray.splice($.inArray(nodeId, stateArray), 1);
|
||||
}
|
||||
}
|
||||
$.cookie($this.treegrid('getSetting', 'saveStateName'), stateArray.join(','));
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Restore state of current node.
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
restoreState: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('getSetting', 'saveStateMethod') === 'cookie') {
|
||||
var stateArray = $.cookie($this.treegrid('getSetting', 'saveStateName')).split(',');
|
||||
if ($.inArray($this.treegrid('getNodeId'), stateArray) !== -1) {
|
||||
$this.treegrid('expand');
|
||||
} else {
|
||||
$this.treegrid('collapse');
|
||||
}
|
||||
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Method return setting by name
|
||||
*
|
||||
* @param {type} name
|
||||
* @returns {unresolved}
|
||||
*/
|
||||
getSetting: function(name) {
|
||||
if (!$(this).treegrid('getTreeContainer')) {
|
||||
return null;
|
||||
}
|
||||
return $(this).treegrid('getTreeContainer').data('settings')[name];
|
||||
},
|
||||
/**
|
||||
* Add new settings
|
||||
*
|
||||
* @param {Object} settings
|
||||
*/
|
||||
setSettings: function(settings) {
|
||||
$(this).treegrid('getTreeContainer').data('settings', settings);
|
||||
},
|
||||
/**
|
||||
* Return tree container
|
||||
*
|
||||
* @returns {HtmlElement}
|
||||
*/
|
||||
getTreeContainer: function() {
|
||||
return $(this).data('treegrid');
|
||||
},
|
||||
/**
|
||||
* Set tree container
|
||||
*
|
||||
* @param {HtmlE;ement} container
|
||||
*/
|
||||
setTreeContainer: function(container) {
|
||||
return $(this).data('treegrid', container);
|
||||
},
|
||||
/**
|
||||
* Method return all root nodes of tree.
|
||||
*
|
||||
* Start init all child nodes from it.
|
||||
*
|
||||
* @returns {Array}
|
||||
*/
|
||||
getRootNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getRootNodes').apply(this, [$(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Method return all nodes of tree.
|
||||
*
|
||||
* @returns {Array}
|
||||
*/
|
||||
getAllNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getAllNodes').apply(this, [$(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Mthod return true if element is Node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
isNode: function() {
|
||||
return $(this).treegrid('getNodeId') !== null;
|
||||
},
|
||||
/**
|
||||
* Mthod return id of node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
getNodeId: function() {
|
||||
if ($(this).treegrid('getSetting', 'getNodeId') === null) {
|
||||
return null;
|
||||
} else {
|
||||
return $(this).treegrid('getSetting', 'getNodeId').apply(this);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Method return parent id of node or null if root node
|
||||
*
|
||||
* @returns {String}
|
||||
*/
|
||||
getParentNodeId: function() {
|
||||
return $(this).treegrid('getSetting', 'getParentNodeId').apply(this);
|
||||
},
|
||||
/**
|
||||
* Method return parent node or null if root node
|
||||
*
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
getParentNode: function() {
|
||||
if ($(this).treegrid('getParentNodeId') === null) {
|
||||
return null;
|
||||
} else {
|
||||
return $(this).treegrid('getSetting', 'getNodeById').apply(this, [$(this).treegrid('getParentNodeId'), $(this).treegrid('getTreeContainer')]);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Method return array of child nodes or null if node is leaf
|
||||
*
|
||||
* @returns {Object[]}
|
||||
*/
|
||||
getChildNodes: function() {
|
||||
return $(this).treegrid('getSetting', 'getChildNodes').apply(this, [$(this).treegrid('getNodeId'), $(this).treegrid('getTreeContainer')]);
|
||||
},
|
||||
/**
|
||||
* Method return depth of tree.
|
||||
*
|
||||
* This method is needs for calculate indent
|
||||
*
|
||||
* @returns {Number}
|
||||
*/
|
||||
getDepth: function() {
|
||||
if ($(this).treegrid('getParentNode') === null) {
|
||||
return 0;
|
||||
}
|
||||
return $(this).treegrid('getParentNode').treegrid('getDepth') + 1;
|
||||
},
|
||||
/**
|
||||
* Method return true if node is root
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isRoot: function() {
|
||||
return $(this).treegrid('getDepth') === 0;
|
||||
},
|
||||
/**
|
||||
* Method return true if node has no child nodes
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isLeaf: function() {
|
||||
return $(this).treegrid('getChildNodes').length === 0;
|
||||
},
|
||||
/**
|
||||
* Method return true if node last in branch
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isLast: function() {
|
||||
if ($(this).treegrid('isNode')) {
|
||||
var parentNode = $(this).treegrid('getParentNode');
|
||||
if (parentNode === null) {
|
||||
if ($(this).treegrid('getNodeId') === $(this).treegrid('getRootNodes').last().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($(this).treegrid('getNodeId') === parentNode.treegrid('getChildNodes').last().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
/**
|
||||
* Method return true if node first in branch
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFirst: function() {
|
||||
if ($(this).treegrid('isNode')) {
|
||||
var parentNode = $(this).treegrid('getParentNode');
|
||||
if (parentNode === null) {
|
||||
if ($(this).treegrid('getNodeId') === $(this).treegrid('getRootNodes').first().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if ($(this).treegrid('getNodeId') === parentNode.treegrid('getChildNodes').first().treegrid('getNodeId')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
/**
|
||||
* Return true if node expanded
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isExpanded: function() {
|
||||
return $(this).hasClass('treegrid-expanded');
|
||||
},
|
||||
/**
|
||||
* Return true if node collapsed
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isCollapsed: function() {
|
||||
return $(this).hasClass('treegrid-collapsed');
|
||||
},
|
||||
/**
|
||||
* Return true if at least one of parent node is collapsed
|
||||
*
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isOneOfParentsCollapsed: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('isRoot')) {
|
||||
return false;
|
||||
} else {
|
||||
if ($this.treegrid('getParentNode').treegrid('isCollapsed')) {
|
||||
return true;
|
||||
} else {
|
||||
return $this.treegrid('getParentNode').treegrid('isOneOfParentsCollapsed');
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Expand node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expand: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
if (!$this.treegrid('isLeaf') && !$this.treegrid("isExpanded")) {
|
||||
$this.trigger("expand");
|
||||
$this.trigger("change");
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Expand all nodes
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expandAll: function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('getRootNodes').treegrid('expandRecursive');
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Expand current node and all child nodes begin from current
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
expandRecursive: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('expand');
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('getChildNodes').treegrid('expandRecursive');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Collapse node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapse: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
if (!$this.treegrid('isLeaf') && !$this.treegrid("isCollapsed")) {
|
||||
$this.trigger("collapse");
|
||||
$this.trigger("change");
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Collapse all nodes
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapseAll: function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('getRootNodes').treegrid('collapseRecursive');
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Collapse current node and all child nodes begin from current
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
collapseRecursive: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
$this.treegrid('collapse');
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('getChildNodes').treegrid('collapseRecursive');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Expand if collapsed, Collapse if expanded
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
toggle: function() {
|
||||
var $this = $(this);
|
||||
if ($this.treegrid('isExpanded')) {
|
||||
$this.treegrid('collapse');
|
||||
} else {
|
||||
$this.treegrid('expand');
|
||||
}
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Rendering node
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
render: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
|
||||
if ($this.treegrid('isOneOfParentsCollapsed')) {
|
||||
$this.hide();
|
||||
} else {
|
||||
$this.show();
|
||||
}
|
||||
if (!$this.treegrid('isLeaf')) {
|
||||
$this.treegrid('renderExpander');
|
||||
$this.treegrid('getChildNodes').treegrid('render');
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Rendering expander depends on node state
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
renderExpander: function() {
|
||||
return $(this).each(function() {
|
||||
var $this = $(this);
|
||||
var expander = $this.treegrid('getSetting', 'getExpander').apply(this);
|
||||
if (expander) {
|
||||
|
||||
if (!$this.treegrid('isCollapsed')) {
|
||||
expander.removeClass($this.treegrid('getSetting', 'expanderCollapsedClass'));
|
||||
expander.addClass($this.treegrid('getSetting', 'expanderExpandedClass'));
|
||||
} else {
|
||||
expander.removeClass($this.treegrid('getSetting', 'expanderExpandedClass'));
|
||||
expander.addClass($this.treegrid('getSetting', 'expanderCollapsedClass'));
|
||||
}
|
||||
} else {
|
||||
$this.treegrid('initExpander');
|
||||
$this.treegrid('renderExpander');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.treegrid = function(method) {
|
||||
if (methods[method]) {
|
||||
return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return methods.initTree.apply(this, arguments);
|
||||
} else {
|
||||
$.error('Method with name ' + method + ' does not exists for jQuery.treegrid');
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Plugin's default options
|
||||
*/
|
||||
$.fn.treegrid.defaults = {
|
||||
initialState: 'expanded',
|
||||
saveState: false,
|
||||
saveStateMethod: 'cookie',
|
||||
saveStateName: 'tree-grid-state',
|
||||
expanderTemplate: '<span class="treegrid-expander"></span>',
|
||||
indentTemplate: '<span class="treegrid-indent"></span>',
|
||||
expanderExpandedClass: 'treegrid-expander-expanded',
|
||||
expanderCollapsedClass: 'treegrid-expander-collapsed',
|
||||
treeColumn: 0,
|
||||
getExpander: function() {
|
||||
return $(this).find('.treegrid-expander');
|
||||
},
|
||||
getNodeId: function() {
|
||||
var template = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
if (template.test($(this).attr('class'))) {
|
||||
return template.exec($(this).attr('class'))[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getParentNodeId: function() {
|
||||
var template = /treegrid-parent-([A-Za-z0-9_-]+)/;
|
||||
if (template.test($(this).attr('class'))) {
|
||||
return template.exec($(this).attr('class'))[1];
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getNodeById: function(id, treegridContainer) {
|
||||
var templateClass = "treegrid-" + id;
|
||||
return treegridContainer.find('tr.' + templateClass);
|
||||
},
|
||||
getChildNodes: function(id, treegridContainer) {
|
||||
var templateClass = "treegrid-parent-" + id;
|
||||
return treegridContainer.find('tr.' + templateClass);
|
||||
},
|
||||
getTreeGridContainer: function() {
|
||||
return $(this).closest('table');
|
||||
},
|
||||
getRootNodes: function(treegridContainer) {
|
||||
var result = $.grep(treegridContainer.find('tr'), function(element) {
|
||||
var classNames = $(element).attr('class');
|
||||
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
var templateParentClass = /treegrid-parent-([A-Za-z0-9_-]+)/;
|
||||
return templateClass.test(classNames) && !templateParentClass.test(classNames);
|
||||
});
|
||||
return $(result);
|
||||
},
|
||||
getAllNodes: function(treegridContainer) {
|
||||
var result = $.grep(treegridContainer.find('tr'), function(element) {
|
||||
var classNames = $(element).attr('class');
|
||||
var templateClass = /treegrid-([A-Za-z0-9_-]+)/;
|
||||
return templateClass.test(classNames);
|
||||
});
|
||||
return $(result);
|
||||
},
|
||||
//Events
|
||||
onCollapse: null,
|
||||
onExpand: null,
|
||||
onChange: null
|
||||
|
||||
};
|
||||
})(jQuery);
|
2
src/main/resources/static/ajax/libs/jqTreeGrid/jquery.treegrid.min.js
vendored
Normal file
152
src/main/resources/static/ajax/libs/jqTreeGrid/tree.table.js
Normal file
@ -0,0 +1,152 @@
|
||||
/**
|
||||
* 初始化 Tree Table 的封装
|
||||
*/
|
||||
(function () {
|
||||
var TreeTable = function (tableId, url, columns) {
|
||||
this.btInstance = null; //jquery和bootstrapTreeTable绑定的对象
|
||||
this.bstableId = tableId;
|
||||
this.url = url;
|
||||
this.method = "GET";
|
||||
this.columns = columns;
|
||||
this.data = {};// ajax的参数
|
||||
this.expandColumn = null;// 展开显示的列
|
||||
this.id = 'menuId';// 选取记录返回的值
|
||||
this.code = 'menuId';// 用于设置父子关系
|
||||
this.parentCode = 'parentId';// 用于设置父子关系
|
||||
this.expandAll = false;// 是否默认全部展开
|
||||
this.toolbarId = tableId + "Toolbar";
|
||||
this.height = 430;
|
||||
};
|
||||
|
||||
TreeTable.prototype = {
|
||||
/**
|
||||
* 初始化bootstrap table
|
||||
*/
|
||||
init: function () {
|
||||
var tableId = this.bstableId;
|
||||
this.btInstance =
|
||||
$('#'+tableId).bootstrapTreeTable({
|
||||
id: this.id,// 选取记录返回的值
|
||||
code: this.code,// 用于设置父子关系
|
||||
parentCode: this.parentCode,// 用于设置父子关系
|
||||
rootCodeValue: this.rootCodeValue,//设置根节点code值----可指定根节点,默认为null,"",0,"0"
|
||||
type: this.method, //请求数据的ajax类型
|
||||
url: this.url, //请求数据的ajax的url
|
||||
ajaxParams: this.data, //请求数据的ajax的data属性
|
||||
expandColumn: this.expandColumn,//在哪一列上面显示展开按钮,从0开始
|
||||
striped: true, //是否各行渐变色
|
||||
expandAll: this.expandAll, //是否全部展开
|
||||
columns: this.columns, //列数组
|
||||
toolbar: "#" + this.toolbarId,//顶部工具条
|
||||
height: this.height,
|
||||
});
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置在哪一列上面显示展开按钮,从0开始
|
||||
*/
|
||||
setExpandColumn: function (expandColumn) {
|
||||
this.expandColumn = expandColumn;
|
||||
},
|
||||
/**
|
||||
* 设置记录返回的id值
|
||||
*/
|
||||
setIdField: function (id) {
|
||||
this.id = id;
|
||||
},
|
||||
/**
|
||||
* 设置记录分级的字段
|
||||
*/
|
||||
setCodeField: function (code) {
|
||||
this.code = code;
|
||||
},
|
||||
/**
|
||||
* 设置记录分级的父级字段
|
||||
*/
|
||||
setParentCodeField: function (parentCode) {
|
||||
this.parentCode = parentCode;
|
||||
},
|
||||
/**
|
||||
* 设置根节点code值----可指定根节点,默认为null,"",0,"0"
|
||||
*/
|
||||
setRootCodeValue: function (rootCodeValue) {
|
||||
this.rootCodeValue = rootCodeValue;
|
||||
},
|
||||
/**
|
||||
* 设置是否默认全部展开
|
||||
*/
|
||||
setExpandAll: function (expandAll) {
|
||||
this.expandAll = expandAll;
|
||||
},
|
||||
/**
|
||||
* 设置表格高度
|
||||
*/
|
||||
setHeight: function (height) {
|
||||
this.height = height;
|
||||
},
|
||||
/**
|
||||
* 设置ajax post请求时候附带的参数
|
||||
*/
|
||||
set: function (key, value) {
|
||||
if (typeof key == "object") {
|
||||
for (var i in key) {
|
||||
if (typeof i == "function")
|
||||
continue;
|
||||
this.data[i] = key[i];
|
||||
}
|
||||
} else {
|
||||
this.data[key] = (typeof value == "undefined") ? $("#" + key).val() : value;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置ajax get请求时候附带的参数
|
||||
*/
|
||||
setData: function (data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* 清空ajax post请求参数
|
||||
*/
|
||||
clear: function () {
|
||||
this.data = {};
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新表格
|
||||
*/
|
||||
refresh: function (parms) {
|
||||
if (typeof parms != "undefined") {
|
||||
this.btInstance.bootstrapTreeTable('refresh', parms.query);// 为了兼容bootstrap-table的写法
|
||||
} else {
|
||||
this.btInstance.bootstrapTreeTable('refresh');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 设置高度
|
||||
*/
|
||||
resetHeight: function(parms) {
|
||||
if (typeof parms != "undefined") {
|
||||
this.btInstance.bootstrapTreeTable('resetHeight', parms.height);// 为了兼容bootstrap-table的写法
|
||||
} else {
|
||||
this.btInstance.bootstrapTreeTable('resetHeight');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取选中行
|
||||
*/
|
||||
getSelectedRow: function() {
|
||||
return this.btInstance.bootstrapTreeTable('getSelections');
|
||||
}
|
||||
};
|
||||
|
||||
window.TreeTable = TreeTable;
|
||||
|
||||
}());
|
@ -0,0 +1 @@
|
||||
.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-layout-pane{overflow:auto}.ui-layout-content{padding:10px;position:relative;overflow:auto;width:100%;border:0}.layout-child-container,.layout-content-container{padding:0;overflow:hidden}.layout-child-container{border:0}.layout-scroll{overflow:auto}.layout-hide{display:none}.ui-layout-resizer{background:#fafafa;border:1px solid #eee;border-width:0}.ui-layout-resizer-open-hover,.ui-layout-resizer-dragging{background:#fafafa}.ui-layout-resizer-dragging{border:1px solid #eee}.ui-layout-resizer-north-dragging,.ui-layout-resizer-south-dragging{border-width:1px 0}.ui-layout-resizer-west-dragging,.ui-layout-resizer-east-dragging{border-width:0 1px}.ui-layout-resizer-dragging-limit{background:#e1a4a4}.ui-layout-resizer-closed-hover{background:#ebd5aa}.ui-layout-resizer-north-sliding-hover{border-bottom-width:1px}.ui-layout-resizer-south-sliding-hover{border-top-width:1px}.ui-layout-resizer-west-sliding-hover{border-right-width:1px}.ui-layout-resizer-east-sliding-hover{border-left-width:1px}.ui-layout-toggler{border:1px solid #eee;background-color:#eee}.ui-layout-resizer-hover .ui-layout-toggler{opacity:1.00;filter:alpha(opacity=100)}.ui-layout-toggler-hover,.ui-layout-resizer-hover .ui-layout-toggler-hover{background-color:#FC6;opacity:1.00;filter:alpha(opacity=100)}.ui-layout-toggler-north,.ui-layout-toggler-south{border-width:0 1px}.ui-layout-toggler-west,.ui-layout-toggler-east{border-width:1px 0}.ui-layout-resizer-sliding .ui-layout-toggler{display:none}.ui-layout-toggler .ui-content{color:#666;font-size:12px;font-weight:bold;line-height:8px;width:100%;padding-bottom:.35ex}.ui-layout-toggler .ui-content .fa{line-height:8px}.ui-layout-toggler-north-closed .fa:before,.ui-layout-toggler-south-open .fa:before{content:"\f0d7"}.ui-layout-toggler-south-closed .fa:before,.ui-layout-toggler-north-open .fa:before{content:"\f0d8"}.ui-layout-toggler-west-closed .fa:before,.ui-layout-toggler-east-open .fa:before{content:"\f0da"}.ui-layout-toggler-east-closed .fa:before,.ui-layout-toggler-west-open .fa:before{content:"\f0d9"}.ui-layout-mask{border:none!important;padding:0!important;margin:0!important;overflow:hidden!important;position:absolute!important;opacity:0!important;filter:Alpha(Opacity="0")!important}.ui-layout-mask-inside-pane{top:0!important;left:0!important;width:100%!important;height:100%!important}@media print{html{height:auto!important;overflow:visible!important}body.ui-layout-container{position:static!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;_width:auto!important;_height:auto!important}.ui-layout-resizer,.ui-layout-toggler{display:none!important}.ui-layout-pane{border:none!important;background:transparent!important;position:relative!important;top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;width:auto!important;height:auto!important;overflow:visible!important}}
|
After Width: | Height: | Size: 601 B |
After Width: | Height: | Size: 580 B |
After Width: | Height: | Size: 570 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 399 B |
After Width: | Height: | Size: 710 B |
After Width: | Height: | Size: 432 B |
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 529 B |
After Width: | Height: | Size: 467 B |
After Width: | Height: | Size: 45 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,102 @@
|
||||
/*-------------------------------------
|
||||
zTree Style
|
||||
|
||||
version: 3.4
|
||||
author: Hunter.z
|
||||
email: hunter.z@263.net
|
||||
website: http://code.google.com/p/jquerytree/
|
||||
|
||||
-------------------------------------*/
|
||||
|
||||
.ztree * {padding:0; margin:0; font-size:12px;}
|
||||
.ztree {margin:0; padding:2px; color:#333}
|
||||
.ztree li{padding:0; margin:0; list-style:none; line-height:18px; text-align:left; white-space:nowrap; outline:0}
|
||||
.ztree li ul{ margin:0; padding:0 0 0 18px}
|
||||
.ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;}
|
||||
|
||||
.ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; /* height:17px; */ color:#333; background-color: transparent;
|
||||
text-decoration:none; vertical-align:top; display: inline-block}
|
||||
.ztree li a:hover {text-decoration:underline}
|
||||
/*.ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}*/
|
||||
.ztree li a.curSelectedNode {padding-top:0px; background-color:#F6F6F6; color:#0663A2; border:1px #DDDDDD solid; opacity:0.8;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
/*.ztree li a.curSelectedNode {padding-top:0px; color:#0663a2; font-weight:bold; height:16px; opacity:0.8;}*/
|
||||
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;}
|
||||
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid;
|
||||
opacity:0.8; filter:alpha(opacity=80)}
|
||||
.ztree li a.tmpTargetNode_prev {}
|
||||
.ztree li a.tmpTargetNode_next {}
|
||||
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
|
||||
font-size:12px; border:1px #7EC4CC solid; *border:0px}
|
||||
.ztree li span {line-height:16px; margin-right:2px}
|
||||
.ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle;
|
||||
border:0 none; cursor: pointer;outline:none;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
|
||||
|
||||
/* IE7 fix */
|
||||
.ztree li span.button.level0 {*margin-left:-15px;}
|
||||
|
||||
.ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto}
|
||||
.ztree li span.button.chk.checkbox_false_full {background-position:0 0}
|
||||
.ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px}
|
||||
.ztree li span.button.chk.checkbox_false_part {background-position:0 -28px}
|
||||
.ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px}
|
||||
.ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px}
|
||||
.ztree li span.button.chk.checkbox_true_full {background-position:-14px 0}
|
||||
.ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px}
|
||||
.ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px}
|
||||
.ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px}
|
||||
.ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px}
|
||||
.ztree li span.button.chk.radio_false_full {background-position:-28px 0}
|
||||
.ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px}
|
||||
.ztree li span.button.chk.radio_false_part {background-position:-28px -28px}
|
||||
.ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px}
|
||||
.ztree li span.button.chk.radio_false_disable {background-position:-28px -56px}
|
||||
.ztree li span.button.chk.radio_true_full {background-position:-42px 0}
|
||||
.ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px}
|
||||
.ztree li span.button.chk.radio_true_part {background-position:-42px -28px}
|
||||
.ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px}
|
||||
.ztree li span.button.chk.radio_true_disable {background-position:-42px -56px}
|
||||
|
||||
.ztree li span.button.switch {width:18px; height:18px}
|
||||
.ztree li span.button.root_open{background-position:-92px -54px}
|
||||
.ztree li span.button.root_close{background-position:-74px -54px}
|
||||
.ztree li span.button.roots_open{background-position:-92px 0}
|
||||
.ztree li span.button.roots_close{background-position:-74px 0}
|
||||
.ztree li span.button.center_open{background-position:-92px -18px}
|
||||
.ztree li span.button.center_close{background-position:-74px -18px}
|
||||
.ztree li span.button.bottom_open{background-position:-92px -36px}
|
||||
.ztree li span.button.bottom_close{background-position:-74px -36px}
|
||||
.ztree li span.button.noline_open{background-position:-92px -72px}
|
||||
.ztree li span.button.noline_close{background-position:-74px -72px}
|
||||
.ztree li span.button.root_docu{ background:none;}
|
||||
.ztree li span.button.roots_docu{background-position:-56px 0}
|
||||
.ztree li span.button.center_docu{background-position:-56px -18px}
|
||||
.ztree li span.button.bottom_docu{background-position:-56px -36px}
|
||||
.ztree li span.button.noline_docu{ background:none;}
|
||||
|
||||
.ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; /* vertical-align:top; * */vertical-align:middle}
|
||||
.ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle}
|
||||
|
||||
.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
|
||||
|
||||
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
|
||||
|
||||
span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")}
|
||||
|
||||
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
|
||||
.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
|
||||
|
||||
/* level style*/
|
||||
/*.ztree li span.button.level0 {
|
||||
display:none;
|
||||
}
|
||||
.ztree li ul.level0 {
|
||||
padding:0;
|
||||
background:none;
|
||||
}*/
|
After Width: | Height: | Size: 45 B |
After Width: | Height: | Size: 933 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 7.1 KiB |
@ -0,0 +1,107 @@
|
||||
/*-------------------------------------
|
||||
zTree Style
|
||||
|
||||
version: 3.4
|
||||
author: Hunter.z
|
||||
email: hunter.z@263.net
|
||||
website: http://code.google.com/p/jquerytree/
|
||||
|
||||
-------------------------------------*/
|
||||
|
||||
.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
|
||||
.ztree {margin:0; padding:5px; color:#333}
|
||||
.ztree li{padding:0; margin:0; list-style:none; line-height:21px; text-align:left; white-space:nowrap; outline:0}
|
||||
.ztree li ul{ margin:0; padding:0 0 0 18px}
|
||||
.ztree li ul.line{ background:url(./img/line_conn.png) 0 0 repeat-y;}
|
||||
|
||||
.ztree li a {padding-right:3px; margin:0; cursor:pointer; height:21px; color:#333; background-color: transparent; text-decoration:none; display: inline-block}
|
||||
.ztree li a:hover {text-decoration:underline}
|
||||
.ztree li a.curSelectedNode {padding-top:0px; background-color:#e5e5e5; color:black; height:22px; -webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#e5e5e5; color:black; height:22px; border:1px #666 solid; -webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
||||
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:white; height:21px; border:1px #666 solid;
|
||||
opacity:0.8; filter:alpha(opacity=80)}
|
||||
.ztree li a.tmpTargetNode_prev {}
|
||||
.ztree li a.tmpTargetNode_next {}
|
||||
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
|
||||
font-size:12px; border:1px #7EC4CC solid; *border:0px}
|
||||
.ztree li span {line-height:21px; margin-right:2px}
|
||||
.ztree li span.button {line-height:0; margin:0; width:21px; height:21px; display: inline-block; vertical-align:middle;
|
||||
border:0 none; cursor: pointer;outline:none;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
|
||||
|
||||
.ztree li span.button.chk {width:13px; height:13px; margin:0 2px; cursor: auto}
|
||||
.ztree li span.button.chk.checkbox_false_full {background-position: -5px -5px;}
|
||||
.ztree li span.button.chk.checkbox_false_full_focus {background-position: -5px -26px;}
|
||||
.ztree li span.button.chk.checkbox_false_part {background-position: -5px -48px;}
|
||||
.ztree li span.button.chk.checkbox_false_part_focus {background-position: -5px -68px;}
|
||||
.ztree li span.button.chk.checkbox_false_disable {background-position: -5px -89px;}
|
||||
.ztree li span.button.chk.checkbox_true_full {background-position: -26px -5px;}
|
||||
.ztree li span.button.chk.checkbox_true_full_focus {background-position: -26px -26px;}
|
||||
.ztree li span.button.chk.checkbox_true_part {background-position: -26px -48px;}
|
||||
.ztree li span.button.chk.checkbox_true_part_focus {background-position: -26px -68px;}
|
||||
.ztree li span.button.chk.checkbox_true_disable {background-position: -26px -89px;}
|
||||
.ztree li span.button.chk.radio_false_full {background-position: -47px -5px;}
|
||||
.ztree li span.button.chk.radio_false_full_focus {background-position: -47px -26px;}
|
||||
.ztree li span.button.chk.radio_false_part {background-position: -47px -47px;}
|
||||
.ztree li span.button.chk.radio_false_part_focus {background-position: -47px -68px;}
|
||||
.ztree li span.button.chk.radio_false_disable {background-position: -47px -89px;}
|
||||
.ztree li span.button.chk.radio_true_full {background-position: -68px -5px;}
|
||||
.ztree li span.button.chk.radio_true_full_focus {background-position: -68px -26px;}
|
||||
.ztree li span.button.chk.radio_true_part {background-position: -68px -47px;}
|
||||
.ztree li span.button.chk.radio_true_part_focus {background-position: -68px -68px;}
|
||||
.ztree li span.button.chk.radio_true_disable {background-position: -68px -89px;}
|
||||
|
||||
.ztree li span.button.switch {width:21px; height:21px}
|
||||
.ztree li span.button.root_open{background-position:-105px -85px}
|
||||
.ztree li span.button.root_close{background-position:-126px -85px}
|
||||
.ztree li span.button.roots_open{background-position: -105px 0;}
|
||||
.ztree li span.button.roots_close{background-position: -126px 0;}
|
||||
.ztree li span.button.center_open{background-position: -105px -21px;}
|
||||
.ztree li span.button.center_close{background-position: -126px -21px;}
|
||||
.ztree li span.button.bottom_open{background-position: -105px -42px;}
|
||||
.ztree li span.button.bottom_close{background-position: -126px -42px;}
|
||||
.ztree li span.button.noline_open{background-position: -126px -84px;}
|
||||
.ztree li span.button.noline_close{background-position: -105px -84px;}
|
||||
.ztree li span.button.root_docu{ background:none;}
|
||||
.ztree li span.button.roots_docu{background-position: -84px 0;}
|
||||
.ztree li span.button.center_docu{background-position: -84px -21px;}
|
||||
.ztree li span.button.bottom_docu{background-position: -84px -42px;}
|
||||
.ztree li span.button.noline_docu{ background:none;}
|
||||
|
||||
.ztree li span.button.ico_open{margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_close{margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_docu{margin-right:2px; background-position: -147px -42px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.edit {margin-left:2px; margin-right: -1px; background-position: -189px -21px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.edit:hover {
|
||||
background-position: -168px -21px;
|
||||
}
|
||||
.ztree li span.button.remove {margin-left:2px; margin-right: -1px; background-position: -189px -42px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.remove:hover {
|
||||
background-position: -168px -42px;
|
||||
}
|
||||
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position: -189px 0; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.add:hover {
|
||||
background-position: -168px 0;
|
||||
}
|
||||
.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
|
||||
|
||||
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
|
||||
|
||||
span.tmpzTreeMove_arrow {width:16px; height:21px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-position:-168px -84px; background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
|
||||
|
||||
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
|
||||
.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
|
||||
|
||||
/* 树搜索相关 */
|
||||
.treeSearchInput {padding:13px 0 0 20px;}
|
||||
.treeSearchInput label {padding:5px 0 3px 0;font-size:13px;font-weight:normal;vertical-align:middle;}
|
||||
.treeSearchInput input {width:145px;vertical-align:middle;line-height:24px;height:26px;border:1px solid #bbb;padding:0 4px;}
|
||||
.treeSearchInput button {border:1px solid #bbb;vertical-align:middle;height:26px;height:26px\9;font-size:13px;background:#efefef;padding:0 8px;}
|
||||
.treeShowHideButton {position:absolute;right:8px;top:2px;font-size:12px;color:#333;z-index:3;}
|
||||
.treeShowHideButton label {cursor:pointer;}
|
||||
.treeExpandCollapse {float:right;margin:6px 5px;padding:5px;font-size:12px;color:#333;position:relative;z-index:2;background:#fff;}
|
||||
.treeExpandCollapse a {text-decoration:none;color:#333}
|
||||
.treeselect.ztree {padding:10px 20px;}
|
After Width: | Height: | Size: 216 B |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 45 B |
After Width: | Height: | Size: 381 B |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,118 @@
|
||||
/*-------------------------------------
|
||||
zTree Style
|
||||
|
||||
version: 3.4
|
||||
author: Hunter.z
|
||||
email: hunter.z@263.net
|
||||
website: http://code.google.com/p/jquerytree/
|
||||
|
||||
-------------------------------------*/
|
||||
|
||||
.ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
|
||||
.ztree {margin:0; padding:5px; color:#333}
|
||||
.ztree li{padding:0; margin:0; list-style:none; line-height:21px; text-align:left; white-space:nowrap; outline:0}
|
||||
.ztree li ul{ margin:0; padding:0 0 0 18px}
|
||||
.ztree li ul.line{ background:url(./img/line_conn.png) 0 0 repeat-y;}
|
||||
|
||||
.ztree li a {padding-right:3px; margin:0; cursor:pointer; height:21px; color:#333; background-color: transparent; text-decoration:none; display: inline-block}
|
||||
.ztree li a:hover {text-decoration:underline}
|
||||
.ztree li a.curSelectedNode {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; opacity:0.8;}
|
||||
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; border:1px #666 solid; opacity:0.8;}
|
||||
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:white; height:21px; border:1px #666 solid;
|
||||
opacity:0.8; filter:alpha(opacity=80)}
|
||||
.ztree li a.tmpTargetNode_prev {}
|
||||
.ztree li a.tmpTargetNode_next {}
|
||||
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
|
||||
font-size:12px; border:1px #7EC4CC solid; *border:0px}
|
||||
.ztree li span {line-height:21px; margin-right:2px}
|
||||
.ztree li span.button {line-height:0; margin:0; width:21px; height:21px; display: inline-block; vertical-align:middle;
|
||||
border:0 none; cursor: pointer;outline:none;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
|
||||
|
||||
.ztree li span.button.chk {width:13px; height:13px; margin:0 2px; cursor: auto}
|
||||
.ztree li span.button.chk.checkbox_false_full {background-position: -5px -5px;}
|
||||
.ztree li span.button.chk.checkbox_false_full_focus {background-position: -5px -26px;}
|
||||
.ztree li span.button.chk.checkbox_false_part {background-position: -5px -48px;}
|
||||
.ztree li span.button.chk.checkbox_false_part_focus {background-position: -5px -68px;}
|
||||
.ztree li span.button.chk.checkbox_false_disable {background-position: -5px -89px;}
|
||||
.ztree li span.button.chk.checkbox_true_full {background-position: -26px -5px;}
|
||||
.ztree li span.button.chk.checkbox_true_full_focus {background-position: -26px -26px;}
|
||||
.ztree li span.button.chk.checkbox_true_part {background-position: -26px -48px;}
|
||||
.ztree li span.button.chk.checkbox_true_part_focus {background-position: -26px -68px;}
|
||||
.ztree li span.button.chk.checkbox_true_disable {background-position: -26px -89px;}
|
||||
.ztree li span.button.chk.radio_false_full {background-position: -47px -5px;}
|
||||
.ztree li span.button.chk.radio_false_full_focus {background-position: -47px -26px;}
|
||||
.ztree li span.button.chk.radio_false_part {background-position: -47px -47px;}
|
||||
.ztree li span.button.chk.radio_false_part_focus {background-position: -47px -68px;}
|
||||
.ztree li span.button.chk.radio_false_disable {background-position: -47px -89px;}
|
||||
.ztree li span.button.chk.radio_true_full {background-position: -68px -5px;}
|
||||
.ztree li span.button.chk.radio_true_full_focus {background-position: -68px -26px;}
|
||||
.ztree li span.button.chk.radio_true_part {background-position: -68px -47px;}
|
||||
.ztree li span.button.chk.radio_true_part_focus {background-position: -68px -68px;}
|
||||
.ztree li span.button.chk.radio_true_disable {background-position: -68px -89px;}
|
||||
|
||||
.ztree li span.button.switch {width:21px; height:21px}
|
||||
.ztree li span.button.root_open{background-position:-92px -54px}
|
||||
.ztree li span.button.root_close{background-position:-74px -54px}
|
||||
.ztree li span.button.roots_open{background-position: -105px 0;}
|
||||
.ztree li span.button.roots_close{background-position: -126px 0;}
|
||||
.ztree li span.button.center_open{background-position: -105px -21px;}
|
||||
.ztree li span.button.center_close{background-position: -126px -21px;}
|
||||
.ztree li span.button.bottom_open{background-position: -105px -42px;}
|
||||
.ztree li span.button.bottom_close{background-position: -126px -42px;}
|
||||
.ztree li span.button.noline_open{background-position: -126px -84px;}
|
||||
.ztree li span.button.noline_close{background-position: -105px -84px;}
|
||||
.ztree li span.button.root_docu{ background:none;}
|
||||
.ztree li span.button.roots_docu{background-position: -84px 0;}
|
||||
.ztree li span.button.center_docu{background-position: -84px -21px;}
|
||||
.ztree li span.button.bottom_docu{background-position: -84px -42px;}
|
||||
.ztree li span.button.noline_docu{ background:none;}
|
||||
|
||||
.ztree li span.button.ico_open{margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_close{margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.ico_docu{margin-right:2px; background-position: -147px -42px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.edit {margin-left:2px; margin-right: -1px; background-position: -189px -21px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.edit:hover {
|
||||
background-position: -168px -21px;
|
||||
}
|
||||
.ztree li span.button.remove {margin-left:2px; margin-right: -1px; background-position: -189px -42px; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.remove:hover {
|
||||
background-position: -168px -42px;
|
||||
}
|
||||
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position: -189px 0; vertical-align:top; *vertical-align:middle}
|
||||
.ztree li span.button.add:hover {
|
||||
background-position: -168px 0;
|
||||
}
|
||||
.ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle}
|
||||
|
||||
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
|
||||
|
||||
span.tmpzTreeMove_arrow {width:16px; height:21px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
|
||||
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||
background-position:-168px -84px; background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")}
|
||||
|
||||
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
|
||||
.zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
|
||||
|
||||
/* simple */
|
||||
|
||||
.ztree * {font-size:14px;font-family:"Microsoft Yahei",Verdana,Simsun,"Segoe UI Web Light","Segoe UI Light","Segoe UI Web Regular","Segoe UI","Segoe UI Symbol","Helvetica Neue",Arial;}
|
||||
.ztree li ul{ margin:0; padding:0}
|
||||
.ztree li {line-height:28px;}
|
||||
.ztree li a {width:100%;height:28px;padding-top: 0px;}
|
||||
.ztree li a:hover {text-decoration:none; background-color: #E7E7E7;}
|
||||
.ztree11 li a span.button.switch {visibility:hidden}
|
||||
.ztree11.showIcon li a span.button.switch {visibility:visible}
|
||||
.ztree li a.curSelectedNode {background-color:#D4D4D4;border:0;height:28px;}
|
||||
.ztree li span {line-height:26px;margin-right:0px;}
|
||||
.ztree li span.button {margin-top: -7px;}
|
||||
.ztree li span.button.switch {width:16px;height: 16px;}
|
||||
.ztree li a.level0 span {font-size:15px;font-weight:bold;}
|
||||
.ztree li span.button {background-image:url("img/left_menu.png"); *background-image:url("./left_menu.gif")}
|
||||
.ztree li span.button.switch.level0 {width: 20px; height:20px}
|
||||
.ztree li span.button.switch.level1 {width: 20px; height:20px}
|
||||
.ztree li span.button.noline_open {background-position: 0 0;}
|
||||
.ztree li span.button.noline_close {background-position: -18px 0;}
|
||||
.ztree li span.button.noline_open.level0 {background-position: 0 -17px;}
|
||||
.ztree li span.button.noline_close.level0 {background-position: -18px -17px;}
|
@ -0,0 +1,624 @@
|
||||
/*
|
||||
* JQuery zTree excheck 3.5.12
|
||||
* http://zTree.me/
|
||||
*
|
||||
* Copyright (c) 2010 Hunter.z
|
||||
*
|
||||
* Licensed same as jquery - MIT License
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* email: hunter.z@263.net
|
||||
* Date: 2013-03-11
|
||||
*/
|
||||
(function($){
|
||||
//default consts of excheck
|
||||
var _consts = {
|
||||
event: {
|
||||
CHECK: "ztree_check"
|
||||
},
|
||||
id: {
|
||||
CHECK: "_check"
|
||||
},
|
||||
checkbox: {
|
||||
STYLE: "checkbox",
|
||||
DEFAULT: "chk",
|
||||
DISABLED: "disable",
|
||||
FALSE: "false",
|
||||
TRUE: "true",
|
||||
FULL: "full",
|
||||
PART: "part",
|
||||
FOCUS: "focus"
|
||||
},
|
||||
radio: {
|
||||
STYLE: "radio",
|
||||
TYPE_ALL: "all",
|
||||
TYPE_LEVEL: "level"
|
||||
}
|
||||
},
|
||||
//default setting of excheck
|
||||
_setting = {
|
||||
check: {
|
||||
enable: false,
|
||||
autoCheckTrigger: false,
|
||||
chkStyle: _consts.checkbox.STYLE,
|
||||
nocheckInherit: false,
|
||||
chkDisabledInherit: false,
|
||||
radioType: _consts.radio.TYPE_LEVEL,
|
||||
chkboxType: {
|
||||
"Y": "ps",
|
||||
"N": "ps"
|
||||
}
|
||||
},
|
||||
data: {
|
||||
key: {
|
||||
checked: "checked"
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
beforeCheck:null,
|
||||
onCheck:null
|
||||
}
|
||||
},
|
||||
//default root of excheck
|
||||
_initRoot = function (setting) {
|
||||
var r = data.getRoot(setting);
|
||||
r.radioCheckedList = [];
|
||||
},
|
||||
//default cache of excheck
|
||||
_initCache = function(treeId) {},
|
||||
//default bind event of excheck
|
||||
_bindEvent = function(setting) {
|
||||
var o = setting.treeObj,
|
||||
c = consts.event;
|
||||
o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
|
||||
tools.apply(setting.callback.onCheck, [!!srcEvent?srcEvent : event, treeId, node]);
|
||||
});
|
||||
},
|
||||
_unbindEvent = function(setting) {
|
||||
var o = setting.treeObj,
|
||||
c = consts.event;
|
||||
o.unbind(c.CHECK);
|
||||
},
|
||||
//default event proxy of excheck
|
||||
_eventProxy = function(e) {
|
||||
var target = e.target,
|
||||
setting = data.getSetting(e.data.treeId),
|
||||
tId = "", node = null,
|
||||
nodeEventType = "", treeEventType = "",
|
||||
nodeEventCallback = null, treeEventCallback = null;
|
||||
|
||||
if (tools.eqs(e.type, "mouseover")) {
|
||||
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||
tId = target.parentNode.id;
|
||||
nodeEventType = "mouseoverCheck";
|
||||
}
|
||||
} else if (tools.eqs(e.type, "mouseout")) {
|
||||
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||
tId = target.parentNode.id;
|
||||
nodeEventType = "mouseoutCheck";
|
||||
}
|
||||
} else if (tools.eqs(e.type, "click")) {
|
||||
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||
tId = target.parentNode.id;
|
||||
nodeEventType = "checkNode";
|
||||
}
|
||||
}
|
||||
if (tId.length>0) {
|
||||
node = data.getNodeCache(setting, tId);
|
||||
switch (nodeEventType) {
|
||||
case "checkNode" :
|
||||
nodeEventCallback = _handler.onCheckNode;
|
||||
break;
|
||||
case "mouseoverCheck" :
|
||||
nodeEventCallback = _handler.onMouseoverCheck;
|
||||
break;
|
||||
case "mouseoutCheck" :
|
||||
nodeEventCallback = _handler.onMouseoutCheck;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var proxyResult = {
|
||||
stop: false,
|
||||
node: node,
|
||||
nodeEventType: nodeEventType,
|
||||
nodeEventCallback: nodeEventCallback,
|
||||
treeEventType: treeEventType,
|
||||
treeEventCallback: treeEventCallback
|
||||
};
|
||||
return proxyResult
|
||||
},
|
||||
//default init node of excheck
|
||||
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
|
||||
if (!n) return;
|
||||
var checkedKey = setting.data.key.checked;
|
||||
if (typeof n[checkedKey] == "string") n[checkedKey] = tools.eqs(n[checkedKey], "true");
|
||||
n[checkedKey] = !!n[checkedKey];
|
||||
n.checkedOld = n[checkedKey];
|
||||
if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
|
||||
n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
|
||||
if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
|
||||
n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
|
||||
if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
|
||||
n.halfCheck = !!n.halfCheck;
|
||||
n.check_Child_State = -1;
|
||||
n.check_Focus = false;
|
||||
n.getCheckStatus = function() {return data.getCheckStatus(setting, n);};
|
||||
},
|
||||
//add dom for check
|
||||
_beforeA = function(setting, node, html) {
|
||||
var checkedKey = setting.data.key.checked;
|
||||
if (setting.check.enable) {
|
||||
data.makeChkFlag(setting, node);
|
||||
if (setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL && node[checkedKey] ) {
|
||||
var r = data.getRoot(setting);
|
||||
r.radioCheckedList.push(node);
|
||||
}
|
||||
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true?" style='display:none;'":""),"></span>");
|
||||
}
|
||||
},
|
||||
//update zTreeObj, add method of check
|
||||
_zTreeTools = function(setting, zTreeTools) {
|
||||
zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
|
||||
var checkedKey = this.setting.data.key.checked;
|
||||
if (node.chkDisabled === true) return;
|
||||
if (checked !== true && checked !== false) {
|
||||
checked = !node[checkedKey];
|
||||
}
|
||||
callbackFlag = !!callbackFlag;
|
||||
|
||||
if (node[checkedKey] === checked && !checkTypeFlag) {
|
||||
return;
|
||||
} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
|
||||
return;
|
||||
}
|
||||
if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
|
||||
node[checkedKey] = checked;
|
||||
var checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
|
||||
view.setChkClass(this.setting, checkObj, node);
|
||||
view.repairParentChkClassWithSelf(this.setting, node);
|
||||
if (callbackFlag) {
|
||||
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zTreeTools.checkAllNodes = function(checked) {
|
||||
view.repairAllChk(this.setting, !!checked);
|
||||
}
|
||||
|
||||
zTreeTools.getCheckedNodes = function(checked) {
|
||||
var childKey = this.setting.data.key.children;
|
||||
checked = (checked !== false);
|
||||
return data.getTreeCheckedNodes(this.setting, data.getRoot(setting)[childKey], checked);
|
||||
}
|
||||
|
||||
zTreeTools.getChangeCheckedNodes = function() {
|
||||
var childKey = this.setting.data.key.children;
|
||||
return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(setting)[childKey]);
|
||||
}
|
||||
|
||||
zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
|
||||
disabled = !!disabled;
|
||||
inheritParent = !!inheritParent;
|
||||
inheritChildren = !!inheritChildren;
|
||||
view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
|
||||
view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
|
||||
}
|
||||
|
||||
var _updateNode = zTreeTools.updateNode;
|
||||
zTreeTools.updateNode = function(node, checkTypeFlag) {
|
||||
if (_updateNode) _updateNode.apply(zTreeTools, arguments);
|
||||
if (!node || !this.setting.check.enable) return;
|
||||
var nObj = $("#" + node.tId);
|
||||
if (nObj.get(0) && tools.uCanDo(this.setting)) {
|
||||
var checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
|
||||
view.setChkClass(this.setting, checkObj, node);
|
||||
view.repairParentChkClassWithSelf(this.setting, node);
|
||||
}
|
||||
}
|
||||
},
|
||||
//method of operate data
|
||||
_data = {
|
||||
getRadioCheckedList: function(setting) {
|
||||
var checkedList = data.getRoot(setting).radioCheckedList;
|
||||
for (var i=0, j=checkedList.length; i<j; i++) {
|
||||
if(!data.getNodeCache(setting, checkedList[i].tId)) {
|
||||
checkedList.splice(i, 1);
|
||||
i--; j--;
|
||||
}
|
||||
}
|
||||
return checkedList;
|
||||
},
|
||||
getCheckStatus: function(setting, node) {
|
||||
if (!setting.check.enable || node.nocheck || node.chkDisabled) return null;
|
||||
var checkedKey = setting.data.key.checked,
|
||||
r = {
|
||||
checked: node[checkedKey],
|
||||
half: node.halfCheck ? node.halfCheck : (setting.check.chkStyle == consts.radio.STYLE ? (node.check_Child_State === 2) : (node[checkedKey] ? (node.check_Child_State > -1 && node.check_Child_State < 2) : (node.check_Child_State > 0)))
|
||||
};
|
||||
return r;
|
||||
},
|
||||
getTreeCheckedNodes: function(setting, nodes, checked, results) {
|
||||
if (!nodes) return [];
|
||||
var childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked,
|
||||
onlyOne = (checked && setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL);
|
||||
results = !results ? [] : results;
|
||||
for (var i = 0, l = nodes.length; i < l; i++) {
|
||||
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] == checked) {
|
||||
results.push(nodes[i]);
|
||||
if(onlyOne) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
data.getTreeCheckedNodes(setting, nodes[i][childKey], checked, results);
|
||||
if(onlyOne && results.length > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return results;
|
||||
},
|
||||
getTreeChangeCheckedNodes: function(setting, nodes, results) {
|
||||
if (!nodes) return [];
|
||||
var childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked;
|
||||
results = !results ? [] : results;
|
||||
for (var i = 0, l = nodes.length; i < l; i++) {
|
||||
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] != nodes[i].checkedOld) {
|
||||
results.push(nodes[i]);
|
||||
}
|
||||
data.getTreeChangeCheckedNodes(setting, nodes[i][childKey], results);
|
||||
}
|
||||
return results;
|
||||
},
|
||||
makeChkFlag: function(setting, node) {
|
||||
if (!node) return;
|
||||
var childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked,
|
||||
chkFlag = -1;
|
||||
if (node[childKey]) {
|
||||
for (var i = 0, l = node[childKey].length; i < l; i++) {
|
||||
var cNode = node[childKey][i];
|
||||
var tmp = -1;
|
||||
if (setting.check.chkStyle == consts.radio.STYLE) {
|
||||
if (cNode.nocheck === true || cNode.chkDisabled === true) {
|
||||
tmp = cNode.check_Child_State;
|
||||
} else if (cNode.halfCheck === true) {
|
||||
tmp = 2;
|
||||
} else if (cNode[checkedKey]) {
|
||||
tmp = 2;
|
||||
} else {
|
||||
tmp = cNode.check_Child_State > 0 ? 2:0;
|
||||
}
|
||||
if (tmp == 2) {
|
||||
chkFlag = 2; break;
|
||||
} else if (tmp == 0){
|
||||
chkFlag = 0;
|
||||
}
|
||||
} else if (setting.check.chkStyle == consts.checkbox.STYLE) {
|
||||
if (cNode.nocheck === true || cNode.chkDisabled === true) {
|
||||
tmp = cNode.check_Child_State;
|
||||
} else if (cNode.halfCheck === true) {
|
||||
tmp = 1;
|
||||
} else if (cNode[checkedKey] ) {
|
||||
tmp = (cNode.check_Child_State === -1 || cNode.check_Child_State === 2) ? 2 : 1;
|
||||
} else {
|
||||
tmp = (cNode.check_Child_State > 0) ? 1 : 0;
|
||||
}
|
||||
if (tmp === 1) {
|
||||
chkFlag = 1; break;
|
||||
} else if (tmp === 2 && chkFlag > -1 && i > 0 && tmp !== chkFlag) {
|
||||
chkFlag = 1; break;
|
||||
} else if (chkFlag === 2 && tmp > -1 && tmp < 2) {
|
||||
chkFlag = 1; break;
|
||||
} else if (tmp > -1) {
|
||||
chkFlag = tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
node.check_Child_State = chkFlag;
|
||||
}
|
||||
},
|
||||
//method of event proxy
|
||||
_event = {
|
||||
|
||||
},
|
||||
//method of event handler
|
||||
_handler = {
|
||||
onCheckNode: function (event, node) {
|
||||
if (node.chkDisabled === true) return false;
|
||||
var setting = data.getSetting(event.data.treeId),
|
||||
checkedKey = setting.data.key.checked;
|
||||
if (tools.apply(setting.callback.beforeCheck, [setting.treeId, node], true) == false) return true;
|
||||
node[checkedKey] = !node[checkedKey];
|
||||
view.checkNodeRelation(setting, node);
|
||||
var checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
view.repairParentChkClassWithSelf(setting, node);
|
||||
setting.treeObj.trigger(consts.event.CHECK, [event, setting.treeId, node]);
|
||||
return true;
|
||||
},
|
||||
onMouseoverCheck: function(event, node) {
|
||||
if (node.chkDisabled === true) return false;
|
||||
var setting = data.getSetting(event.data.treeId),
|
||||
checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
node.check_Focus = true;
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
return true;
|
||||
},
|
||||
onMouseoutCheck: function(event, node) {
|
||||
if (node.chkDisabled === true) return false;
|
||||
var setting = data.getSetting(event.data.treeId),
|
||||
checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
node.check_Focus = false;
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
return true;
|
||||
}
|
||||
},
|
||||
//method of tools for zTree
|
||||
_tools = {
|
||||
|
||||
},
|
||||
//method of operate ztree dom
|
||||
_view = {
|
||||
checkNodeRelation: function(setting, node) {
|
||||
var pNode, i, l,
|
||||
childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked,
|
||||
r = consts.radio;
|
||||
if (setting.check.chkStyle == r.STYLE) {
|
||||
var checkedList = data.getRadioCheckedList(setting);
|
||||
if (node[checkedKey]) {
|
||||
if (setting.check.radioType == r.TYPE_ALL) {
|
||||
for (i = checkedList.length-1; i >= 0; i--) {
|
||||
pNode = checkedList[i];
|
||||
pNode[checkedKey] = false;
|
||||
checkedList.splice(i, 1);
|
||||
|
||||
view.setChkClass(setting, $("#" + pNode.tId + consts.id.CHECK), pNode);
|
||||
if (pNode.parentTId != node.parentTId) {
|
||||
view.repairParentChkClassWithSelf(setting, pNode);
|
||||
}
|
||||
}
|
||||
checkedList.push(node);
|
||||
} else {
|
||||
var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
|
||||
for (i = 0, l = parentNode[childKey].length; i < l; i++) {
|
||||
pNode = parentNode[childKey][i];
|
||||
if (pNode[checkedKey] && pNode != node) {
|
||||
pNode[checkedKey] = false;
|
||||
view.setChkClass(setting, $("#" + pNode.tId + consts.id.CHECK), pNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (setting.check.radioType == r.TYPE_ALL) {
|
||||
for (i = 0, l = checkedList.length; i < l; i++) {
|
||||
if (node == checkedList[i]) {
|
||||
checkedList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.Y.indexOf("s") > -1)) {
|
||||
view.setSonNodeCheckBox(setting, node, true);
|
||||
}
|
||||
if (!node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.N.indexOf("s") > -1)) {
|
||||
view.setSonNodeCheckBox(setting, node, false);
|
||||
}
|
||||
if (node[checkedKey] && setting.check.chkboxType.Y.indexOf("p") > -1) {
|
||||
view.setParentNodeCheckBox(setting, node, true);
|
||||
}
|
||||
if (!node[checkedKey] && setting.check.chkboxType.N.indexOf("p") > -1) {
|
||||
view.setParentNodeCheckBox(setting, node, false);
|
||||
}
|
||||
}
|
||||
},
|
||||
makeChkClass: function(setting, node) {
|
||||
var checkedKey = setting.data.key.checked,
|
||||
c = consts.checkbox, r = consts.radio,
|
||||
fullStyle = "";
|
||||
if (node.chkDisabled === true) {
|
||||
fullStyle = c.DISABLED;
|
||||
} else if (node.halfCheck) {
|
||||
fullStyle = c.PART;
|
||||
} else if (setting.check.chkStyle == r.STYLE) {
|
||||
fullStyle = (node.check_Child_State < 1)? c.FULL:c.PART;
|
||||
} else {
|
||||
fullStyle = node[checkedKey] ? ((node.check_Child_State === 2 || node.check_Child_State === -1) ? c.FULL:c.PART) : ((node.check_Child_State < 1)? c.FULL:c.PART);
|
||||
}
|
||||
var chkName = setting.check.chkStyle + "_" + (node[checkedKey] ? c.TRUE : c.FALSE) + "_" + fullStyle;
|
||||
chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName;
|
||||
return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName;
|
||||
},
|
||||
repairAllChk: function(setting, checked) {
|
||||
if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {
|
||||
var checkedKey = setting.data.key.checked,
|
||||
childKey = setting.data.key.children,
|
||||
root = data.getRoot(setting);
|
||||
for (var i = 0, l = root[childKey].length; i<l ; i++) {
|
||||
var node = root[childKey][i];
|
||||
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||
node[checkedKey] = checked;
|
||||
}
|
||||
view.setSonNodeCheckBox(setting, node, checked);
|
||||
}
|
||||
}
|
||||
},
|
||||
repairChkClass: function(setting, node) {
|
||||
if (!node) return;
|
||||
data.makeChkFlag(setting, node);
|
||||
if (node.nocheck !== true) {
|
||||
var checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
}
|
||||
},
|
||||
repairParentChkClass: function(setting, node) {
|
||||
if (!node || !node.parentTId) return;
|
||||
var pNode = node.getParentNode();
|
||||
view.repairChkClass(setting, pNode);
|
||||
view.repairParentChkClass(setting, pNode);
|
||||
},
|
||||
repairParentChkClassWithSelf: function(setting, node) {
|
||||
if (!node) return;
|
||||
var childKey = setting.data.key.children;
|
||||
if (node[childKey] && node[childKey].length > 0) {
|
||||
view.repairParentChkClass(setting, node[childKey][0]);
|
||||
} else {
|
||||
view.repairParentChkClass(setting, node);
|
||||
}
|
||||
},
|
||||
repairSonChkDisabled: function(setting, node, chkDisabled, inherit) {
|
||||
if (!node) return;
|
||||
var childKey = setting.data.key.children;
|
||||
if (node.chkDisabled != chkDisabled) {
|
||||
node.chkDisabled = chkDisabled;
|
||||
}
|
||||
view.repairChkClass(setting, node);
|
||||
if (node[childKey] && inherit) {
|
||||
for (var i = 0, l = node[childKey].length; i < l; i++) {
|
||||
var sNode = node[childKey][i];
|
||||
view.repairSonChkDisabled(setting, sNode, chkDisabled, inherit);
|
||||
}
|
||||
}
|
||||
},
|
||||
repairParentChkDisabled: function(setting, node, chkDisabled, inherit) {
|
||||
if (!node) return;
|
||||
if (node.chkDisabled != chkDisabled && inherit) {
|
||||
node.chkDisabled = chkDisabled;
|
||||
}
|
||||
view.repairChkClass(setting, node);
|
||||
view.repairParentChkDisabled(setting, node.getParentNode(), chkDisabled, inherit);
|
||||
},
|
||||
setChkClass: function(setting, obj, node) {
|
||||
if (!obj) return;
|
||||
if (node.nocheck === true) {
|
||||
obj.hide();
|
||||
} else {
|
||||
obj.show();
|
||||
}
|
||||
obj.removeClass();
|
||||
obj.addClass(view.makeChkClass(setting, node));
|
||||
},
|
||||
setParentNodeCheckBox: function(setting, node, value, srcNode) {
|
||||
var childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked,
|
||||
checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
if (!srcNode) srcNode = node;
|
||||
data.makeChkFlag(setting, node);
|
||||
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||
node[checkedKey] = value;
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
if (setting.check.autoCheckTrigger && node != srcNode) {
|
||||
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
|
||||
}
|
||||
}
|
||||
if (node.parentTId) {
|
||||
var pSign = true;
|
||||
if (!value) {
|
||||
var pNodes = node.getParentNode()[childKey];
|
||||
for (var i = 0, l = pNodes.length; i < l; i++) {
|
||||
if ((pNodes[i].nocheck !== true && pNodes[i].chkDisabled !== true && pNodes[i][checkedKey])
|
||||
|| ((pNodes[i].nocheck === true || pNodes[i].chkDisabled === true) && pNodes[i].check_Child_State > 0)) {
|
||||
pSign = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pSign) {
|
||||
view.setParentNodeCheckBox(setting, node.getParentNode(), value, srcNode);
|
||||
}
|
||||
}
|
||||
},
|
||||
setSonNodeCheckBox: function(setting, node, value, srcNode) {
|
||||
if (!node) return;
|
||||
var childKey = setting.data.key.children,
|
||||
checkedKey = setting.data.key.checked,
|
||||
checkObj = $("#" + node.tId + consts.id.CHECK);
|
||||
if (!srcNode) srcNode = node;
|
||||
|
||||
var hasDisable = false;
|
||||
if (node[childKey]) {
|
||||
for (var i = 0, l = node[childKey].length; i < l && node.chkDisabled !== true; i++) {
|
||||
var sNode = node[childKey][i];
|
||||
view.setSonNodeCheckBox(setting, sNode, value, srcNode);
|
||||
if (sNode.chkDisabled === true) hasDisable = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (node != data.getRoot(setting) && node.chkDisabled !== true) {
|
||||
if (hasDisable && node.nocheck !== true) {
|
||||
data.makeChkFlag(setting, node);
|
||||
}
|
||||
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||
node[checkedKey] = value;
|
||||
if (!hasDisable) node.check_Child_State = (node[childKey] && node[childKey].length > 0) ? (value ? 2 : 0) : -1;
|
||||
} else {
|
||||
node.check_Child_State = -1;
|
||||
}
|
||||
view.setChkClass(setting, checkObj, node);
|
||||
if (setting.check.autoCheckTrigger && node != srcNode && node.nocheck !== true && node.chkDisabled !== true) {
|
||||
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
_z = {
|
||||
tools: _tools,
|
||||
view: _view,
|
||||
event: _event,
|
||||
data: _data
|
||||
};
|
||||
$.extend(true, $.fn.zTree.consts, _consts);
|
||||
$.extend(true, $.fn.zTree._z, _z);
|
||||
|
||||
var zt = $.fn.zTree,
|
||||
tools = zt._z.tools,
|
||||
consts = zt.consts,
|
||||
view = zt._z.view,
|
||||
data = zt._z.data,
|
||||
event = zt._z.event;
|
||||
|
||||
data.exSetting(_setting);
|
||||
data.addInitBind(_bindEvent);
|
||||
data.addInitUnBind(_unbindEvent);
|
||||
data.addInitCache(_initCache);
|
||||
data.addInitNode(_initNode);
|
||||
data.addInitProxy(_eventProxy);
|
||||
data.addInitRoot(_initRoot);
|
||||
data.addBeforeA(_beforeA);
|
||||
data.addZTreeTools(_zTreeTools);
|
||||
|
||||
var _createNodes = view.createNodes;
|
||||
view.createNodes = function(setting, level, nodes, parentNode) {
|
||||
if (_createNodes) _createNodes.apply(view, arguments);
|
||||
if (!nodes) return;
|
||||
view.repairParentChkClassWithSelf(setting, parentNode);
|
||||
}
|
||||
var _removeNode = view.removeNode;
|
||||
view.removeNode = function(setting, node) {
|
||||
var parentNode = node.getParentNode();
|
||||
if (_removeNode) _removeNode.apply(view, arguments);
|
||||
if (!node || !parentNode) return;
|
||||
view.repairChkClass(setting, parentNode);
|
||||
view.repairParentChkClass(setting, parentNode);
|
||||
}
|
||||
|
||||
var _appendNodes = view.appendNodes;
|
||||
view.appendNodes = function(setting, level, nodes, parentNode, initFlag, openFlag) {
|
||||
var html = "";
|
||||
if (_appendNodes) {
|
||||
html = _appendNodes.apply(view, arguments);
|
||||
}
|
||||
if (parentNode) {
|
||||
data.makeChkFlag(setting, parentNode);
|
||||
}
|
||||
return html;
|
||||
}
|
||||
})(jQuery);
|
@ -0,0 +1,366 @@
|
||||
/*
|
||||
* JQuery zTree exHideNodes 3.5.12
|
||||
* http://zTree.me/
|
||||
*
|
||||
* Copyright (c) 2010 Hunter.z
|
||||
*
|
||||
* Licensed same as jquery - MIT License
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* email: hunter.z@263.net
|
||||
* Date: 2013-03-11
|
||||
*/
|
||||
(function($){
|
||||
//default init node of exLib
|
||||
var _initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
|
||||
if (typeof n.isHidden == "string") n.isHidden = tools.eqs(n.isHidden, "true");
|
||||
n.isHidden = !!n.isHidden;
|
||||
data.initHideForExCheck(setting, n);
|
||||
},
|
||||
//add dom for check
|
||||
_beforeA = function(setting, node, html) {},
|
||||
//update zTreeObj, add method of exLib
|
||||
_zTreeTools = function(setting, zTreeTools) {
|
||||
zTreeTools.showNodes = function(nodes, options) {
|
||||
view.showNodes(setting, nodes, options);
|
||||
}
|
||||
zTreeTools.showNode = function(node, options) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
view.showNodes(setting, [node], options);
|
||||
}
|
||||
zTreeTools.hideNodes = function(nodes, options) {
|
||||
view.hideNodes(setting, nodes, options);
|
||||
}
|
||||
zTreeTools.hideNode = function(node, options) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
view.hideNodes(setting, [node], options);
|
||||
}
|
||||
|
||||
var _checkNode = zTreeTools.checkNode;
|
||||
if (_checkNode) {
|
||||
zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
|
||||
if (!!node && !!node.isHidden) {
|
||||
return;
|
||||
}
|
||||
_checkNode.apply(zTreeTools, arguments);
|
||||
}
|
||||
}
|
||||
},
|
||||
//method of operate data
|
||||
_data = {
|
||||
initHideForExCheck: function(setting, n) {
|
||||
if (n.isHidden && setting.check && setting.check.enable) {
|
||||
if(typeof n._nocheck == "undefined") {
|
||||
n._nocheck = !!n.nocheck
|
||||
n.nocheck = true;
|
||||
}
|
||||
n.check_Child_State = -1;
|
||||
if (view.repairParentChkClassWithSelf) {
|
||||
view.repairParentChkClassWithSelf(setting, n);
|
||||
}
|
||||
}
|
||||
},
|
||||
initShowForExCheck: function(setting, n) {
|
||||
if (!n.isHidden && setting.check && setting.check.enable) {
|
||||
if(typeof n._nocheck != "undefined") {
|
||||
n.nocheck = n._nocheck;
|
||||
delete n._nocheck;
|
||||
}
|
||||
if (view.setChkClass) {
|
||||
var checkObj = $("#" + n.tId + consts.id.CHECK);
|
||||
view.setChkClass(setting, checkObj, n);
|
||||
}
|
||||
if (view.repairParentChkClassWithSelf) {
|
||||
view.repairParentChkClassWithSelf(setting, n);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
//method of operate ztree dom
|
||||
_view = {
|
||||
clearOldFirstNode: function(setting, node) {
|
||||
var n = node.getNextNode();
|
||||
while(!!n){
|
||||
if (n.isFirstNode) {
|
||||
n.isFirstNode = false;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
}
|
||||
if (n.isLastNode) {
|
||||
break;
|
||||
}
|
||||
n = n.getNextNode();
|
||||
}
|
||||
},
|
||||
clearOldLastNode: function(setting, node) {
|
||||
var n = node.getPreNode();
|
||||
while(!!n){
|
||||
if (n.isLastNode) {
|
||||
n.isLastNode = false;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
}
|
||||
if (n.isFirstNode) {
|
||||
break;
|
||||
}
|
||||
n = n.getPreNode();
|
||||
}
|
||||
},
|
||||
makeDOMNodeMainBefore: function(html, setting, node) {
|
||||
html.push("<li ", (node.isHidden ? "style='display:none;' " : ""), "id='", node.tId, "' class='", consts.className.LEVEL, node.level,"' tabindex='0' hidefocus='true' treenode>");
|
||||
},
|
||||
showNode: function(setting, node, options) {
|
||||
node.isHidden = false;
|
||||
data.initShowForExCheck(setting, node);
|
||||
$("#" + node.tId).show();
|
||||
},
|
||||
showNodes: function(setting, nodes, options) {
|
||||
if (!nodes || nodes.length == 0) {
|
||||
return;
|
||||
}
|
||||
var pList = {}, i, j;
|
||||
for (i=0, j=nodes.length; i<j; i++) {
|
||||
var n = nodes[i];
|
||||
if (!pList[n.parentTId]) {
|
||||
var pn = n.getParentNode();
|
||||
pList[n.parentTId] = (pn === null) ? data.getRoot(setting) : n.getParentNode();
|
||||
}
|
||||
view.showNode(setting, n, options);
|
||||
}
|
||||
for (var tId in pList) {
|
||||
var children = pList[tId][setting.data.key.children];
|
||||
view.setFirstNodeForShow(setting, children);
|
||||
view.setLastNodeForShow(setting, children);
|
||||
}
|
||||
},
|
||||
hideNode: function(setting, node, options) {
|
||||
node.isHidden = true;
|
||||
node.isFirstNode = false;
|
||||
node.isLastNode = false;
|
||||
data.initHideForExCheck(setting, node);
|
||||
view.cancelPreSelectedNode(setting, node);
|
||||
$("#" + node.tId).hide();
|
||||
},
|
||||
hideNodes: function(setting, nodes, options) {
|
||||
if (!nodes || nodes.length == 0) {
|
||||
return;
|
||||
}
|
||||
var pList = {}, i, j;
|
||||
for (i=0, j=nodes.length; i<j; i++) {
|
||||
var n = nodes[i];
|
||||
if ((n.isFirstNode || n.isLastNode) && !pList[n.parentTId]) {
|
||||
var pn = n.getParentNode();
|
||||
pList[n.parentTId] = (pn === null) ? data.getRoot(setting) : n.getParentNode();
|
||||
}
|
||||
view.hideNode(setting, n, options);
|
||||
}
|
||||
for (var tId in pList) {
|
||||
var children = pList[tId][setting.data.key.children];
|
||||
view.setFirstNodeForHide(setting, children);
|
||||
view.setLastNodeForHide(setting, children);
|
||||
}
|
||||
},
|
||||
setFirstNode: function(setting, parentNode) {
|
||||
var childKey = setting.data.key.children, childLength = parentNode[childKey].length;
|
||||
if (childLength > 0 && !parentNode[childKey][0].isHidden) {
|
||||
parentNode[childKey][0].isFirstNode = true;
|
||||
} else if (childLength > 0) {
|
||||
view.setFirstNodeForHide(setting, parentNode[childKey]);
|
||||
}
|
||||
},
|
||||
setLastNode: function(setting, parentNode) {
|
||||
var childKey = setting.data.key.children, childLength = parentNode[childKey].length;
|
||||
if (childLength > 0 && !parentNode[childKey][0].isHidden) {
|
||||
parentNode[childKey][childLength - 1].isLastNode = true;
|
||||
} else if (childLength > 0) {
|
||||
view.setLastNodeForHide(setting, parentNode[childKey]);
|
||||
}
|
||||
},
|
||||
setFirstNodeForHide: function(setting, nodes) {
|
||||
var n,i,j;
|
||||
for (i=0, j=nodes.length; i<j; i++) {
|
||||
n = nodes[i];
|
||||
if (n.isFirstNode) {
|
||||
break;
|
||||
}
|
||||
if (!n.isHidden && !n.isFirstNode) {
|
||||
n.isFirstNode = true;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
} else {
|
||||
n = null;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
},
|
||||
setFirstNodeForShow: function(setting, nodes) {
|
||||
var n,i,j, first, old;
|
||||
for(i=0, j=nodes.length; i<j; i++) {
|
||||
n = nodes[i];
|
||||
if (!first && !n.isHidden && n.isFirstNode) {
|
||||
first = n;
|
||||
break;
|
||||
} else if (!first && !n.isHidden && !n.isFirstNode) {
|
||||
n.isFirstNode = true;
|
||||
first = n;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
} else if (first && n.isFirstNode) {
|
||||
n.isFirstNode = false;
|
||||
old = n;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
} else {
|
||||
n = null;
|
||||
}
|
||||
}
|
||||
return {"new":first, "old":old};
|
||||
},
|
||||
setLastNodeForHide: function(setting, nodes) {
|
||||
var n,i;
|
||||
for (i=nodes.length-1; i>=0; i--) {
|
||||
n = nodes[i];
|
||||
if (n.isLastNode) {
|
||||
break;
|
||||
}
|
||||
if (!n.isHidden && !n.isLastNode) {
|
||||
n.isLastNode = true;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
} else {
|
||||
n = null;
|
||||
}
|
||||
}
|
||||
return n;
|
||||
},
|
||||
setLastNodeForShow: function(setting, nodes) {
|
||||
var n,i,j, last, old;
|
||||
for (i=nodes.length-1; i>=0; i--) {
|
||||
n = nodes[i];
|
||||
if (!last && !n.isHidden && n.isLastNode) {
|
||||
last = n;
|
||||
break;
|
||||
} else if (!last && !n.isHidden && !n.isLastNode) {
|
||||
n.isLastNode = true;
|
||||
last = n;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
} else if (last && n.isLastNode) {
|
||||
n.isLastNode = false;
|
||||
old = n;
|
||||
view.setNodeLineIcos(setting, n);
|
||||
break;
|
||||
} else {
|
||||
n = null;
|
||||
}
|
||||
}
|
||||
return {"new":last, "old":old};
|
||||
}
|
||||
},
|
||||
|
||||
_z = {
|
||||
view: _view,
|
||||
data: _data
|
||||
};
|
||||
$.extend(true, $.fn.zTree._z, _z);
|
||||
|
||||
var zt = $.fn.zTree,
|
||||
tools = zt._z.tools,
|
||||
consts = zt.consts,
|
||||
view = zt._z.view,
|
||||
data = zt._z.data,
|
||||
event = zt._z.event;
|
||||
|
||||
data.addInitNode(_initNode);
|
||||
data.addBeforeA(_beforeA);
|
||||
data.addZTreeTools(_zTreeTools);
|
||||
|
||||
// Override method in core
|
||||
var _dInitNode = data.initNode;
|
||||
data.tmpHideParent = -1;
|
||||
data.initNode = function(setting, level, node, parentNode, isFirstNode, isLastNode, openFlag) {
|
||||
if (data.tmpHideParent !== parentNode) {
|
||||
data.tmpHideParent = parentNode;
|
||||
var tmpPNode = (parentNode) ? parentNode: data.getRoot(setting),
|
||||
children = tmpPNode[setting.data.key.children];
|
||||
data.tmpHideFirstNode = view.setFirstNodeForHide(setting, children);
|
||||
data.tmpHideLastNode = view.setLastNodeForHide(setting, children);
|
||||
view.setNodeLineIcos(setting, data.tmpHideFirstNode);
|
||||
view.setNodeLineIcos(setting, data.tmpHideLastNode);
|
||||
}
|
||||
isFirstNode = (data.tmpHideFirstNode === node);
|
||||
isLastNode = (data.tmpHideLastNode === node);
|
||||
if (_dInitNode) _dInitNode.apply(data, arguments);
|
||||
if (isLastNode) {
|
||||
view.clearOldLastNode(setting, node);
|
||||
}
|
||||
}
|
||||
|
||||
var _makeChkFlag = data.makeChkFlag;
|
||||
if (!!_makeChkFlag) {
|
||||
data.makeChkFlag = function(setting, node) {
|
||||
if (!!node && !!node.isHidden) {
|
||||
return;
|
||||
}
|
||||
_makeChkFlag.apply(data, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
var _getTreeCheckedNodes = data.getTreeCheckedNodes;
|
||||
if (!!_getTreeCheckedNodes) {
|
||||
data.getTreeCheckedNodes = function(setting, nodes, checked, results) {
|
||||
if (!!nodes && nodes.length > 0) {
|
||||
var p = nodes[0].getParentNode();
|
||||
if (!!p && !!p.isHidden) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
return _getTreeCheckedNodes.apply(data, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
var _getTreeChangeCheckedNodes = data.getTreeChangeCheckedNodes;
|
||||
if (!!_getTreeChangeCheckedNodes) {
|
||||
data.getTreeChangeCheckedNodes = function(setting, nodes, results) {
|
||||
if (!!nodes && nodes.length > 0) {
|
||||
var p = nodes[0].getParentNode();
|
||||
if (!!p && !!p.isHidden) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
return _getTreeChangeCheckedNodes.apply(data, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
var _expandCollapseSonNode = view.expandCollapseSonNode;
|
||||
if (!!_expandCollapseSonNode) {
|
||||
view.expandCollapseSonNode = function(setting, node, expandFlag, animateFlag, callback) {
|
||||
if (!!node && !!node.isHidden) {
|
||||
return;
|
||||
}
|
||||
_expandCollapseSonNode.apply(view, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
var _setSonNodeCheckBox = view.setSonNodeCheckBox;
|
||||
if (!!_setSonNodeCheckBox) {
|
||||
view.setSonNodeCheckBox = function(setting, node, value, srcNode) {
|
||||
if (!!node && !!node.isHidden) {
|
||||
return;
|
||||
}
|
||||
_setSonNodeCheckBox.apply(view, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
var _repairParentChkClassWithSelf = view.repairParentChkClassWithSelf;
|
||||
if (!!_repairParentChkClassWithSelf) {
|
||||
view.repairParentChkClassWithSelf = function(setting, node) {
|
||||
if (!!node && !!node.isHidden) {
|
||||
return;
|
||||
}
|
||||
_repairParentChkClassWithSelf.apply(view, arguments);
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
@ -0,0 +1,170 @@
|
||||
=ZTree v3.x (JQuery Tree插件) 更新日志=
|
||||
|
||||
<font color="red">为了更好的优化及扩展zTree, 因此决定升级为v3.x,并且对之前的v2.x不兼容,会有很多结构上的修改,对此深感无奈与抱歉,请大家谅解。</font>
|
||||
<font color="red">
|
||||
|
||||
具体修改内容可参考:
|
||||
|
||||
* [http://www.ztree.me/v3/api.php zTree v3.0 API 文档]
|
||||
|
||||
* [http://www.ztree.me/v3/demo.php#_101 zTree v3.0 Demo 演示]
|
||||
|
||||
* [http://www.ztree.me/v3/faq.php#_101 zTree v3.0 常见问题]
|
||||
|
||||
</font>
|
||||
|
||||
<font color=#041594>
|
||||
*2013.03.11* v3.5.12
|
||||
* 【修改】由于 jquery 1.9 中移除 event.srcElement 导致的 js 报错的bug。
|
||||
* 【修改】在异步加载模式下,使用 moveNode 方法,且 moveType != "inner" 时,也会导致 targetNode 自动加载子节点的 bug
|
||||
* 【修改】对已经显示的节点(nochecked=true)使用 showNodes 或 showNode 方法后,导致勾选框出现的bug。
|
||||
* 【修改】对已经隐藏的节点(nochecked=false)使用 hideNodes 或 hideNode 方法后,导致勾选框消失的bug。
|
||||
* 【修改】getNodesByParamFuzzy 支持 大小写模糊。
|
||||
* 【修改】className 结构,提取 _consts.className.BUTTON / LEVEL / ICO_LOADING / SWITCH,便于快速修改 css 冲突。
|
||||
例如:与 WordPress 产生冲突后,直接修改 core 中的 "button" 和 "level" 即可。 Issue: https://github.com/zTree/zTree_v3/issues/2
|
||||
|
||||
*2013.01.28* v3.5.02
|
||||
* 【增加】setting.check.chkDisabledInherit 属性,用于设置 chkDisabled 在初始化时子节点是否可以继承父节点的 chkDisabled 属性
|
||||
* 【删除】内部 noSel 方法,使用 selectstart事件 和 "-moz-user-select"样式 处理禁止 节点文字被选择的功能
|
||||
* 【修改】不兼容 jQuery 1.9 的bug
|
||||
* 【修改】onDrop 的触发规则,保证异步加载模式下,可以在延迟加载结束后触发,避免 onDrop 中被拖拽的节点是已经更新后的数据。
|
||||
* 【修改】setChkDisabled 方法,增加 inheritParent, inheritChildren 参数设置是否让父子节点继承 disabled
|
||||
* 【修改】异步加载时 拼接参数的方法,由 string 修改为 json 对象
|
||||
* 【修正】1-2-3 3级节点时,如果 2级节点 全部设置为 nocheck 或 chkDisabled后,勾选3级节点时,1级节点的半勾选状态错误的 bug
|
||||
* 【修改】Demo: checkbox_nocheck.html & checkbox_chkDisabled.html;
|
||||
* 【修改】Demo: edit_super.html,增加 showRenameBtn & showRemoveBtn 的演示
|
||||
* 【修改】Demo: asyncForAll, 将 post 修改为 get;为了避免由于 IE10 的 bug 造成的客户端 以及 服务端崩溃
|
||||
IE10 ajax Post 无法提交参数的bug (http://bugs.jquery.com/ticket/12790)
|
||||
|
||||
*2012.12.21* v3.5.01
|
||||
* 【优化】clone 方法
|
||||
* 【修正】对于初始化无 children 属性的父节点进行 reAsyncChildNodes 操作时出错的 bug
|
||||
* 【修正】beforeRename 回调中使用 cancelEditName 方法后,再 return false 导致无法重新进行编辑的 bug
|
||||
* 【修正】exedit 扩展包让 setting.data.key.url 失效的 bug
|
||||
* 【修正】setting.check.autoCheckTrigger 设置为 true 时,onCheck 回调缺少 event 参数的 bug
|
||||
* 【修正】singlepath.html Demo 中的 bug
|
||||
|
||||
*2012.11.20* v3.5
|
||||
* 【优化】原先的 clone 方法 (特别感谢:愚人码头)
|
||||
* 【修改】隐藏父节点后,使用 expandAll 方法导致 父节点展开的 bug
|
||||
* 【修改】使用 jQuery v1.7 以上时,设置 zTree 容器 ul 隐藏(visibility: hidden;)后, 调用 selectNode 导致 IE 浏览器报错 Can't move focus 的 bug
|
||||
* 【修改】正在异步加载时,执行 destory 或 init 方法后,异步加载的节点影响新树的 bug
|
||||
* 【修改】方法 reAsyncChildNodes 在 refresh 的时候未清空内部 cache 导致内存泄露 的 bug
|
||||
* 【修改】批量节点拖拽到其他父节点内(inner)时,导致顺序反转 的 bug
|
||||
* 【修改】对于 使用 html格式的 节点无法触发 双击事件 的 bug
|
||||
* 【修改】onCheck 回调中的 event ,保证与触发事件中的 event 一致
|
||||
* 【修改】异步加载时,在 onNodeCreated 中执行 selectNode 后,导致节点折叠的 bug
|
||||
* 【修改】API 中 dataFilter 的参数名称 childNodes -> responseData
|
||||
* 【修改】API 中 iconSkin 的 举例内容
|
||||
* 【修改】API 中 chkDisabled 的说明
|
||||
* 【修改】Demo 中 index.html 内的 loadReady 重复绑定问题
|
||||
|
||||
*2012.09.03* v3.4
|
||||
* 【增加】 Demo —— OutLook 样式的左侧菜单
|
||||
* 【增加】清空 zTree 的方法 $.fn.zTree.destory(treeId) & zTree.destory()
|
||||
|
||||
* 【修改】core核心文件内 _eventProxy 方法中获取 tId 的方法,提高 DOM 的灵活性
|
||||
* 【修改】初始化时 多层父节点的 checkbox 半选状态计算错误的 bug
|
||||
* 【修改】同时选中父、子节点后,利用 getSelectedNodes 获取选中节点并利用 removeNode 删除时报错的 bug
|
||||
* 【修改】treeNode.chkDisabled / nocheck 属性,支持字符串格式的 "false"/"true"
|
||||
* 【修改】异步加载模式下无法利用 server 返回 xml 并且 在 dataFilter 中继续处理的 bug
|
||||
* 【修改】title 只允许设置为 string 类型值的问题。 修正后允许设置为 number 类型的值
|
||||
* 【修改】zId 计数规则 & Cache 保存,减少 IE9 的 bug 造成的内存泄漏
|
||||
* 【修改】API 页面搜索功能导致 IE 崩溃的 bug
|
||||
|
||||
*2012.07.16* v3.3
|
||||
* 【增加】扩展库 exhide -- 节点隐藏功能
|
||||
|
||||
* 【修改】getNodesByFilter 方法,添加 invokeParam 自定义参数
|
||||
* 【修改】拖拽中测试代码未删除,导致出现黄颜色的 iframe 遮罩层的 bug
|
||||
* 【修改】延迟加载方法 对于使用 expandAll 进行全部展开时,导致 onNodeCreated 回调 和 addDiyDom 方法触发过早的 bug
|
||||
* 【修改】使用 moveNode 移动尚未生成 DOM 的节点时,视图会出现异常的 bug
|
||||
* 【修改】删除节点后,相关节点的 isFirstNode 属性未重置的 bug
|
||||
* 【修改】getPreNode(),getNextNode() 方法在对于特殊情况时计算错误的 bug
|
||||
* 【修改】设置 title 之后,如果重新将 title 内容设置为空后,会导致无法更新 title 的 bug
|
||||
* 【修改】针对 setting.check.chkStyle=="radio" && setting.check.radioType=="all" 的情况时,getTreeCheckedNodes方法优化,找到一个结果就 break
|
||||
* 【修改】zTreeObj.getCheckedNodes(false) 在 radioType = "all" 时计算错误的 bug
|
||||
* 【修改】完善 API 中 beforeDrop / onDrop 的关于 treeId 的说明
|
||||
|
||||
*2012.05.13* v3.2
|
||||
* 【增加】setting.data.key.url 允许修改 treeNode.url 属性
|
||||
* 【增加】getNodesByFilter(filter, isSingle) 方法
|
||||
* 【增加】"与其他 DOM 拖拽互动" 的 Demo (http://www.ztree.me/v3/demo.php#_511)
|
||||
* 【增加】"异步加载模式下全部展开" 的 Demo (http://www.ztree.me/v3/demo.php#_512)
|
||||
|
||||
* 【修改】代码结构,将 addNodes、removeNode、removeChildNodes 方法 和 beforeRemove、onRemove 回调 转移到 core 内
|
||||
* 【修改】IE7的环境下无子节点的父节点反复展开出现多余空行的 bug
|
||||
* 【修改】异步加载时,如果出现网络异常等,会导致 图标显示错误的 bug
|
||||
* 【修改】dataFilter中 return null 导致异常 的 bug
|
||||
* 【修改】removeChildNodes 方法清空子节点后,无法正常添加节点的 bug
|
||||
* 【修改】moveNode 后节点中的自定义元素的事件丢失的 bug
|
||||
* 【修改】moveNode 方法中设置 isSilent = true 时,如果移动到已展开的 父节点后,出现异常的 bug
|
||||
* 【修改】onClick/onDrag/onDrop 回调中 event 不是原始 event 的 bug
|
||||
* 【修改】onDrop 回调中 当拖拽无效时,无法获得 treeNodes 的 bug
|
||||
* 【修改】onDrop 无法判断拖拽是 移动还是复制的问题
|
||||
* 【修改】未开启异步加载模式时,拖拽节点到子节点为空的父节点内时 出现异常 的 bug
|
||||
* 【修改】拖拽过程中,反复在 父节点图标上划动时,会出现停顿的 bug
|
||||
(需要css 结构—— button -> span.button)
|
||||
|
||||
* 【修改】拖拽操作时箭头 与 targetNode 背景之间的细节现实问题,便于用户拖拽时更容易区分 prev、next 和 inner 操作
|
||||
* 【修改】拖拽操作时IE6/7 下 在 节点<a> 右侧 10px 内会导致 targetNode = root 的 bug
|
||||
* 【修改】编辑模式下 默认的编辑按钮、删除按钮点击后,如果相应的 before 回调 return false 时会触发 onClick 回调的 bug
|
||||
|
||||
*2012.02.14* v3.1
|
||||
* 【增加】ajax 的参数 setting.async.contentType ,让提交参数适用于 json 数据提交 (主要适用于 .Net 的开发)。
|
||||
* 【增加】setting.edit.editNameSelectAll, 用于设定编辑节点名称时初次显示 input 后 text 内容为全选
|
||||
* 【修改】异步加载 规则,不再仅仅依靠父节点的子节点数来判定,增加内部属性 zAsync,保证默认状态下父节点及时无子节点也只能异步加载一次,除非使用 reAsyncChildNodes 方法强行控制异步加载。
|
||||
* 【修改】放大浏览器后导致 界面出现多余连接线的bug (需要更新:icon 图标和 css )
|
||||
* 【修改】在编辑状态,如果节点名超过编辑框宽度,左右键在框内不起作用的bug(IE 6 7 8 出现)
|
||||
CSS 中 filter:alpha(opacity=80) 造成的,应该是 ie 的 bug,需要更新 css 文件
|
||||
* 【修改】title 设置后,如果属性不存在,则默认为 title 为空,便于数据容错和用户灵活使用
|
||||
* 【修改】editName 方法如果针对尚未展开的 父节点,会导致该父节点自动展开的 bug
|
||||
* 【修改】title 中存在标签时导致 title 显示异常的bug(例如:蓝色字22%"'`<input/>`)
|
||||
|
||||
*2012.01.10* v3.0
|
||||
* 【增加】setting.check.autoCheckTrigger 默认值 false,可以设置联动选中时是否触发事件回调函数
|
||||
* 【增加】setting.callback.beforeEditName 回调函数,以保证用户可以捕获点击编辑按钮的事件
|
||||
* 【增加】treeNode.chkDisabled 属性,显示 checkbox 但是用户无法修改 checkbox 状态,并且该 checkbox 会影响父节点的 checkbox 的半选状态
|
||||
* 【增加】setting.check.nocheckInherit 属性,用户设置子节点继承 nocheck 属性,用于批量初始化节点,不适用于已经显示的节点
|
||||
* 【增加】setting.edit.drag.autoExpandTrigger 默认值 false,可以设置自动展开、折叠操作时是否触发事件回调函数
|
||||
* 【增加】setting.view.nameIsHTML 默认值 false,允许用户对 name 设置 DOM 对象
|
||||
* 【增加】treeNode.click 属性的说明文档
|
||||
* 【增加】treeObj.setChkDisabled 方法用于设置 checkbox / radio disabled 状态
|
||||
* 【增加】treeNode.halfCheck 属性,用于强制设定节点的半选状态
|
||||
|
||||
* 【修改】异步加载 & 编辑功能 共存时,拖拽节点 或 增加节点 导致 ie 上报错的 bug (apply 方法引起)
|
||||
* 【修改】zTreeStyle 样式冲突
|
||||
* 【修改】setting.data.key.title 默认值设置为 "",初始化时自动赋值为 setting.data.key.name 这样可避免希望 title 与 name 一致的用户反复设置参数
|
||||
* 【修改】点击叶子节点的连接线会触发 expand 事件的 bug
|
||||
* 【修改】IE 下 点击叶子节点连线会出现虚线框的 bug
|
||||
* 【修改】updateNode 导致 checkbox 半选状态错误的 bug
|
||||
* 【修改】checkNode 方法实现 toggle 操作, 取消 expandAll 方法的 toggle 操作
|
||||
* 【修改】zTree 内鼠标移动会抢页面上 input 内的焦点的 bug
|
||||
* 【修改】beforeRename / onRename 的触发方式——即使名称内容未改变也会触发,便于用户配合 beforeEditName 捕获编辑状态的结束,赋予用户更多调整规则的权利
|
||||
* 【修改】与 easyUI 共存时无法拖拽的bug
|
||||
* 【修改】beforeRename 在 Firefox 下如果利用 alert,会触发两次的 bug
|
||||
* 【修改】checkNode/expandNode/removeNode 方法,默认不触发回调函数,恢复 v2.6 的默认状态,同时增加 callbackFlag 参数,设置为 true 时,可以触发回调函数
|
||||
* 【修改】IE9下“根据参数查找节点”的Demo 报错:行14 重新声明常量属性(Demo 自身的问题,定义了history变量)
|
||||
* 【修改】初始化 zTree 时 onNodeCreated 事件回调函数中无法 用 getZTreeObj 获取 zTree 对象的 bug
|
||||
* 【修改】setting.edit.drag.prev / next / inner 参数,增加被拖拽的节点集合
|
||||
* 【修改】异步加载模式下,otherParam 使用Array数组会出错的 bug。例如: ["id", "1", "name", "test"]
|
||||
* 【修改】FireFox 下多棵树拖拽异常的 bug
|
||||
* 【修改】exedit 中调用 excheck库的方法时没有进行容错处理,导致如果只加入 exedit 而没有 excheck的时候,会出现 js 错误
|
||||
* 【修改】显示 checkbox 的 zTree 在编辑模式下,移动节点不会更新父节点半选状态的 bug
|
||||
* 【修改】treeNode.childs --> children; treeObject.removeChilds --> removeChildNodes; setting.data.key.childs --> children(英文不好惹的祸!抱歉了!)
|
||||
* 【修改】onRemove 回调中得到的 treeNode 还可以查找 preNode、nextNode 的bug。 修正后,getPreNode 和 getNextNode 都返回 null; 为了便于查找父节点,getParentNode 仍保留
|
||||
* 【修改】简单数据模式下,如果 id 与 pId 的值相同会导致该节点无法正常加载的 bug
|
||||
* 【修改】移动或删除中间节点会导致最后一个节点连接线图标变小的 bug
|
||||
|
||||
*2011.09.05* v3.0 beta
|
||||
* 【修改】zTree 的 js 代码架构全面修改,并且拆分
|
||||
* 【修改】zTree 的 css 样式全面修改,对浏览器可以更好地兼容,同时解决了以前1个像素差的问题
|
||||
* 【优化】采用延迟加载技术,一次性加载大数据量的节点性能飞速提升
|
||||
* 【增加】支持多节点同时选中、拖拽
|
||||
* 【增加】checkNode、checkAllNodes 等多种方法
|
||||
* 【增加】IE6 自动取消动画展开、折叠的功能
|
||||
* 【修正】异步加载 & 编辑模式 能够更完美的共存
|
||||
* 【修正】setting 配置更加合理,并且增加了若干项配置参数
|
||||
* 【修正】treeNode 节点数据的属性更加合理,并且增加了一些方法
|
||||
* 【修正】拖拽操作更加灵活方便,更容易制定自己的规则
|
||||
* 【修正】其他若干修改,详细对比请参考 url:[http://www.ztree.me/v3/faq.php#_101 zTree v3.0 常见问题]
|
BIN
src/main/resources/static/ajax/libs/layer/.DS_Store
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/*! layer弹层组件拓展类 */
|
||||
;!function(){layer.use("skin/layer.ext.css",function(){layer.layui_layer_extendlayerextjs=!0});var a=layer.cache||{},b=function(b){return a.skin?" "+a.skin+" "+a.skin+"-"+b:""};layer.prompt=function(a,c){a=a||{},"function"==typeof a&&(c=a);var d,e=2==a.formType?'<textarea class="layui-layer-input">'+(a.value||"")+"</textarea>":function(){return'<input type="'+(1==a.formType?"password":"text")+'" class="layui-layer-input" value="'+(a.value||"")+'">'}();return layer.open($.extend({btn:["确定","取消"],content:e,skin:"layui-layer-prompt"+b("prompt"),success:function(a){d=a.find(".layui-layer-input"),d.focus()},yes:function(b){var e=d.val();""===e?d.focus():e.length>(a.maxlength||500)?layer.tips("最多输入"+(a.maxlength||500)+"个字数",d,{tips:1}):c&&c(e,b,d)}},a))},layer.tab=function(a){a=a||{};var c=a.tab||{};return layer.open($.extend({type:1,skin:"layui-layer-tab"+b("tab"),title:function(){var a=c.length,b=1,d="";if(a>0)for(d='<span class="layui-layer-tabnow">'+c[0].title+"</span>";a>b;b++)d+="<span>"+c[b].title+"</span>";return d}(),content:'<ul class="layui-layer-tabmain">'+function(){var a=c.length,b=1,d="";if(a>0)for(d='<li class="layui-layer-tabli xubox_tab_layer">'+(c[0].content||"no content")+"</li>";a>b;b++)d+='<li class="layui-layer-tabli">'+(c[b].content||"no content")+"</li>";return d}()+"</ul>",success:function(a){var b=a.find(".layui-layer-title").children(),c=a.find(".layui-layer-tabmain").children();b.on("mousedown",function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0;var b=$(this),d=b.index();b.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),c.eq(d).show().siblings().hide()})}},a))},layer.photos=function(a,c,d){function e(a,b,c){var d=new Image;d.onload=function(){d.onload=null,b(d)},d.onerror=function(a){d.onerror=null,c(a)},d.src=a}var f={};if(a=a||{},a.photos){var g=a.photos.constructor===Object,h=g?a.photos:{},i=h.data||[],j=h.start||0;if(f.imgIndex=j+1,g){if(0===i.length)return void layer.msg("没有图片")}else{var k=$(a.photos),l=k.find(a.img||"img");if(0===l.length)return;if(c||k.find(h.img||"img").each(function(b){var c=$(this);i.push({alt:c.attr("alt"),pid:c.attr("layer-pid"),src:c.attr("layer-src")||c.attr("src"),thumb:c.attr("src")}),c.on("click",function(){layer.photos($.extend(a,{photos:{start:b,data:i,tab:a.tab},full:a.full}),!0)})}),!c)return}f.imgprev=function(a){f.imgIndex--,f.imgIndex<1&&(f.imgIndex=i.length),f.tabimg(a)},f.imgnext=function(a,b){f.imgIndex++,f.imgIndex>i.length&&(f.imgIndex=1,b)||f.tabimg(a)},f.keyup=function(a){if(!f.end){var b=a.keyCode;a.preventDefault(),37===b?f.imgprev(!0):39===b?f.imgnext(!0):27===b&&layer.close(f.index)}},f.tabimg=function(b){i.length<=1||(h.start=f.imgIndex-1,layer.close(f.index),layer.photos(a,!0,b))},f.event=function(){f.bigimg.hover(function(){f.imgsee.show()},function(){f.imgsee.hide()}),f.bigimg.find(".layui-layer-imgprev").on("click",function(a){a.preventDefault(),f.imgprev()}),f.bigimg.find(".layui-layer-imgnext").on("click",function(a){a.preventDefault(),f.imgnext()}),$(document).on("keyup",f.keyup)},f.loadi=layer.load(1,{shade:"shade"in a?!1:.9,scrollbar:!1}),e(i[j].src,function(c){layer.close(f.loadi),f.index=layer.open($.extend({type:1,area:function(){var b=[c.width,c.height],d=[$(window).width()-100,$(window).height()-100];return!a.full&&b[0]>d[0]&&(b[0]=d[0],b[1]=b[0]*d[1]/b[0]),[b[0]+"px",b[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,shift:5*Math.random()|0,skin:"layui-layer-photos"+b("photos"),content:'<div class="layui-layer-phimg"><img src="'+i[j].src+'" alt="'+(i[j].alt||"")+'" layer-pid="'+i[j].pid+'"><div class="layui-layer-imgsee">'+(i.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(d?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(i[j].alt||"")+"</a><em>"+f.imgIndex+"/"+i.length+"</em></span></div></div></div>",success:function(b,c){f.bigimg=b.find(".layui-layer-phimg"),f.imgsee=b.find(".layui-layer-imguide,.layui-layer-imgbar"),f.event(b),a.tab&&a.tab(i[j],b)},end:function(){f.end=!0,$(document).off("keyup",f.keyup)}},a))},function(){layer.close(f.loadi),layer.msg("当前图片地址异常<br>是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){i.length>1&&f.imgnext(!0,!0)}})})}}}();
|
11
src/main/resources/static/ajax/libs/layer/laydate/laydate.js
Normal file
@ -0,0 +1,75 @@
|
||||
/**
|
||||
|
||||
@Name: laydate 核心样式
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
html{_background-image:url(about:blank); _background-attachment:fixed;}
|
||||
.layer-date{display: inline-block!important;vertical-align:text-top;max-width:240px;}
|
||||
.laydate_body .laydate_box, .laydate_body .laydate_box *{margin:0; padding:0;}
|
||||
.laydate-icon,
|
||||
.laydate-icon-default,
|
||||
.laydate-icon-danlan,
|
||||
.laydate-icon-dahong,
|
||||
.laydate-icon-molv{height:34px; padding-right:20px;min-width:34px;vertical-align: text-top;border:1px solid #C6C6C6; background-repeat:no-repeat; background-position:right center; background-color:#fff; outline:0;}
|
||||
.laydate-icon-default{ background-image:url(../skins/default/icon.png)}
|
||||
.laydate-icon-danlan{border:1px solid #B1D2EC; background-image:url(../skins/danlan/icon.png)}
|
||||
.laydate-icon-dahong{background-image:url(../skins/dahong/icon.png)}
|
||||
.laydate-icon-molv{background-image:url(../skins/molv/icon.png)}
|
||||
.laydate_body .laydate_box{width:240px; font:12px '\5B8B\4F53'; z-index:99999999; *margin:-2px 0 0 -2px; *overflow:hidden; _margin:0; _position:absolute!important; background-color:#fff;}
|
||||
.laydate_body .laydate_box li{list-style:none;}
|
||||
.laydate_body .laydate_box .laydate_void{cursor:text!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{text-decoration:none; blr:expression(this.onFocus=this.blur()); cursor:pointer;}
|
||||
.laydate_body .laydate_box a:hover{text-decoration:none;}
|
||||
.laydate_body .laydate_box cite, .laydate_body .laydate_box label{position:absolute; width:0; height:0; border-width:5px; border-style:dashed; border-color:transparent; overflow:hidden; cursor:pointer;}
|
||||
.laydate_body .laydate_box .laydate_yms, .laydate_body .laydate_box .laydate_time{display:none;}
|
||||
.laydate_body .laydate_box .laydate_show{display:block;}
|
||||
.laydate_body .laydate_box input{outline:0; font-size:14px; background-color:#fff;}
|
||||
.laydate_body .laydate_top{position:relative; height:26px; padding:5px; *width:100%; z-index:99;}
|
||||
.laydate_body .laydate_ym{position:relative; float:left; height:24px; cursor:pointer;}
|
||||
.laydate_body .laydate_ym input{float:left; height:24px; line-height:24px; text-align:center; border:none; cursor:pointer;}
|
||||
.laydate_body .laydate_ym .laydate_yms{position:absolute; left: -1px; top: 24px; height:181px;}
|
||||
.laydate_body .laydate_y{width:121px;}
|
||||
.laydate_body .laydate_y input{width:64px; margin-right:15px;}
|
||||
.laydate_body .laydate_y .laydate_yms{width:121px; text-align:center;}
|
||||
.laydate_body .laydate_y .laydate_yms a{position:relative; display:block; height:20px;}
|
||||
.laydate_body .laydate_y .laydate_yms ul{height:139px; padding:0; *overflow:hidden;}
|
||||
.laydate_body .laydate_y .laydate_yms ul li{float:left; width:60px; height:20px; line-height: 20px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
|
||||
.laydate_box *{box-sizing:content-box!important;}
|
||||
.laydate_body .laydate_m{width:99px;float: right;margin-right:-2px;}
|
||||
.laydate_body .laydate_m .laydate_yms{width:99px; padding:0;}
|
||||
.laydate_body .laydate_m input{width:42px; margin-right:15px;}
|
||||
.laydate_body .laydate_m .laydate_yms span{display:block; float:left; width:42px; margin: 5px 0 0 5px; line-height:24px; text-align:center; _display:inline;}
|
||||
.laydate_body .laydate_choose{display:block; float:left; position:relative; width:20px; height:24px;}
|
||||
.laydate_body .laydate_choose cite, .laydate_body .laydate_tab cite{left:50%; top:50%;}
|
||||
.laydate_body .laydate_chtop cite{margin:-7px 0 0 -5px; border-bottom-style:solid;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{top:50%; margin:-2px 0 0 -5px; border-top-style:solid;}
|
||||
.laydate_body .laydate_chprev cite{margin:-5px 0 0 -7px;}
|
||||
.laydate_body .laydate_chnext cite{margin:-5px 0 0 -2px;}
|
||||
.laydate_body .laydate_ym label{right:28px;}
|
||||
.laydate_body .laydate_table{ width:230px; margin:0 5px; border-collapse:collapse; border-spacing:0px; }
|
||||
.laydate_body .laydate_table td{width:31px; height:19px; line-height:19px; text-align: center; cursor:pointer; font-size: 12px;}
|
||||
.laydate_body .laydate_table thead{height:22px; line-height:22px;}
|
||||
.laydate_body .laydate_table thead th{font-weight:400; font-size:12px; text-align:center;}
|
||||
.laydate_body .laydate_bottom{position:relative; height:22px; line-height:20px; padding:5px; font-size:12px;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{position: relative; z-index: 1; float:left; }
|
||||
.laydate_body .laydate_time{ position:absolute; left:5px; bottom: 26px; width:129px; height:125px; *overflow:hidden;}
|
||||
.laydate_body .laydate_time .laydate_hmsno{ padding:5px 0 0 5px;}
|
||||
.laydate_body .laydate_time .laydate_hmsno span{display:block; float:left; width:24px; height:19px; line-height:19px; text-align:center; cursor:pointer; *margin-bottom:-5px;}
|
||||
.laydate_body .laydate_time1{width:228px; height:154px;}
|
||||
.laydate_body .laydate_time1 .laydate_hmsno{padding: 6px 0 0 8px;}
|
||||
.laydate_body .laydate_time1 .laydate_hmsno span{width:21px; height:20px; line-height:20px;}
|
||||
.laydate_body .laydate_msg{left:49px; bottom:67px; width:141px; height:auto; overflow: hidden;}
|
||||
.laydate_body .laydate_msg p{padding:5px 10px;}
|
||||
.laydate_body .laydate_bottom li{float:left; height:20px; line-height:20px; border-right:none; font-weight:900;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{width:33px; text-align:center; font-weight:400;}
|
||||
.laydate_body .laydate_bottom input{float:left; width:21px; height:20px; line-height:20px; border:none; text-align:center; cursor:pointer; font-size:12px; font-weight:400;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{height:20px; line-height:20px; text-align:center;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex span{position:absolute; width:20px; top:0; right:0px; cursor:pointer;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex span:hover{font-size:14px;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{position:absolute; right:5px; top:5px;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{float:left; height:20px; padding:0 6px; _padding:0 5px;}
|
||||
.laydate_body .laydate_bottom .laydate_v{position:absolute; left:10px; top:6px; font-family:Courier; z-index:0;}
|
||||
|
After Width: | Height: | Size: 309 B |
@ -0,0 +1,59 @@
|
||||
/**
|
||||
|
||||
@Name: laydate皮肤:墨绿
|
||||
@Author:贤心
|
||||
@Site:http://sentsin.com/layui/laydate
|
||||
|
||||
**/
|
||||
|
||||
.laydate-icon{border:1px solid #ccc; background-image:url(icon.png)}
|
||||
|
||||
.laydate_body .laydate_bottom #laydate_hms,
|
||||
.laydate_body .laydate_time{border:1px solid #ccc;}
|
||||
|
||||
.laydate_body .laydate_box,
|
||||
.laydate_body .laydate_ym .laydate_yms,
|
||||
.laydate_body .laydate_time{box-shadow: 2px 2px 5px rgba(0,0,0,.1);}
|
||||
|
||||
.laydate_body .laydate_box{border-top:none; border-bottom:none; background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_box input{background:none!important; color:#fff;}
|
||||
.laydate_body .laydate_box .laydate_void{color:#00E8D7!important;}
|
||||
.laydate_body .laydate_box a, .laydate_body .laydate_box a:hover{color:#00625A;}
|
||||
.laydate_body .laydate_box a:hover{color:#666;}
|
||||
.laydate_body .laydate_click{background-color:#009F95!important; color:#fff!important;}
|
||||
.laydate_body .laydate_top{border-top:1px solid #009F95; background-color:#009F95}
|
||||
.laydate_body .laydate_ym{border:1px solid #009F95; background-color:#009F95;}
|
||||
.laydate_body .laydate_ym .laydate_yms{border:1px solid #009F95; background-color:#009F95; color:#fff;}
|
||||
.laydate_body .laydate_y .laydate_yms a{border-bottom:1px solid #009F95;}
|
||||
.laydate_body .laydate_y .laydate_yms .laydate_chdown{border-top:1px solid #009F95; border-bottom:none;}
|
||||
.laydate_body .laydate_choose{border-left:1px solid #009F95;}
|
||||
.laydate_body .laydate_chprev{border-left:none; border-right:1px solid #009F95;}
|
||||
.laydate_body .laydate_choose:hover,
|
||||
.laydate_body .laydate_y .laydate_yms a:hover{background-color:#00C1B3;}
|
||||
.laydate_body .laydate_chtop cite{border-bottom-color:#fff;}
|
||||
.laydate_body .laydate_chdown cite, .laydate_body .laydate_ym label{border-top-color:#fff;}
|
||||
.laydate_body .laydate_chprev cite{border-right-style:solid; border-right-color:#fff;}
|
||||
.laydate_body .laydate_chnext cite{border-left-style:solid; border-left-color:#fff;}
|
||||
.laydate_body .laydate_table{width: 240px!important; margin: 0!important; border:1px solid #ccc; border-top:none; border-bottom:none;}
|
||||
.laydate_body .laydate_table td{border:none; height:21px!important; line-height:21px!important; background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_table .laydate_nothis{color:#999;}
|
||||
.laydate_body .laydate_table thead{border-bottom:1px solid #ccc; height:21px!important; line-height:21px!important;}
|
||||
.laydate_body .laydate_table thead th{}
|
||||
.laydate_body .laydate_bottom{border:1px solid #ccc; border-top:none;}
|
||||
.laydate_body .laydate_bottom #laydate_hms{background-color:#fff;}
|
||||
.laydate_body .laydate_time{background-color:#fff;}
|
||||
.laydate_body .laydate_time1{width: 226px!important; height: 152px!important;}
|
||||
.laydate_body .laydate_bottom .laydate_sj{width:31px!important; border-right:1px solid #ccc; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom input{background-color:#fff; color:#00625A;}
|
||||
.laydate_body .laydate_bottom .laydte_hsmtex{border-bottom:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_btn{border-right:1px solid #ccc;}
|
||||
.laydate_body .laydate_bottom .laydate_v{color:#999}
|
||||
.laydate_body .laydate_bottom .laydate_btn a{border: 1px solid #ccc; border-right:none; background-color:#fff;}
|
||||
.laydate_body .laydate_bottom .laydate_btn a:hover{background-color:#F6F6F6; color:#00625A;}
|
||||
|
||||
.laydate_body .laydate_m .laydate_yms span:hover,
|
||||
.laydate_body .laydate_time .laydate_hmsno span:hover,
|
||||
.laydate_body .laydate_y .laydate_yms ul li:hover,
|
||||
.laydate_body .laydate_table td:hover{background-color:#00C1B3; color:#fff;}
|
||||
|
||||
|
2
src/main/resources/static/ajax/libs/layer/layer.min.js
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"status": 1,
|
||||
"msg": "ok",
|
||||
"data": [
|
||||
{
|
||||
"id": "100001",
|
||||
"name": "Beaut-zihan",
|
||||
"time": "10:23",
|
||||
"face": "img/a1.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100002",
|
||||
"name": "慕容晓晓",
|
||||
"time": "昨天",
|
||||
"face": "img/a2.jpg"
|
||||
},
|
||||
{
|
||||
"id": "1000033",
|
||||
"name": "乔峰",
|
||||
"time": "2014-4.22",
|
||||
"face": "img/a3.jpg"
|
||||
},
|
||||
{
|
||||
"id": "10000333",
|
||||
"name": "高圆圆",
|
||||
"time": "2014-4.21",
|
||||
"face": "img/a4.jpg"
|
||||
}
|
||||
]
|
||||
}
|
107
src/main/resources/static/ajax/libs/layer/layim/data/friend.json
Normal file
@ -0,0 +1,107 @@
|
||||
{
|
||||
"status": 1,
|
||||
"msg": "ok",
|
||||
"data": [
|
||||
{
|
||||
"name": "销售部",
|
||||
"nums": 36,
|
||||
"id": 1,
|
||||
"item": [
|
||||
{
|
||||
"id": "100001",
|
||||
"name": "郭敬明",
|
||||
"face": "img/a5.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100002",
|
||||
"name": "作家崔成浩",
|
||||
"face": "img/a6.jpg"
|
||||
},
|
||||
{
|
||||
"id": "1000022",
|
||||
"name": "韩寒",
|
||||
"face": "img/a7.jpg"
|
||||
},
|
||||
{
|
||||
"id": "10000222",
|
||||
"name": "范爷",
|
||||
"face": "img/a8.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100002222",
|
||||
"name": "小马哥",
|
||||
"face": "img/a9.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "大学同窗",
|
||||
"nums": 16,
|
||||
"id": 2,
|
||||
"item": [
|
||||
{
|
||||
"id": "1000033",
|
||||
"name": "苏醒",
|
||||
"face": "img/a9.jpg"
|
||||
},
|
||||
{
|
||||
"id": "10000333",
|
||||
"name": "马云",
|
||||
"face": "img/a8.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100003",
|
||||
"name": "鬼脚七",
|
||||
"face": "img/a7.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100004",
|
||||
"name": "谢楠",
|
||||
"face": "img/a6.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100005",
|
||||
"name": "徐峥",
|
||||
"face": "img/a5.jpg"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "H+后台主题",
|
||||
"nums": 38,
|
||||
"id": 3,
|
||||
"item": [
|
||||
{
|
||||
"id": "100006",
|
||||
"name": "柏雪近在它香",
|
||||
"face": "img/a4.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100007",
|
||||
"name": "罗昌平",
|
||||
"face": "img/a3.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100008",
|
||||
"name": "Crystal影子",
|
||||
"face": "img/a2.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100009",
|
||||
"name": "艺小想",
|
||||
"face": "img/a1.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100010",
|
||||
"name": "天猫",
|
||||
"face": "img/a8.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100011",
|
||||
"name": "张泉灵",
|
||||
"face": "img/a7.jpg"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
{
|
||||
"status": 1,
|
||||
"msg": "ok",
|
||||
"data": [
|
||||
{
|
||||
"name": "H+交流群",
|
||||
"nums": 36,
|
||||
"id": 1,
|
||||
"item": [
|
||||
{
|
||||
"id": "101",
|
||||
"name": "H+ Bug反馈",
|
||||
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
|
||||
},
|
||||
{
|
||||
"id": "102",
|
||||
"name": "H+ 技术交流",
|
||||
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Bootstrap",
|
||||
"nums": 16,
|
||||
"id": 2,
|
||||
"item": [
|
||||
{
|
||||
"id": "103",
|
||||
"name": "Bootstrap中文",
|
||||
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
|
||||
},
|
||||
{
|
||||
"id": "104",
|
||||
"name": "Bootstrap资源",
|
||||
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "WebApp",
|
||||
"nums": 106,
|
||||
"id": 3,
|
||||
"item": [
|
||||
{
|
||||
"id": "105",
|
||||
"name": "移动开发",
|
||||
"face": "http://tp2.sinaimg.cn/2211874245/180/40050524279/0"
|
||||
},
|
||||
{
|
||||
"id": "106",
|
||||
"name": "H5前言",
|
||||
"face": "http://tp3.sinaimg.cn/1820711170/180/1286855219/1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
{
|
||||
"status": 1,
|
||||
"msg": "ok",
|
||||
"data": [
|
||||
{
|
||||
"id": "100001",
|
||||
"name": "無言的蒁説",
|
||||
"face": "img/a1.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100002",
|
||||
"name": "婷宝奢侈品",
|
||||
"face": "img/a2.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100003",
|
||||
"name": "忆恨思爱",
|
||||
"face": "img/a3.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100004",
|
||||
"name": "天涯奥拓慢",
|
||||
"face": "img/a4.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100005",
|
||||
"name": "雨落无声的天空",
|
||||
"face": "img/a5.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100006",
|
||||
"name": "李越LycorisRadiate",
|
||||
"face": "img/a6.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100007",
|
||||
"name": "冯胖妞张直丑",
|
||||
"face": "img/a7.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100008",
|
||||
"name": "陈龙hmmm",
|
||||
"face": "img/a8.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100009",
|
||||
"name": "别闹哥胆儿小",
|
||||
"face": "img/a9.jpg"
|
||||
},
|
||||
{
|
||||
"id": "100010",
|
||||
"name": "锅锅锅锅萌哒哒 ",
|
||||
"face": "img/a10.jpg"
|
||||
}
|
||||
]
|
||||
}
|
158
src/main/resources/static/ajax/libs/layer/layim/layim.css
Normal file
@ -0,0 +1,158 @@
|
||||
/*
|
||||
|
||||
@Name: layim WebIM 1.0.0
|
||||
@Author:贤心(子涵修改)
|
||||
@Date: 2014-04-25
|
||||
@Blog: http://sentsin.com
|
||||
|
||||
*/
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,input,button,textarea,p,blockquote,th,td,form{margin:0; padding:0;}
|
||||
input,button,textarea,select,optgroup,option{font-family:inherit; font-size:inherit; font-style:inherit; font-weight:inherit; outline: 0;}
|
||||
li{list-style:none;}
|
||||
.xxim_icon, .xxim_main i, .layim_chatbox i{position:absolute;}
|
||||
.loading{background:url(loading.gif) no-repeat center center;}
|
||||
.layim_chatbox a, .layim_chatbox a:hover{color:#343434; text-decoration:none; }
|
||||
.layim_zero{position:absolute; width:0; height:0; border-style:dashed; border-color:transparent; overflow:hidden;}
|
||||
|
||||
.xxim_main{position:fixed; right:1px; bottom:1px; width:230px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2); z-index:99999999}
|
||||
.layim_chatbox textarea{resize:none;}
|
||||
.xxim_main em, .xxim_main i, .layim_chatbox em, .layim_chatbox i{font-style:normal; font-weight:400;}
|
||||
.xxim_main h5{font-size:100%; font-weight:400;}
|
||||
|
||||
/* 搜索栏 */
|
||||
.xxim_search{position:relative; padding-left:40px; height:40px; border-bottom:1px solid #DCDCDC; background-color:#fff;}
|
||||
.xxim_search i{left:10px; top:12px; width:16px; height:16px;font-size: 16px;color:#999;}
|
||||
.xxim_search input{border:none; background:none; width: 180px; margin-top:10px; line-height:20px;}
|
||||
.xxim_search span{display:none; position:absolute; right:10px; top:10px; height:18px; line-height:18px;width:18px;text-align: center;background-color:#AFAFAF; color:#fff; cursor:pointer; border-radius:2px; font-size:12px; font-weight:900;}
|
||||
.xxim_search span:hover{background-color:#FCBE00;}
|
||||
|
||||
/* 主面板tab */
|
||||
.xxim_tabs{height:45px; border-bottom:1px solid #DBDBDB; background-color:#F4F4F4; font-size:0;}
|
||||
.xxim_tabs span{position:relative; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:76px; height:45px; border-right:1px solid #DBDBDB; cursor:pointer; font-size:12px;}
|
||||
.xxim_tabs span i{top:12px; left:50%; width:20px; margin-left:-10px; height:20px;font-size:20px;color:#ccc;}
|
||||
.xxim_tabs .xxim_tabnow{height:46px; background-color:#fff;}
|
||||
.xxim_tabs .xxim_tabnow i{color:#1ab394;}
|
||||
.xxim_tabs .xxim_latechat{border-right:none;}
|
||||
.xxim_tabs .xxim_tabfriend i{width:14px; margin-left:-7px;}
|
||||
|
||||
/* 主面板列表 */
|
||||
.xxim_list{display:none; height:350px; padding:5px 0; overflow:hidden;}
|
||||
.xxim_list:hover{ overflow-y:auto;}
|
||||
.xxim_list h5{position:relative; padding-left:32px; height:26px; line-height:26px; cursor:pointer; color:#000; font-size:0;}
|
||||
.xxim_list h5 span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; max-width:140px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:12px;}
|
||||
.xxim_list h5 i{left:15px; top:8px; width:10px; height:10px;font-size:10px;color:#666;}
|
||||
.xxim_list h5 *{font-size:12px;}
|
||||
.xxim_list .xxim_chatlist{display:none;}
|
||||
.xxim_list .xxim_liston h5 i{width:8px; height:7px;}
|
||||
.xxim_list .xxim_liston .xxim_chatlist{display:block;}
|
||||
.xxim_chatlist {}
|
||||
.xxim_chatlist li{position:relative; height:40px; line-height:30px; padding:5px 10px; font-size:0; cursor:pointer;}
|
||||
.xxim_chatlist li:hover{background-color:#F2F4F8}
|
||||
.xxim_chatlist li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; font-size:12px;}
|
||||
.xxim_chatlist li span{padding-left:10px; max-width:120px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
|
||||
.xxim_chatlist li img{width:30px; height:30px;}
|
||||
.xxim_chatlist li .xxim_time{position:absolute; right:10px; color:#999;}
|
||||
.xxim_list .xxim_errormsg{text-align:center; margin:50px 0; color:#999;}
|
||||
.xxim_searchmain{position:absolute; width:230px; height:491px; left:0; top:41px; z-index:10; background-color:#fff;}
|
||||
|
||||
/* 主面板底部 */
|
||||
.xxim_bottom{height:34px; border-top:1px solid #D0DCF3; background-color:#F2F4F8;}
|
||||
.xxim_expend{border-left:1px solid #D0DCF3; border-bottom:1px solid #D0DCF3;}
|
||||
.xxim_bottom li{position:relative; width:50px; height:32px; line-height:32px; float:left; border-right:1px solid #D0DCF3; cursor:pointer;}
|
||||
.xxim_bottom li i{ top:9px;}
|
||||
.xxim_bottom .xxim_hide{border-right:none;}
|
||||
.xxim_bottom .xxim_online{width:72px; padding-left:35px;}
|
||||
.xxim_online i{left:13px; width:14px; height:14px;font-size:14px;color:#FFA00A;}
|
||||
.xxim_setonline{display:none; position:absolute; left:-79px; bottom:-1px; border:1px solid #DCDCDC; background-color:#fff;}
|
||||
.xxim_setonline span{position:relative; display:block; width:32px;width: 77px; padding:0 10px 0 35px;}
|
||||
.xxim_setonline span:hover{background-color:#F2F4F8;}
|
||||
.xxim_offline .xxim_nowstate, .xxim_setoffline i{color:#999;}
|
||||
.xxim_mymsg i{left:18px; width:14px; height:14px;font-size: 14px;}
|
||||
.xxim_mymsg a{position:absolute; left:0; top:0; width:50px; height:32px;}
|
||||
.xxim_seter i{left:18px; width:14px; height:14px;font-size: 14px;}
|
||||
.xxim_hide i{left:18px; width:14px; height:14px;font-size: 14px;}
|
||||
.xxim_show i{}
|
||||
.xxim_bottom .xxim_on{position:absolute; left:-17px; top:50%; width:16px;text-align: center;color:#999;line-height: 97px; height:97px; margin-top:-49px;border:solid 1px #BEBEBE;border-right: none; background:#F2F4F8;}
|
||||
.xxim_bottom .xxim_off{}
|
||||
|
||||
/* 聊天窗口 */
|
||||
.layim_chatbox{width:620px; border:1px solid #BEBEBE; background-color:#fff; font-size:12px; box-shadow: 0 0 10px rgba(0,0,0,.2);}
|
||||
.layim_chatbox h6{position:relative; height:40px; border-bottom:1px solid #D9D9D9; background-color:#FCFDFA}
|
||||
.layim_move{position:absolute; height:40px; width: 620px; z-index:0;}
|
||||
.layim_face{position:absolute; bottom:-1px; left:10px; width:64px; height:64px;padding:1px;background: #fff; border:1px solid #ccc;}
|
||||
.layim_face img{width:60px; height:60px;}
|
||||
.layim_names{position:absolute; left:90px; max-width:300px; line-height:40px; color:#000; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; font-size:14px;}
|
||||
.layim_rightbtn{position:absolute; right:15px; top:12px; font-size:20px;}
|
||||
.layim_rightbtn i{position:relative; width:16px; height:16px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; cursor:pointer; transition: all .3s;text-align: center;line-height: 16px;}
|
||||
.layim_rightbtn .layim_close{background: #FFA00A;color:#fff;}
|
||||
.layim_rightbtn .layim_close:hover{-webkit-transform: rotate(180deg); -moz-transform: rotate(180deg);}
|
||||
.layim_rightbtn .layer_setmin{margin-right:5px;color:#999;font-size:14px;font-weight: 700;}
|
||||
.layim_chat, .layim_chatmore,.layim_groups{height:450px; overflow:hidden;}
|
||||
.layim_chatmore{display:none; float:left; width:135px; border-right:1px solid #BEBEBE; background-color:#F2F2F2}
|
||||
.layim_chatlist li, .layim_groups li{position:relative; height:30px; line-height:30px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; cursor:pointer;}
|
||||
.layim_chatlist li{padding:0 20px 0 10px;}
|
||||
.layim_chatlist li:hover{background-color:#E3E3E3;}
|
||||
.layim_chatlist li span{display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:90px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
|
||||
.layim_chatlist li em{display:none; position:absolute; top:6px; right:10px; height:18px; line-height:18px;width:18px;text-align: center;font-size:14px;font-weight:900; border-radius:3px;}
|
||||
.layim_chatlist li em:hover{background-color: #FCBE00; color:#fff;}
|
||||
.layim_chatlist .layim_chatnow,.layim_chatlist .layim_chatnow:hover{/*border-top:1px solid #D9D9D9; border-bottom:1px solid #D9D9D9;*/ background-color:#fff;}
|
||||
.layim_chat{}
|
||||
.layim_chatarea{height:280px;}
|
||||
.layim_chatview{display:none; height:280px; overflow:hidden;}
|
||||
.layim_chatmore:hover, .layim_groups:hover, .layim_chatview:hover{overflow-y:auto;}
|
||||
.layim_chatview li{margin-bottom:10px; clear:both; *zoom:1;}
|
||||
.layim_chatview li:after{content:'\20'; clear:both; *zoom:1; display:block; height:0;}
|
||||
|
||||
.layim_chatthis{display:block;}
|
||||
.layim_chatuser{float:left; padding:15px; font-size:0;}
|
||||
.layim_chatuser *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; line-height:30px; font-size:12px; padding-right:10px;}
|
||||
.layim_chatuser img{width:30px; height:30px;padding-right: 0;margin-right: 15px;}
|
||||
.layim_chatuser .layim_chatname{max-width:230px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
|
||||
.layim_chatuser .layim_chattime{color:#999; padding-left:10px;}
|
||||
.layim_chatsay{position:relative; float:left; margin:0 15px; padding:10px; line-height:20px; background-color:#F3F3F3; border-radius:3px; clear:both;}
|
||||
.layim_chatsay .layim_zero{left:5px; top:-8px; border-width:8px; border-right-style:solid; border-right-color:#F3F3F3;}
|
||||
.layim_chateme .layim_chatuser{float:right;}
|
||||
.layim_chateme .layim_chatuser *{padding-right:0; padding-left:10px;}
|
||||
.layim_chateme .layim_chatuser img{margin-left:15px;padding-left: 0;}
|
||||
.layim_chateme .layim_chatsay .layim_zero{left:auto; right:10px;}
|
||||
.layim_chateme .layim_chatuser .layim_chattime{padding-left:0; padding-right:10px;}
|
||||
.layim_chateme .layim_chatsay{float:right; background-color:#EBFBE3}
|
||||
.layim_chateme .layim_zero{border-right-color:#EBFBE3;}
|
||||
.layim_groups{display:none; float:right; width:130px; border-left:1px solid #D9D9D9; background-color:#fff;}
|
||||
.layim_groups ul{display:none;}
|
||||
.layim_groups ul.layim_groupthis{display:block;}
|
||||
.layim_groups li *{display:inline-block; *display:inline; *zoom:1; vertical-align:top; margin-right:10px;}
|
||||
.layim_groups li img{width:20px; height:20px; margin-top:5px;}
|
||||
.layim_groups li span{max-width:80px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap;}
|
||||
.layim_groups li:hover{background-color:#F3F3F3;}
|
||||
.layim_groups .layim_errors{text-align:center; color:#999;}
|
||||
.layim_tool{position:relative; height:35px; line-height:35px; padding-left:10px; background-color:#F3F3F3;}
|
||||
.layim_tool i{position:relative; top:10px; display:inline-block; *display:inline; *zoom:1; vertical-align:top; width:16px; height:16px; margin-right:10px; cursor:pointer;font-size:16px;color:#999;font-weight: 700;}
|
||||
.layim_tool i:hover{color:#FFA00A;}
|
||||
.layim_tool .layim_seechatlog{position:absolute; right:15px;}
|
||||
.layim_tool .layim_seechatlog i{}
|
||||
.layim_write{display:block; border:none; width:98%; height:90px; line-height:20px; margin:5px auto 0;}
|
||||
.layim_send{position:relative; height:40px; background-color:#F3F3F3;}
|
||||
.layim_sendbtn{position:absolute; height:26px; line-height:26px; right:10px; top:8px; padding:0 40px 0 20px; background-color:#FFA00A; color:#fff; border-radius:3px; cursor:pointer;}
|
||||
.layim_enter{position:absolute; right:0; border-left:1px solid #FFB94F; width:24px; height:26px;}
|
||||
.layim_enter:hover{background-color:#E68A00; border-radius:0 3px 3px 0;}
|
||||
.layim_enter .layim_zero{left:7px; top:11px; border-width:5px; border-top-style:solid; border-top-color:#FFE0B3;}
|
||||
.layim_sendtype{display:none; position:absolute; right:10px; bottom:37px; border:1px solid #D9D9D9; background-color:#fff; text-align:left;}
|
||||
.layim_sendtype span{display:block; line-height:24px; padding:0 10px 0 25px; cursor:pointer;}
|
||||
.layim_sendtype span:hover{background-color:#F3F3F3;}
|
||||
.layim_sendtype span i{left:5px;}
|
||||
|
||||
.layim_min{display:none; position:absolute; left:-190px; bottom:-1px; width:160px; height:32px; line-height:32px; padding:0 10px; overflow:hidden; text-overflow: ellipsis; white-space:nowrap; border:1px solid #ccc; box-shadow: 0 0 5px rgba(0,0,75,.2); background-color:#FCFDFA; cursor:pointer;}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
630
src/main/resources/static/ajax/libs/layer/layim/layim.js
Normal file
@ -0,0 +1,630 @@
|
||||
/*
|
||||
|
||||
@Name: layui WebIM 1.0.0
|
||||
@Author:贤心
|
||||
@Date: 2014-04-25
|
||||
@Blog: http://sentsin.com
|
||||
|
||||
*/
|
||||
|
||||
;!function(win, undefined){
|
||||
|
||||
var config = {
|
||||
msgurl: 'mailbox.html?msg=',
|
||||
chatlogurl: 'mailbox.html?user=',
|
||||
aniTime: 200,
|
||||
right: -232,
|
||||
api: {
|
||||
friend: 'js/plugins/layer/layim/data/friend.json', //好友列表接口
|
||||
group: 'js/plugins/layer/layim/data/group.json', //群组列表接口
|
||||
chatlog: 'js/plugins/layer/layim/data/chatlog.json', //聊天记录接口
|
||||
groups: 'js/plugins/layer/layim/data/groups.json', //群组成员接口
|
||||
sendurl: '' //发送消息接口
|
||||
},
|
||||
user: { //当前用户信息
|
||||
name: '游客',
|
||||
face: 'img/a1.jpg'
|
||||
},
|
||||
|
||||
//自动回复内置文案,也可动态读取数据库配置
|
||||
autoReplay: [
|
||||
'您好,我现在有事不在,一会再和您联系。',
|
||||
'你没发错吧?',
|
||||
'洗澡中,请勿打扰,偷窥请购票,个体四十,团体八折,订票电话:一般人我不告诉他!',
|
||||
'你好,我是主人的美女秘书,有什么事就跟我说吧,等他回来我会转告他的。',
|
||||
'我正在拉磨,没法招呼您,因为我们家毛驴去动物保护协会把我告了,说我剥夺它休产假的权利。',
|
||||
'<(@ ̄︶ ̄@)>',
|
||||
'你要和我说话?你真的要和我说话?你确定自己想说吗?你一定非说不可吗?那你说吧,这是自动回复。',
|
||||
'主人正在开机自检,键盘鼠标看好机会出去凉快去了,我是他的电冰箱,我打字比较慢,你慢慢说,别急……',
|
||||
'(*^__^*) 嘻嘻,是贤心吗?'
|
||||
],
|
||||
|
||||
|
||||
chating: {},
|
||||
hosts: (function(){
|
||||
var dk = location.href.match(/\:\d+/);
|
||||
dk = dk ? dk[0] : '';
|
||||
return 'http://' + document.domain + dk + '/';
|
||||
})(),
|
||||
json: function(url, data, callback, error){
|
||||
return $.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
success: callback,
|
||||
error: error
|
||||
});
|
||||
},
|
||||
stopMP: function(e){
|
||||
e ? e.stopPropagation() : e.cancelBubble = true;
|
||||
}
|
||||
}, dom = [$(window), $(document), $('html'), $('body')], xxim = {};
|
||||
|
||||
//主界面tab
|
||||
xxim.tabs = function(index){
|
||||
var node = xxim.node;
|
||||
node.tabs.eq(index).addClass('xxim_tabnow').siblings().removeClass('xxim_tabnow');
|
||||
node.list.eq(index).show().siblings('.xxim_list').hide();
|
||||
if(node.list.eq(index).find('li').length === 0){
|
||||
xxim.getDates(index);
|
||||
}
|
||||
};
|
||||
|
||||
//节点
|
||||
xxim.renode = function(){
|
||||
var node = xxim.node = {
|
||||
tabs: $('#xxim_tabs>span'),
|
||||
list: $('.xxim_list'),
|
||||
online: $('.xxim_online'),
|
||||
setonline: $('.xxim_setonline'),
|
||||
onlinetex: $('#xxim_onlinetex'),
|
||||
xximon: $('#xxim_on'),
|
||||
layimFooter: $('#xxim_bottom'),
|
||||
xximHide: $('#xxim_hide'),
|
||||
xximSearch: $('#xxim_searchkey'),
|
||||
searchMian: $('#xxim_searchmain'),
|
||||
closeSearch: $('#xxim_closesearch'),
|
||||
layimMin: $('#layim_min')
|
||||
};
|
||||
};
|
||||
|
||||
//主界面缩放
|
||||
xxim.expend = function(){
|
||||
var node = xxim.node;
|
||||
if(xxim.layimNode.attr('state') !== '1'){
|
||||
xxim.layimNode.stop().animate({right: config.right}, config.aniTime, function(){
|
||||
node.xximon.addClass('xxim_off');
|
||||
try{
|
||||
localStorage.layimState = 1;
|
||||
}catch(e){}
|
||||
xxim.layimNode.attr({state: 1});
|
||||
node.layimFooter.addClass('xxim_expend').stop().animate({marginLeft: config.right}, config.aniTime/2);
|
||||
node.xximHide.addClass('xxim_show');
|
||||
});
|
||||
} else {
|
||||
xxim.layimNode.stop().animate({right: 1}, config.aniTime, function(){
|
||||
node.xximon.removeClass('xxim_off');
|
||||
try{
|
||||
localStorage.layimState = 2;
|
||||
}catch(e){}
|
||||
xxim.layimNode.removeAttr('state');
|
||||
node.layimFooter.removeClass('xxim_expend');
|
||||
node.xximHide.removeClass('xxim_show');
|
||||
});
|
||||
node.layimFooter.stop().animate({marginLeft: 0}, config.aniTime);
|
||||
}
|
||||
};
|
||||
|
||||
//初始化窗口格局
|
||||
xxim.layinit = function(){
|
||||
var node = xxim.node;
|
||||
|
||||
//主界面
|
||||
try{
|
||||
/*
|
||||
if(!localStorage.layimState){
|
||||
config.aniTime = 0;
|
||||
localStorage.layimState = 1;
|
||||
}
|
||||
*/
|
||||
if(localStorage.layimState === '1'){
|
||||
xxim.layimNode.attr({state: 1}).css({right: config.right});
|
||||
node.xximon.addClass('xxim_off');
|
||||
node.layimFooter.addClass('xxim_expend').css({marginLeft: config.right});
|
||||
node.xximHide.addClass('xxim_show');
|
||||
}
|
||||
}catch(e){
|
||||
//layer.msg(e.message, 5, -1);
|
||||
}
|
||||
};
|
||||
|
||||
//聊天窗口
|
||||
xxim.popchat = function(param){
|
||||
var node = xxim.node, log = {};
|
||||
|
||||
log.success = function(layero){
|
||||
layer.setMove();
|
||||
|
||||
xxim.chatbox = layero.find('#layim_chatbox');
|
||||
log.chatlist = xxim.chatbox.find('.layim_chatmore>ul');
|
||||
|
||||
log.chatlist.html('<li data-id="'+ param.id +'" type="'+ param.type +'" id="layim_user'+ param.type + param.id +'"><span>'+ param.name +'</span><em>×</em></li>')
|
||||
xxim.tabchat(param, xxim.chatbox);
|
||||
|
||||
//最小化聊天窗
|
||||
xxim.chatbox.find('.layer_setmin').on('click', function(){
|
||||
var indexs = layero.attr('times');
|
||||
layero.hide();
|
||||
node.layimMin.text(xxim.nowchat.name).show();
|
||||
});
|
||||
|
||||
//关闭窗口
|
||||
xxim.chatbox.find('.layim_close').on('click', function(){
|
||||
var indexs = layero.attr('times');
|
||||
layer.close(indexs);
|
||||
xxim.chatbox = null;
|
||||
config.chating = {};
|
||||
config.chatings = 0;
|
||||
});
|
||||
|
||||
//关闭某个聊天
|
||||
log.chatlist.on('mouseenter', 'li', function(){
|
||||
$(this).find('em').show();
|
||||
}).on('mouseleave', 'li', function(){
|
||||
$(this).find('em').hide();
|
||||
});
|
||||
log.chatlist.on('click', 'li em', function(e){
|
||||
var parents = $(this).parent(), dataType = parents.attr('type');
|
||||
var dataId = parents.attr('data-id'), index = parents.index();
|
||||
var chatlist = log.chatlist.find('li'), indexs;
|
||||
|
||||
config.stopMP(e);
|
||||
|
||||
delete config.chating[dataType + dataId];
|
||||
config.chatings--;
|
||||
|
||||
parents.remove();
|
||||
$('#layim_area'+ dataType + dataId).remove();
|
||||
if(dataType === 'group'){
|
||||
$('#layim_group'+ dataType + dataId).remove();
|
||||
}
|
||||
|
||||
if(parents.hasClass('layim_chatnow')){
|
||||
if(index === config.chatings){
|
||||
indexs = index - 1;
|
||||
} else {
|
||||
indexs = index + 1;
|
||||
}
|
||||
xxim.tabchat(config.chating[chatlist.eq(indexs).attr('type') + chatlist.eq(indexs).attr('data-id')]);
|
||||
}
|
||||
|
||||
if(log.chatlist.find('li').length === 1){
|
||||
log.chatlist.parent().hide();
|
||||
}
|
||||
});
|
||||
|
||||
//聊天选项卡
|
||||
log.chatlist.on('click', 'li', function(){
|
||||
var othis = $(this), dataType = othis.attr('type'), dataId = othis.attr('data-id');
|
||||
xxim.tabchat(config.chating[dataType + dataId]);
|
||||
});
|
||||
|
||||
//发送热键切换
|
||||
log.sendType = $('#layim_sendtype'), log.sendTypes = log.sendType.find('span');
|
||||
$('#layim_enter').on('click', function(e){
|
||||
config.stopMP(e);
|
||||
log.sendType.show();
|
||||
});
|
||||
log.sendTypes.on('click', function(){
|
||||
log.sendTypes.find('i').text('')
|
||||
$(this).find('i').text('√');
|
||||
});
|
||||
|
||||
xxim.transmit();
|
||||
};
|
||||
|
||||
log.html = '<div class="layim_chatbox" id="layim_chatbox">'
|
||||
+'<h6>'
|
||||
+'<span class="layim_move"></span>'
|
||||
+' <a href="'+ param.url +'" class="layim_face" target="_blank"><img src="'+ param.face +'" ></a>'
|
||||
+' <a href="'+ param.url +'" class="layim_names" target="_blank">'+ param.name +'</a>'
|
||||
+' <span class="layim_rightbtn">'
|
||||
+' <i class="layer_setmin">—</i>'
|
||||
+' <i class="layim_close">×</i>'
|
||||
+' </span>'
|
||||
+'</h6>'
|
||||
+'<div class="layim_chatmore" id="layim_chatmore">'
|
||||
+' <ul class="layim_chatlist"></ul>'
|
||||
+'</div>'
|
||||
+'<div class="layim_groups" id="layim_groups"></div>'
|
||||
+'<div class="layim_chat">'
|
||||
+' <div class="layim_chatarea" id="layim_chatarea">'
|
||||
+' <ul class="layim_chatview layim_chatthis" id="layim_area'+ param.type + param.id +'"></ul>'
|
||||
+' </div>'
|
||||
+' <div class="layim_tool">'
|
||||
+' <i class="layim_addface fa fa-meh-o" title="发送表情"></i>'
|
||||
+' <a href="javascript:;"><i class="layim_addimage fa fa-picture-o" title="上传图片"></i></a>'
|
||||
+' <a href="javascript:;"><i class="layim_addfile fa fa-paperclip" title="上传附件"></i></a>'
|
||||
+' <a href="" target="_blank" class="layim_seechatlog"><i class="fa fa-comment-o"></i>聊天记录</a>'
|
||||
+' </div>'
|
||||
+' <textarea class="layim_write" id="layim_write"></textarea>'
|
||||
+' <div class="layim_send">'
|
||||
+' <div class="layim_sendbtn" id="layim_sendbtn">发送<span class="layim_enter" id="layim_enter"><em class="layim_zero"></em></span></div>'
|
||||
+' <div class="layim_sendtype" id="layim_sendtype">'
|
||||
+' <span><i>√</i>按Enter键发送</span>'
|
||||
+' <span><i></i>按Ctrl+Enter键发送</span>'
|
||||
+' </div>'
|
||||
+' </div>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
|
||||
if(config.chatings < 1){
|
||||
$.layer({
|
||||
type: 1,
|
||||
border: [0],
|
||||
title: false,
|
||||
shade: [0],
|
||||
area: ['620px', '493px'],
|
||||
move: '.layim_chatbox .layim_move',
|
||||
moveType: 1,
|
||||
closeBtn: false,
|
||||
offset: [(($(window).height() - 493)/2)+'px', ''],
|
||||
page: {
|
||||
html: log.html
|
||||
}, success: function(layero){
|
||||
log.success(layero);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
log.chatmore = xxim.chatbox.find('#layim_chatmore');
|
||||
log.chatarea = xxim.chatbox.find('#layim_chatarea');
|
||||
|
||||
log.chatmore.show();
|
||||
|
||||
log.chatmore.find('ul>li').removeClass('layim_chatnow');
|
||||
log.chatmore.find('ul').append('<li data-id="'+ param.id +'" type="'+ param.type +'" id="layim_user'+ param.type + param.id +'" class="layim_chatnow"><span>'+ param.name +'</span><em>×</em></li>');
|
||||
|
||||
log.chatarea.find('.layim_chatview').removeClass('layim_chatthis');
|
||||
log.chatarea.append('<ul class="layim_chatview layim_chatthis" id="layim_area'+ param.type + param.id +'"></ul>');
|
||||
|
||||
xxim.tabchat(param);
|
||||
}
|
||||
|
||||
//群组
|
||||
log.chatgroup = xxim.chatbox.find('#layim_groups');
|
||||
if(param.type === 'group'){
|
||||
log.chatgroup.find('ul').removeClass('layim_groupthis');
|
||||
log.chatgroup.append('<ul class="layim_groupthis" id="layim_group'+ param.type + param.id +'"></ul>');
|
||||
xxim.getGroups(param);
|
||||
}
|
||||
//点击群员切换聊天窗
|
||||
log.chatgroup.on('click', 'ul>li', function(){
|
||||
xxim.popchatbox($(this));
|
||||
});
|
||||
};
|
||||
|
||||
//定位到某个聊天队列
|
||||
xxim.tabchat = function(param){
|
||||
var node = xxim.node, log = {}, keys = param.type + param.id;
|
||||
xxim.nowchat = param;
|
||||
|
||||
xxim.chatbox.find('#layim_user'+ keys).addClass('layim_chatnow').siblings().removeClass('layim_chatnow');
|
||||
xxim.chatbox.find('#layim_area'+ keys).addClass('layim_chatthis').siblings().removeClass('layim_chatthis');
|
||||
xxim.chatbox.find('#layim_group'+ keys).addClass('layim_groupthis').siblings().removeClass('layim_groupthis');
|
||||
|
||||
xxim.chatbox.find('.layim_face>img').attr('src', param.face);
|
||||
xxim.chatbox.find('.layim_face, .layim_names').attr('href', param.href);
|
||||
xxim.chatbox.find('.layim_names').text(param.name);
|
||||
|
||||
xxim.chatbox.find('.layim_seechatlog').attr('href', config.chatlogurl + param.id);
|
||||
|
||||
log.groups = xxim.chatbox.find('.layim_groups');
|
||||
if(param.type === 'group'){
|
||||
log.groups.show();
|
||||
} else {
|
||||
log.groups.hide();
|
||||
}
|
||||
|
||||
$('#layim_write').focus();
|
||||
|
||||
};
|
||||
|
||||
//弹出聊天窗
|
||||
xxim.popchatbox = function(othis){
|
||||
var node = xxim.node, dataId = othis.attr('data-id'), param = {
|
||||
id: dataId, //用户ID
|
||||
type: othis.attr('type'),
|
||||
name: othis.find('.xxim_onename').text(), //用户名
|
||||
face: othis.find('.xxim_oneface').attr('src'), //用户头像
|
||||
href: 'profile.html?user=' + dataId //用户主页
|
||||
}, key = param.type + dataId;
|
||||
if(!config.chating[key]){
|
||||
xxim.popchat(param);
|
||||
config.chatings++;
|
||||
} else {
|
||||
xxim.tabchat(param);
|
||||
}
|
||||
config.chating[key] = param;
|
||||
|
||||
var chatbox = $('#layim_chatbox');
|
||||
if(chatbox[0]){
|
||||
node.layimMin.hide();
|
||||
chatbox.parents('.xubox_layer').show();
|
||||
}
|
||||
};
|
||||
|
||||
//请求群员
|
||||
xxim.getGroups = function(param){
|
||||
var keys = param.type + param.id, str = '',
|
||||
groupss = xxim.chatbox.find('#layim_group'+ keys);
|
||||
groupss.addClass('loading');
|
||||
config.json(config.api.groups, {}, function(datas){
|
||||
if(datas.status === 1){
|
||||
var ii = 0, lens = datas.data.length;
|
||||
if(lens > 0){
|
||||
for(; ii < lens; ii++){
|
||||
str += '<li data-id="'+ datas.data[ii].id +'" type="one"><img src="'+ datas.data[ii].face +'" class="xxim_oneface"><span class="xxim_onename">'+ datas.data[ii].name +'</span></li>';
|
||||
}
|
||||
} else {
|
||||
str = '<li class="layim_errors">没有群员</li>';
|
||||
}
|
||||
|
||||
} else {
|
||||
str = '<li class="layim_errors">'+ datas.msg +'</li>';
|
||||
}
|
||||
groupss.removeClass('loading');
|
||||
groupss.html(str);
|
||||
}, function(){
|
||||
groupss.removeClass('loading');
|
||||
groupss.html('<li class="layim_errors">请求异常</li>');
|
||||
});
|
||||
};
|
||||
|
||||
//消息传输
|
||||
xxim.transmit = function(){
|
||||
var node = xxim.node, log = {};
|
||||
node.sendbtn = $('#layim_sendbtn');
|
||||
node.imwrite = $('#layim_write');
|
||||
|
||||
//发送
|
||||
log.send = function(){
|
||||
var data = {
|
||||
content: node.imwrite.val(),
|
||||
id: xxim.nowchat.id,
|
||||
sign_key: '', //密匙
|
||||
_: +new Date
|
||||
};
|
||||
|
||||
if(data.content.replace(/\s/g, '') === ''){
|
||||
layer.tips('说点啥呗!', '#layim_write', 2);
|
||||
node.imwrite.focus();
|
||||
} else {
|
||||
//此处皆为模拟
|
||||
var keys = xxim.nowchat.type + xxim.nowchat.id;
|
||||
|
||||
//聊天模版
|
||||
log.html = function(param, type){
|
||||
return '<li class="'+ (type === 'me' ? 'layim_chateme' : '') +'">'
|
||||
+'<div class="layim_chatuser">'
|
||||
+ function(){
|
||||
if(type === 'me'){
|
||||
return '<span class="layim_chattime">'+ param.time +'</span>'
|
||||
+'<span class="layim_chatname">'+ param.name +'</span>'
|
||||
+'<img src="'+ param.face +'" >';
|
||||
} else {
|
||||
return '<img src="'+ param.face +'" >'
|
||||
+'<span class="layim_chatname">'+ param.name +'</span>'
|
||||
+'<span class="layim_chattime">'+ param.time +'</span>';
|
||||
}
|
||||
}()
|
||||
+'</div>'
|
||||
+'<div class="layim_chatsay">'+ param.content +'<em class="layim_zero"></em></div>'
|
||||
+'</li>';
|
||||
};
|
||||
|
||||
log.imarea = xxim.chatbox.find('#layim_area'+ keys);
|
||||
|
||||
log.imarea.append(log.html({
|
||||
time: '2014-04-26 0:37',
|
||||
name: config.user.name,
|
||||
face: config.user.face,
|
||||
content: data.content
|
||||
}, 'me'));
|
||||
node.imwrite.val('').focus();
|
||||
log.imarea.scrollTop(log.imarea[0].scrollHeight);
|
||||
|
||||
setTimeout(function(){
|
||||
log.imarea.append(log.html({
|
||||
time: '2014-04-26 0:38',
|
||||
name: xxim.nowchat.name,
|
||||
face: xxim.nowchat.face,
|
||||
content: config.autoReplay[(Math.random()*config.autoReplay.length) | 0]
|
||||
}));
|
||||
log.imarea.scrollTop(log.imarea[0].scrollHeight);
|
||||
}, 500);
|
||||
|
||||
/*
|
||||
that.json(config.api.sendurl, data, function(datas){
|
||||
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
};
|
||||
node.sendbtn.on('click', log.send);
|
||||
|
||||
node.imwrite.keyup(function(e){
|
||||
if(e.keyCode === 13){
|
||||
log.send();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//事件
|
||||
xxim.event = function(){
|
||||
var node = xxim.node;
|
||||
|
||||
//主界面tab
|
||||
node.tabs.eq(0).addClass('xxim_tabnow');
|
||||
node.tabs.on('click', function(){
|
||||
var othis = $(this), index = othis.index();
|
||||
xxim.tabs(index);
|
||||
});
|
||||
|
||||
//列表展收
|
||||
node.list.on('click', 'h5', function(){
|
||||
var othis = $(this), chat = othis.siblings('.xxim_chatlist'), parentss = othis.find("i");
|
||||
if(parentss.hasClass('fa-caret-down')){
|
||||
chat.hide();
|
||||
parentss.attr('class','fa fa-caret-right');
|
||||
} else {
|
||||
chat.show();
|
||||
parentss.attr('class','fa fa-caret-down');
|
||||
}
|
||||
});
|
||||
|
||||
//设置在线隐身
|
||||
node.online.on('click', function(e){
|
||||
config.stopMP(e);
|
||||
node.setonline.show();
|
||||
});
|
||||
node.setonline.find('span').on('click', function(e){
|
||||
var index = $(this).index();
|
||||
config.stopMP(e);
|
||||
if(index === 0){
|
||||
node.onlinetex.html('在线');
|
||||
node.online.removeClass('xxim_offline');
|
||||
} else if(index === 1) {
|
||||
node.onlinetex.html('隐身');
|
||||
node.online.addClass('xxim_offline');
|
||||
}
|
||||
node.setonline.hide();
|
||||
});
|
||||
|
||||
node.xximon.on('click', xxim.expend);
|
||||
node.xximHide.on('click', xxim.expend);
|
||||
|
||||
//搜索
|
||||
node.xximSearch.keyup(function(){
|
||||
var val = $(this).val().replace(/\s/g, '');
|
||||
if(val !== ''){
|
||||
node.searchMian.show();
|
||||
node.closeSearch.show();
|
||||
//此处的搜索ajax参考xxim.getDates
|
||||
node.list.eq(3).html('<li class="xxim_errormsg">没有符合条件的结果</li>');
|
||||
} else {
|
||||
node.searchMian.hide();
|
||||
node.closeSearch.hide();
|
||||
}
|
||||
});
|
||||
node.closeSearch.on('click', function(){
|
||||
$(this).hide();
|
||||
node.searchMian.hide();
|
||||
node.xximSearch.val('').focus();
|
||||
});
|
||||
|
||||
//弹出聊天窗
|
||||
config.chatings = 0;
|
||||
node.list.on('click', '.xxim_childnode', function(){
|
||||
var othis = $(this);
|
||||
xxim.popchatbox(othis);
|
||||
});
|
||||
|
||||
//点击最小化栏
|
||||
node.layimMin.on('click', function(){
|
||||
$(this).hide();
|
||||
$('#layim_chatbox').parents('.xubox_layer').show();
|
||||
});
|
||||
|
||||
|
||||
//document事件
|
||||
dom[1].on('click', function(){
|
||||
node.setonline.hide();
|
||||
$('#layim_sendtype').hide();
|
||||
});
|
||||
};
|
||||
|
||||
//请求列表数据
|
||||
xxim.getDates = function(index){
|
||||
var api = [config.api.friend, config.api.group, config.api.chatlog],
|
||||
node = xxim.node, myf = node.list.eq(index);
|
||||
myf.addClass('loading');
|
||||
config.json(api[index], {}, function(datas){
|
||||
if(datas.status === 1){
|
||||
var i = 0, myflen = datas.data.length, str = '', item;
|
||||
if(myflen > 1){
|
||||
if(index !== 2){
|
||||
for(; i < myflen; i++){
|
||||
str += '<li data-id="'+ datas.data[i].id +'" class="xxim_parentnode">'
|
||||
+'<h5><i class="fa fa-caret-right"></i><span class="xxim_parentname">'+ datas.data[i].name +'</span><em class="xxim_nums">('+ datas.data[i].nums +')</em></h5>'
|
||||
+'<ul class="xxim_chatlist">';
|
||||
item = datas.data[i].item;
|
||||
for(var j = 0; j < item.length; j++){
|
||||
str += '<li data-id="'+ item[j].id +'" class="xxim_childnode" type="'+ (index === 0 ? 'one' : 'group') +'"><img src="'+ item[j].face +'" class="xxim_oneface"><span class="xxim_onename">'+ item[j].name +'</span></li>';
|
||||
}
|
||||
str += '</ul></li>';
|
||||
}
|
||||
} else {
|
||||
str += '<li class="xxim_liston">'
|
||||
+'<ul class="xxim_chatlist">';
|
||||
for(; i < myflen; i++){
|
||||
str += '<li data-id="'+ datas.data[i].id +'" class="xxim_childnode" type="one"><img src="'+ datas.data[i].face +'" class="xxim_oneface"><span class="xxim_onename">'+ datas.data[i].name +'</span><em class="xxim_time">'+ datas.data[i].time +'</em></li>';
|
||||
}
|
||||
str += '</ul></li>';
|
||||
}
|
||||
myf.html(str);
|
||||
} else {
|
||||
myf.html('<li class="xxim_errormsg">没有任何数据</li>');
|
||||
}
|
||||
myf.removeClass('loading');
|
||||
} else {
|
||||
myf.html('<li class="xxim_errormsg">'+ datas.msg +'</li>');
|
||||
}
|
||||
}, function(){
|
||||
myf.html('<li class="xxim_errormsg">请求失败</li>');
|
||||
myf.removeClass('loading');
|
||||
});
|
||||
};
|
||||
|
||||
//渲染骨架
|
||||
xxim.view = (function(){
|
||||
var xximNode = xxim.layimNode = $('<div id="xximmm" class="xxim_main">'
|
||||
+'<div class="xxim_top" id="xxim_top">'
|
||||
+' <div class="xxim_search"><i class="fa fa-search"></i><input id="xxim_searchkey" /><span id="xxim_closesearch">×</span></div>'
|
||||
+' <div class="xxim_tabs" id="xxim_tabs"><span class="xxim_tabfriend" title="好友"><i class="fa fa-user"></i></span><span class="xxim_tabgroup" title="群组"><i class="fa fa-users"></i></span><span class="xxim_latechat" title="最近聊天"><i class="fa fa-clock-o"></i></span></div>'
|
||||
+' <ul class="xxim_list" style="display:block"></ul>'
|
||||
+' <ul class="xxim_list"></ul>'
|
||||
+' <ul class="xxim_list"></ul>'
|
||||
+' <ul class="xxim_list xxim_searchmain" id="xxim_searchmain"></ul>'
|
||||
+'</div>'
|
||||
+'<ul class="xxim_bottom" id="xxim_bottom">'
|
||||
+'<li class="xxim_online" id="xxim_online">'
|
||||
+'<i class="xxim_nowstate fa fa-check-circle"></i><span id="xxim_onlinetex">在线</span>'
|
||||
+'<div class="xxim_setonline">'
|
||||
+'<span><i class="fa fa-check-circle"></i>在线</span>'
|
||||
+'<span class="xxim_setoffline"><i class="fa fa-check-circle"></i>隐身</span>'
|
||||
+'</div>'
|
||||
+'</li>'
|
||||
+'<li class="xxim_mymsg" id="xxim_mymsg" title="我的私信"><i class="fa fa-comment"></i><a href="'+ config.msgurl +'" target="_blank"></a></li>'
|
||||
+'<li class="xxim_seter" id="xxim_seter" title="设置">'
|
||||
+'<i class="fa fa-gear"></i>'
|
||||
+'<div>'
|
||||
|
||||
+'</div>'
|
||||
+'</li>'
|
||||
+'<li class="xxim_hide" id="xxim_hide"><i class="fa fa-exchange"></i></li>'
|
||||
+'<li id="xxim_on" class="xxim_icon xxim_on fa fa-ellipsis-v"></li>'
|
||||
+'<div class="layim_min" id="layim_min"></div>'
|
||||
+'</ul>'
|
||||
+'</div>');
|
||||
dom[3].append(xximNode);
|
||||
|
||||
xxim.renode();
|
||||
xxim.getDates(0);
|
||||
xxim.event();
|
||||
xxim.layinit();
|
||||
}());
|
||||
|
||||
}(window);
|
||||
|
BIN
src/main/resources/static/ajax/libs/layer/layim/loading.gif
Normal file
After Width: | Height: | Size: 166 B |
@ -0,0 +1,2 @@
|
||||
/*! layer mobile-v2.0.0 Web弹层组件 MIT License http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(e){"use strict";var t=document,n="querySelectorAll",i="getElementsByClassName",a=function(e){return t[n](e)},s={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},l={extend:function(e){var t=JSON.parse(JSON.stringify(s));for(var n in e)t[n]=e[n];return t},timer:{},end:{}};l.touch=function(e,t){e.addEventListener("click",function(e){t.call(this,e)},!1)};var r=0,o=["layui-m-layer"],c=function(e){var t=this;t.config=l.extend(e),t.view()};c.prototype.view=function(){var e=this,n=e.config,s=t.createElement("div");e.id=s.id=o[0]+r,s.setAttribute("class",o[0]+" "+o[0]+(n.type||0)),s.setAttribute("index",r);var l=function(){var e="object"==typeof n.title;return n.title?'<h3 style="'+(e?n.title[1]:"")+'">'+(e?n.title[0]:n.title)+"</h3>":""}(),c=function(){"string"==typeof n.btn&&(n.btn=[n.btn]);var e,t=(n.btn||[]).length;return 0!==t&&n.btn?(e='<span yes type="1">'+n.btn[0]+"</span>",2===t&&(e='<span no type="0">'+n.btn[1]+"</span>"+e),'<div class="layui-m-layerbtn">'+e+"</div>"):""}();if(n.fixed||(n.top=n.hasOwnProperty("top")?n.top:100,n.style=n.style||"",n.style+=" top:"+(t.body.scrollTop+n.top)+"px"),2===n.type&&(n.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(n.content||"")+"</p>"),n.skin&&(n.anim="up"),"msg"===n.skin&&(n.shade=!1),s.innerHTML=(n.shade?"<div "+("string"==typeof n.shade?'style="'+n.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(n.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(n.skin?"layui-m-layer-"+n.skin+" ":"")+(n.className?n.className:"")+" "+(n.anim?"layui-m-anim-"+n.anim:"")+'" '+(n.style?'style="'+n.style+'"':"")+">"+l+'<div class="layui-m-layercont">'+n.content+"</div>"+c+"</div></div></div>",!n.type||2===n.type){var d=t[i](o[0]+n.type),y=d.length;y>=1&&layer.close(d[0].getAttribute("index"))}document.body.appendChild(s);var u=e.elem=a("#"+e.id)[0];n.success&&n.success(u),e.index=r++,e.action(n,u)},c.prototype.action=function(e,t){var n=this;e.time&&(l.timer[n.index]=setTimeout(function(){layer.close(n.index)},1e3*e.time));var a=function(){var t=this.getAttribute("type");0==t?(e.no&&e.no(),layer.close(n.index)):e.yes?e.yes(n.index):layer.close(n.index)};if(e.btn)for(var s=t[i]("layui-m-layerbtn")[0].children,r=s.length,o=0;o<r;o++)l.touch(s[o],a);if(e.shade&&e.shadeClose){var c=t[i]("layui-m-layershade")[0];l.touch(c,function(){layer.close(n.index,e.end)})}e.end&&(l.end[n.index]=e.end)},e.layer={v:"2.0",index:r,open:function(e){var t=new c(e||{});return t.index},close:function(e){var n=a("#"+o[0]+e)[0];n&&(n.innerHTML="",t.body.removeChild(n),clearTimeout(l.timer[e]),delete l.timer[e],"function"==typeof l.end[e]&&l.end[e](),delete l.end[e])},closeAll:function(){for(var e=t[i](o[0]),n=0,a=e.length;n<a;n++)layer.close(0|e[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var e=document.scripts,n=e[e.length-1],i=n.src,a=i.substring(0,i.lastIndexOf("/")+1);n.getAttribute("merge")||document.head.appendChild(function(){var e=t.createElement("link");return e.href=a+"need/layer.css?2.0",e.type="text/css",e.rel="styleSheet",e.id="layermcss",e}())}()}(window);
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/main/resources/static/ajax/libs/layer/skin/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 701 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 210 B |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 701 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 221 B |
7
src/main/resources/static/ajax/libs/layer/skin/layer.css
Normal file
@ -0,0 +1,8 @@
|
||||
/*!
|
||||
|
||||
@Name: layer拓展样式
|
||||
@Date: 2012.12.13
|
||||
@Author: 贤心
|
||||
@blog: sentsin.com
|
||||
|
||||
*/.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span{text-overflow:ellipsis;white-space:nowrap}.layui-layer-iconext{background:url(default/icon-ext.png) no-repeat}html #layui_layer_skinlayerextcss{display:none;position:absolute;width:1989px}.layui-layer-prompt .layui-layer-input{display:block;width:220px;height:30px;margin:0 auto;line-height:30px;padding:0 5px;border:1px solid #ccc;box-shadow:1px 1px 5px rgba(0,0,0,.1) inset;color:#333}.layui-layer-prompt textarea.layui-layer-input{width:300px;height:100px;line-height:20px}.layui-layer-tab{box-shadow:1px 1px 50px rgba(0,0,0,.4)}.layui-layer-tab .layui-layer-title{padding-left:0;border-bottom:1px solid #ccc;background-color:#eee;overflow:visible}.layui-layer-tab .layui-layer-title span{position:relative;float:left;min-width:80px;max-width:260px;padding:0 20px;text-align:center;cursor:default;overflow:hidden}.layui-layer-tab .layui-layer-title span.layui-layer-tabnow{height:43px;border-left:1px solid #ccc;border-right:1px solid #ccc;background-color:#fff;z-index:10}.layui-layer-tab .layui-layer-title span:first-child{border-left:none}.layui-layer-tabmain{line-height:24px;clear:both}.layui-layer-tabmain .layui-layer-tabli{display:none}.layui-layer-tabmain .layui-layer-tabli.xubox_tab_layer{display:block}.xubox_tabclose{position:absolute;right:10px;top:5px;cursor:pointer}.layui-layer-photos{-webkit-animation-duration:1s;animation-duration:1s;background:url(default/xubox_loading1.gif) center center no-repeat #000}.layui-layer-photos .layui-layer-content{overflow:hidden;text-align:center}.layui-layer-photos .layui-layer-phimg img{position:relative;width:100%;display:inline-block;*display:inline;*zoom:1;vertical-align:top}.layui-layer-imgbar,.layui-layer-imguide{display:none}.layui-layer-imgnext,.layui-layer-imgprev{position:absolute;top:50%;width:27px;_width:44px;height:44px;margin-top:-22px;outline:0;blr:expression(this.onFocus=this.blur())}.layui-layer-imgprev{left:10px;background-position:-5px -5px;_background-position:-70px -5px}.layui-layer-imgprev:hover{background-position:-33px -5px;_background-position:-120px -5px}.layui-layer-imgnext{right:10px;_right:8px;background-position:-5px -50px;_background-position:-70px -50px}.layui-layer-imgnext:hover{background-position:-33px -50px;_background-position:-120px -50px}.layui-layer-imgbar{position:absolute;left:0;bottom:0;width:100%;height:32px;line-height:32px;background-color:rgba(0,0,0,.8);background-color:#000\9;filter:Alpha(opacity=80);color:#fff;overflow:hidden;font-size:0}.layui-layer-imgtit *{display:inline-block;*display:inline;*zoom:1;vertical-align:top;font-size:12px}.layui-layer-imgtit a{max-width:65%;overflow:hidden;color:#fff}.layui-layer-imgtit a:hover{color:#fff;text-decoration:underline}.layui-layer-imgtit em{padding-left:10px;font-style:normal}
|
BIN
src/main/resources/static/ajax/libs/layer/skin/moon/default.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
141
src/main/resources/static/ajax/libs/layer/skin/moon/style.css
Normal file
@ -0,0 +1,141 @@
|
||||
/*
|
||||
* layer皮肤
|
||||
* 作者:一☆隐☆一
|
||||
* QQ:9073194
|
||||
* 请保留这里的信息 谢谢!虽然你不保留我也不能把你怎么样!
|
||||
*/
|
||||
|
||||
html #layui_layer_skinmoonstylecss {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 1989px;
|
||||
}
|
||||
body .layer-ext-moon[type="dialog"] {
|
||||
min-width: 320px;
|
||||
}
|
||||
body .layer-ext-moon-msg[type="dialog"]{min-width:200px;}
|
||||
body .layer-ext-moon .layui-layer-title {
|
||||
background: #f6f6f6;
|
||||
color: #212a31;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
height: 46px;
|
||||
line-height: 46px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
body .layer-ext-moon .layui-layer-content .layui-layer-ico {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
top:18.5px;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico0 {
|
||||
background: url(default.png) no-repeat -96px 0;
|
||||
;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico1 {
|
||||
background: url(default.png) no-repeat -224px 0;
|
||||
;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico2 {
|
||||
background: url(default.png) no-repeat -192px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico3 {
|
||||
background: url(default.png) no-repeat -160px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico4 {
|
||||
background: url(default.png) no-repeat -320px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico5 {
|
||||
background: url(default.png) no-repeat -288px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico6 {
|
||||
background: url(default.png) -256px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-ico7 {
|
||||
background: url(default.png) no-repeat -128px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin {
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin a {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-min cite:hover {
|
||||
background-color: #56abe4;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-max {
|
||||
background: url(default.png) no-repeat -80px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-max:hover {
|
||||
background: url(default.png) no-repeat -64px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin {
|
||||
background: url(default.png) no-repeat -32px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-maxmin:hover {
|
||||
background: url(default.png) no-repeat -16px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2 {
|
||||
background: url(default.png) 0 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-setwin .layui-layer-close1:hover,body .layer-ext-moon .layui-layer-setwin .layui-layer-close2:hover {
|
||||
background: url(default.png) -48px 0;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-padding{padding-top: 24px;}
|
||||
body .layer-ext-moon .layui-layer-btn {
|
||||
padding: 15px 0;
|
||||
background: #f0f4f7;
|
||||
border-top: 1px #c7c7c7 solid;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-btn a {
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
margin: 0 3px;
|
||||
margin-right: 7px;
|
||||
margin-left: 7px;
|
||||
padding: 6px 20px;
|
||||
color: #fff;
|
||||
border: 1px solid #0064b6;
|
||||
background: #0071ce;
|
||||
border-radius: 3px;
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
background-repeat: no-repeat;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn0 {
|
||||
background: #0071ce;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn1 {
|
||||
background: #fff;
|
||||
color: #404a58;
|
||||
border: 1px solid #c0c4cd;
|
||||
border-radius: 3px;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn2 {
|
||||
background: #f60;
|
||||
color: #fff;
|
||||
border: 1px solid #f60;
|
||||
border-radius: 3px;
|
||||
}
|
||||
body .layer-ext-moon .layui-layer-btn .layui-layer-btn3 {
|
||||
background: #f00;
|
||||
color: #fff;
|
||||
border: 1px solid #f00;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
body .layer-ext-moon .layui-layer-title span.layui-layer-tabnow{
|
||||
height:46px;
|
||||
}
|
After Width: | Height: | Size: 5.8 KiB |
BIN
src/main/resources/static/ajax/libs/layer/theme/default/icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 701 B |
After Width: | Height: | Size: 1.7 KiB |