增加后台功能
@@ -0,0 +1,230 @@
|
||||
/*!
|
||||
* Bootstrap Colorpicker v2.5.1
|
||||
* https://itsjavi.com/bootstrap-colorpicker/
|
||||
*
|
||||
* Originally written by (c) 2012 Stefan Petre
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
*
|
||||
*/
|
||||
.colorpicker-saturation {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-image: url("../img/bootstrap-colorpicker/saturation.png");
|
||||
cursor: crosshair;
|
||||
float: left;
|
||||
}
|
||||
.colorpicker-saturation i {
|
||||
display: block;
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
border: 1px solid #000;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: -4px 0 0 -4px;
|
||||
}
|
||||
.colorpicker-saturation i b {
|
||||
display: block;
|
||||
height: 5px;
|
||||
width: 5px;
|
||||
border: 1px solid #fff;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.colorpicker-hue,
|
||||
.colorpicker-alpha {
|
||||
width: 15px;
|
||||
height: 100px;
|
||||
float: left;
|
||||
cursor: row-resize;
|
||||
margin-left: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.colorpicker-hue i,
|
||||
.colorpicker-alpha i {
|
||||
display: block;
|
||||
height: 1px;
|
||||
background: #000;
|
||||
border-top: 1px solid #fff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
margin-top: -1px;
|
||||
}
|
||||
.colorpicker-hue {
|
||||
background-image: url("../img/bootstrap-colorpicker/hue.png");
|
||||
}
|
||||
.colorpicker-alpha {
|
||||
background-image: url("../img/bootstrap-colorpicker/alpha.png");
|
||||
display: none;
|
||||
}
|
||||
.colorpicker-saturation,
|
||||
.colorpicker-hue,
|
||||
.colorpicker-alpha {
|
||||
background-size: contain;
|
||||
}
|
||||
.colorpicker {
|
||||
padding: 4px;
|
||||
min-width: 130px;
|
||||
margin-top: 1px;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
z-index: 2500;
|
||||
}
|
||||
.colorpicker:before,
|
||||
.colorpicker:after {
|
||||
display: table;
|
||||
content: "";
|
||||
line-height: 0;
|
||||
}
|
||||
.colorpicker:after {
|
||||
clear: both;
|
||||
}
|
||||
.colorpicker:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 7px solid transparent;
|
||||
border-right: 7px solid transparent;
|
||||
border-bottom: 7px solid #ccc;
|
||||
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||
position: absolute;
|
||||
top: -7px;
|
||||
left: 6px;
|
||||
}
|
||||
.colorpicker:after {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #ffffff;
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 7px;
|
||||
}
|
||||
.colorpicker div {
|
||||
position: relative;
|
||||
}
|
||||
.colorpicker.colorpicker-with-alpha {
|
||||
min-width: 140px;
|
||||
}
|
||||
.colorpicker.colorpicker-with-alpha .colorpicker-alpha {
|
||||
display: block;
|
||||
}
|
||||
.colorpicker-color {
|
||||
height: 10px;
|
||||
margin-top: 5px;
|
||||
clear: both;
|
||||
background-image: url("../img/bootstrap-colorpicker/alpha.png");
|
||||
background-position: 0 100%;
|
||||
}
|
||||
.colorpicker-color div {
|
||||
height: 10px;
|
||||
}
|
||||
.colorpicker-selectors {
|
||||
display: none;
|
||||
height: 10px;
|
||||
margin-top: 5px;
|
||||
clear: both;
|
||||
}
|
||||
.colorpicker-selectors i {
|
||||
cursor: pointer;
|
||||
float: left;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
}
|
||||
.colorpicker-selectors i + i {
|
||||
margin-left: 3px;
|
||||
}
|
||||
.colorpicker-element .input-group-addon i,
|
||||
.colorpicker-element .add-on i {
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
height: 16px;
|
||||
vertical-align: text-top;
|
||||
width: 16px;
|
||||
}
|
||||
.colorpicker.colorpicker-inline {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
float: none;
|
||||
z-index: auto;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal {
|
||||
width: 110px;
|
||||
min-width: 110px;
|
||||
height: auto;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-saturation {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-color {
|
||||
width: 100px;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue,
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
|
||||
width: 100px;
|
||||
height: 15px;
|
||||
float: left;
|
||||
cursor: col-resize;
|
||||
margin-left: 0px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue i,
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha i {
|
||||
display: block;
|
||||
height: 15px;
|
||||
background: #ffffff;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 1px;
|
||||
border: none;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-hue {
|
||||
background-image: url("../img/bootstrap-colorpicker/hue-horizontal.png");
|
||||
}
|
||||
.colorpicker.colorpicker-horizontal .colorpicker-alpha {
|
||||
background-image: url("../img/bootstrap-colorpicker/alpha-horizontal.png");
|
||||
}
|
||||
.colorpicker-right:before {
|
||||
left: auto;
|
||||
right: 6px;
|
||||
}
|
||||
.colorpicker-right:after {
|
||||
left: auto;
|
||||
right: 7px;
|
||||
}
|
||||
.colorpicker-no-arrow:before {
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
.colorpicker-no-arrow:after {
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
.colorpicker.colorpicker-visible,
|
||||
.colorpicker-alpha.colorpicker-visible,
|
||||
.colorpicker-saturation.colorpicker-visible,
|
||||
.colorpicker-hue.colorpicker-visible,
|
||||
.colorpicker-selectors.colorpicker-visible {
|
||||
display: block;
|
||||
}
|
||||
.colorpicker.colorpicker-hidden,
|
||||
.colorpicker-alpha.colorpicker-hidden,
|
||||
.colorpicker-saturation.colorpicker-hidden,
|
||||
.colorpicker-hue.colorpicker-hidden,
|
||||
.colorpicker-selectors.colorpicker-hidden {
|
||||
display: none;
|
||||
}
|
||||
.colorpicker-inline.colorpicker-visible {
|
||||
display: inline-block;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-colorpicker.css.map */
|
||||
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* Bootstrap Colorpicker v2.5.1
|
||||
* https://itsjavi.com/bootstrap-colorpicker/
|
||||
*
|
||||
* Originally written by (c) 2012 Stefan Petre
|
||||
* Licensed under the Apache License v2.0
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
||||
*
|
||||
*/.colorpicker-saturation{width:100px;height:100px;background-image:url(../img/bootstrap-colorpicker/saturation.png);cursor:crosshair;float:left}.colorpicker-saturation i{display:block;height:5px;width:5px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;position:absolute;top:0;left:0;margin:-4px 0 0 -4px}.colorpicker-saturation i b{display:block;height:5px;width:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-alpha,.colorpicker-hue{width:15px;height:100px;float:left;cursor:row-resize;margin-left:4px;margin-bottom:4px}.colorpicker-alpha i,.colorpicker-hue i{display:block;height:1px;background:#000;border-top:1px solid #fff;position:absolute;top:0;left:0;width:100%;margin-top:-1px}.colorpicker-hue{background-image:url(../img/bootstrap-colorpicker/hue.png)}.colorpicker-alpha{background-image:url(../img/bootstrap-colorpicker/alpha.png);display:none}.colorpicker-alpha,.colorpicker-hue,.colorpicker-saturation{background-size:contain}.colorpicker{padding:4px;min-width:130px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;z-index:2500}.colorpicker:after,.colorpicker:before{display:table;content:"";line-height:0}.colorpicker:after{clear:both}.colorpicker:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute;top:-7px;left:6px}.colorpicker:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:7px}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:url(../img/bootstrap-colorpicker/alpha.png);background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-selectors{display:none;height:10px;margin-top:5px;clear:both}.colorpicker-selectors i{cursor:pointer;float:left;height:10px;width:10px}.colorpicker-selectors i+i{margin-left:3px}.colorpicker-element .add-on i,.colorpicker-element .input-group-addon i{display:inline-block;cursor:pointer;height:16px;vertical-align:text-top;width:16px}.colorpicker.colorpicker-inline{position:relative;display:inline-block;float:none;z-index:auto}.colorpicker.colorpicker-horizontal{width:110px;min-width:110px;height:auto}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-alpha,.colorpicker.colorpicker-horizontal .colorpicker-hue{width:100px;height:15px;float:left;cursor:col-resize;margin-left:0;margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-alpha i,.colorpicker.colorpicker-horizontal .colorpicker-hue i{display:block;height:15px;background:#fff;position:absolute;top:0;left:0;width:1px;border:none;margin-top:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:url(../img/bootstrap-colorpicker/hue-horizontal.png)}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:url(../img/bootstrap-colorpicker/alpha-horizontal.png)}.colorpicker-right:before{left:auto;right:6px}.colorpicker-right:after{left:auto;right:7px}.colorpicker-no-arrow:before{border-right:0;border-left:0}.colorpicker-no-arrow:after{border-right:0;border-left:0}.colorpicker-alpha.colorpicker-visible,.colorpicker-hue.colorpicker-visible,.colorpicker-saturation.colorpicker-visible,.colorpicker-selectors.colorpicker-visible,.colorpicker.colorpicker-visible{display:block}.colorpicker-alpha.colorpicker-hidden,.colorpicker-hue.colorpicker-hidden,.colorpicker-saturation.colorpicker-hidden,.colorpicker-selectors.colorpicker-hidden,.colorpicker.colorpicker-hidden{display:none}.colorpicker-inline.colorpicker-visible{display:inline-block}
|
||||
/*# sourceMappingURL=bootstrap-colorpicker.min.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["src/less/colorpicker.less"],"names":[],"mappings":";;;;;;;;AAqBA,wBACE,MAAA,MACA,OAAA,MAXA,iBAAsB,iDAatB,OAAA,UACA,MAAA,KACA,0BACE,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAfF,sBAAA,IACA,mBAAA,IACA,cAAA,IAeE,SAAA,SACA,IAAA,EACA,KAAA,EACA,OAAA,KAAA,EAAA,EAAA,KACA,4BACE,QAAA,MACA,OAAA,IACA,MAAA,IACA,OAAA,IAAA,MAAA,KAzBJ,sBAAA,IACA,mBAAA,IACA,cAAA,IA8BF,mBADA,iBAEE,MAAA,KACA,OAAA,MACA,MAAA,KACA,OAAA,WACA,YAAA,IACA,cAAA,IAIiB,qBADF,mBAEf,QAAA,MACA,OAAA,IACA,WAAA,KACA,WAAA,IAAA,MAAA,KACA,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,KACA,WAAA,KAGF,iBA1DE,iBAAsB,0CA8DxB,mBA9DE,iBAAsB,4CAgEtB,QAAA,KAKF,mBADA,iBADA,wBAGE,gBAAA,QAGF,aACE,QAAA,IACA,UAAA,MACA,WAAA,IAxEA,sBAAA,IACA,mBAAA,IACA,cAAA,IAwEA,QAAA,KAIU,mBADA,oBAEV,QAAA,MACA,QAAA,GACA,YAAA,EAGU,mBACV,MAAA,KAGU,oBACV,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,KACA,oBAAA,eACA,SAAA,SACA,IAAA,KACA,KAAA,IAGU,mBACV,QAAA,GACA,QAAA,aACA,YAAA,IAAA,MAAA,YACA,aAAA,IAAA,MAAA,YACA,cAAA,IAAA,MAAA,KACA,SAAA,SACA,IAAA,KACA,KAAA,IAGW,iBACX,SAAA,SAGU,oCACV,UAAA,MAGkC,uDAClC,QAAA,MAGF,mBACE,OAAA,KACA,WAAA,IACA,MAAA,KAlIA,iBAAsB,4CAoItB,oBAAA,EAAA,KAGiB,uBACjB,OAAA,KAGF,uBACE,QAAA,KACA,OAAA,KACA,WAAA,IACA,MAAA,KAGqB,yBACrB,OAAA,QACA,MAAA,KACA,OAAA,KACA,MAAA,KAGuB,2BACvB,YAAA,IAI2B,+BADW,0CAEtC,QAAA,aACA,OAAA,QACA,OAAA,KACA,eAAA,SACA,MAAA,KAGU,gCACV,SAAA,SACA,QAAA,aACA,MAAA,KACA,QAAA,KAGU,oCACV,MAAA,MACA,UAAA,MACA,OAAA,KAGkC,4DAClC,cAAA,IAGkC,uDAClC,MAAA,MAIkC,uDADA,qDAElC,MAAA,MACA,OAAA,KACA,MAAA,KACA,OAAA,WACA,YAAA,EACA,cAAA,IAIqD,yDADF,uDAEnD,QAAA,MACA,OAAA,KACA,WAAA,KACA,SAAA,SACA,IAAA,EACA,KAAA,EACA,MAAA,IACA,OAAA,KACA,WAAA,EAGkC,qDAlNlC,iBAAsB,qDAsNY,uDAtNlC,iBAAsB,uDA0NN,0BAChB,KAAA,KACA,MAAA,IAGgB,yBAChB,KAAA,KACA,MAAA,IAGmB,6BACnB,aAAA,EACA,YAAA,EAGmB,4BACnB,aAAA,EACA,YAAA,EAQC,uCAAA,qCAAA,4CAAA,2CAAA,iCACC,QAAA,MASD,sCAAA,oCAAA,2CAAA,0CAAA,gCACC,QAAA,KAIe,wCACjB,QAAA"}
|
||||
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 478 B |
|
After Width: | Height: | Size: 504 B |
|
After Width: | Height: | Size: 4.0 KiB |
@@ -0,0 +1,270 @@
|
||||
|
||||
|
||||
/**
|
||||
* hasOwnProperty.
|
||||
*/
|
||||
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Require the given path.
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {Object} exports
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function require(path, parent, orig) {
|
||||
var resolved = require.resolve(path);
|
||||
|
||||
// lookup failed
|
||||
if (null == resolved) {
|
||||
orig = orig || path;
|
||||
parent = parent || 'root';
|
||||
var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
|
||||
err.path = orig;
|
||||
err.parent = parent;
|
||||
err.require = true;
|
||||
throw err;
|
||||
}
|
||||
|
||||
var module = require.modules[resolved];
|
||||
|
||||
// perform real require()
|
||||
// by invoking the module's
|
||||
// registered function
|
||||
if (!module.exports) {
|
||||
module.exports = {};
|
||||
module.client = module.component = true;
|
||||
module.call(this, module.exports, require.relative(resolved), module);
|
||||
}
|
||||
|
||||
return module.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registered modules.
|
||||
*/
|
||||
|
||||
require.modules = {};
|
||||
|
||||
/**
|
||||
* Registered aliases.
|
||||
*/
|
||||
|
||||
require.aliases = {};
|
||||
|
||||
/**
|
||||
* Resolve `path`.
|
||||
*
|
||||
* Lookup:
|
||||
*
|
||||
* - PATH/index.js
|
||||
* - PATH.js
|
||||
* - PATH
|
||||
*
|
||||
* @param {String} path
|
||||
* @return {String} path or null
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.resolve = function(path) {
|
||||
if (path.charAt(0) === '/') path = path.slice(1);
|
||||
var index = path + '/index.js';
|
||||
|
||||
var paths = [
|
||||
path,
|
||||
path + '.js',
|
||||
path + '.json',
|
||||
path + '/index.js',
|
||||
path + '/index.json'
|
||||
];
|
||||
|
||||
for (var i = 0; i < paths.length; i++) {
|
||||
var path = paths[i];
|
||||
if (has.call(require.modules, path)) return path;
|
||||
}
|
||||
|
||||
if (has.call(require.aliases, index)) {
|
||||
return require.aliases[index];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize `path` relative to the current path.
|
||||
*
|
||||
* @param {String} curr
|
||||
* @param {String} path
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.normalize = function(curr, path) {
|
||||
var segs = [];
|
||||
|
||||
if ('.' != path.charAt(0)) return path;
|
||||
|
||||
curr = curr.split('/');
|
||||
path = path.split('/');
|
||||
|
||||
for (var i = 0; i < path.length; ++i) {
|
||||
if ('..' == path[i]) {
|
||||
curr.pop();
|
||||
} else if ('.' != path[i] && '' != path[i]) {
|
||||
segs.push(path[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return curr.concat(segs).join('/');
|
||||
};
|
||||
|
||||
/**
|
||||
* Register module at `path` with callback `definition`.
|
||||
*
|
||||
* @param {String} path
|
||||
* @param {Function} definition
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.register = function(path, definition) {
|
||||
require.modules[path] = definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias a module definition.
|
||||
*
|
||||
* @param {String} from
|
||||
* @param {String} to
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.alias = function(from, to) {
|
||||
if (!has.call(require.modules, from)) {
|
||||
throw new Error('Failed to alias "' + from + '", it does not exist');
|
||||
}
|
||||
require.aliases[to] = from;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return a require function relative to the `parent` path.
|
||||
*
|
||||
* @param {String} parent
|
||||
* @return {Function}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
require.relative = function(parent) {
|
||||
var p = require.normalize(parent, '..');
|
||||
|
||||
/**
|
||||
* lastIndexOf helper.
|
||||
*/
|
||||
|
||||
function lastIndexOf(arr, obj) {
|
||||
var i = arr.length;
|
||||
while (i--) {
|
||||
if (arr[i] === obj) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The relative require() itself.
|
||||
*/
|
||||
|
||||
function localRequire(path) {
|
||||
var resolved = localRequire.resolve(path);
|
||||
return require(resolved, parent, path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve relative to the parent.
|
||||
*/
|
||||
|
||||
localRequire.resolve = function(path) {
|
||||
var c = path.charAt(0);
|
||||
if ('/' == c) return path.slice(1);
|
||||
if ('.' == c) return require.normalize(p, path);
|
||||
|
||||
// resolve deps by returning
|
||||
// the dep in the nearest "deps"
|
||||
// directory
|
||||
var segs = parent.split('/');
|
||||
var i = lastIndexOf(segs, 'deps') + 1;
|
||||
if (!i) i = 0;
|
||||
path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
|
||||
return path;
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if module is defined at `path`.
|
||||
*/
|
||||
|
||||
localRequire.exists = function(path) {
|
||||
return has.call(require.modules, localRequire.resolve(path));
|
||||
};
|
||||
|
||||
return localRequire;
|
||||
};
|
||||
require.register("horwheel/index.js", function(exports, require, module){
|
||||
// a.onwheel = function (e) {
|
||||
// e.preventDefault();
|
||||
// a.scrollLeft += (e.deltaY*40);
|
||||
// };
|
||||
|
||||
// FF viejo
|
||||
// a.addEventListener('DOMMouseScroll', function (e) {
|
||||
// e.preventDefault();
|
||||
// a.scrollLeft += (e.detail*40);
|
||||
// }, false);
|
||||
|
||||
// a.onmousewheel = function (e) {
|
||||
// e = e || window.event;
|
||||
// a.scrollLeft -= (e.detail === undefined || e.detail === 0) ? e.wheelDelta : -e.detail*40;
|
||||
|
||||
// Delta
|
||||
// wheelDelta / 120;
|
||||
// -event.detail / 3;
|
||||
|
||||
// // Opera on window need: -e.detail*40;
|
||||
// // Opera on osx doesn't need *40
|
||||
// return false;
|
||||
// };
|
||||
/**
|
||||
* Privates
|
||||
*/
|
||||
var bind = (window.addEventListener !== undefined) ? 'addEventListener' : 'attachEvent',
|
||||
wheel = (window.onwheel !== undefined) ? 'wheel' :
|
||||
(window.onmousewheel !== undefined) ? 'mousewheel' :
|
||||
(window.attachEvent) ? 'onmousewheel' : 'DOMMouseScroll';
|
||||
|
||||
function horizontalWheel(eve, el) {
|
||||
el.scrollLeft += (eve.deltaY !== undefined) ? eve.deltaY :
|
||||
(eve.detail !== undefined && eve.detail !== 0) ? eve.detail :
|
||||
-eve.wheelDelta;
|
||||
}
|
||||
|
||||
/**
|
||||
* horwheel
|
||||
*/
|
||||
function horwheel(el) {
|
||||
if (el === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
document[bind](wheel, function (eve) {
|
||||
eve = eve || window.eve;
|
||||
if (eve.preventDefault) {
|
||||
eve.preventDefault();
|
||||
}
|
||||
horizontalWheel(eve, el);
|
||||
return false;
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose horwheel
|
||||
*/
|
||||
exports = module.exports = horwheel;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/// 加解密主调方法
|
||||
/// beinetkey 密钥
|
||||
/// message 加密时为待加密的字符串,解密时为待解密的字符串
|
||||
/// encrypt 1:加密;0:解密
|
||||
/// mode true:CBC mode;false:非CBC mode
|
||||
/// iv 初始化向量
|
||||
function des(beinetkey, message, encrypt, mode, iv) {
|
||||
//declaring this locally speeds things up a bit
|
||||
var spfunction1 = new Array(0x1010400, 0, 0x10000, 0x1010404, 0x1010004, 0x10404, 0x4, 0x10000, 0x400, 0x1010400, 0x1010404, 0x400, 0x1000404, 0x1010004, 0x1000000, 0x4, 0x404, 0x1000400, 0x1000400, 0x10400, 0x10400, 0x1010000, 0x1010000, 0x1000404, 0x10004, 0x1000004, 0x1000004, 0x10004, 0, 0x404, 0x10404, 0x1000000, 0x10000, 0x1010404, 0x4, 0x1010000, 0x1010400, 0x1000000, 0x1000000, 0x400, 0x1010004, 0x10000, 0x10400, 0x1000004, 0x400, 0x4, 0x1000404, 0x10404, 0x1010404, 0x10004, 0x1010000, 0x1000404, 0x1000004, 0x404, 0x10404, 0x1010400, 0x404, 0x1000400, 0x1000400, 0, 0x10004, 0x10400, 0, 0x1010004);
|
||||
var spfunction2 = new Array(-0x7fef7fe0, -0x7fff8000, 0x8000, 0x108020, 0x100000, 0x20, -0x7fefffe0, -0x7fff7fe0, -0x7fffffe0, -0x7fef7fe0, -0x7fef8000, -0x80000000, -0x7fff8000, 0x100000, 0x20, -0x7fefffe0, 0x108000, 0x100020, -0x7fff7fe0, 0, -0x80000000, 0x8000, 0x108020, -0x7ff00000, 0x100020, -0x7fffffe0, 0, 0x108000, 0x8020, -0x7fef8000, -0x7ff00000, 0x8020, 0, 0x108020, -0x7fefffe0, 0x100000, -0x7fff7fe0, -0x7ff00000, -0x7fef8000, 0x8000, -0x7ff00000, -0x7fff8000, 0x20, -0x7fef7fe0, 0x108020, 0x20, 0x8000, -0x80000000, 0x8020, -0x7fef8000, 0x100000, -0x7fffffe0, 0x100020, -0x7fff7fe0, -0x7fffffe0, 0x100020, 0x108000, 0, -0x7fff8000, 0x8020, -0x80000000, -0x7fefffe0, -0x7fef7fe0, 0x108000);
|
||||
var spfunction3 = new Array(0x208, 0x8020200, 0, 0x8020008, 0x8000200, 0, 0x20208, 0x8000200, 0x20008, 0x8000008, 0x8000008, 0x20000, 0x8020208, 0x20008, 0x8020000, 0x208, 0x8000000, 0x8, 0x8020200, 0x200, 0x20200, 0x8020000, 0x8020008, 0x20208, 0x8000208, 0x20200, 0x20000, 0x8000208, 0x8, 0x8020208, 0x200, 0x8000000, 0x8020200, 0x8000000, 0x20008, 0x208, 0x20000, 0x8020200, 0x8000200, 0, 0x200, 0x20008, 0x8020208, 0x8000200, 0x8000008, 0x200, 0, 0x8020008, 0x8000208, 0x20000, 0x8000000, 0x8020208, 0x8, 0x20208, 0x20200, 0x8000008, 0x8020000, 0x8000208, 0x208, 0x8020000, 0x20208, 0x8, 0x8020008, 0x20200);
|
||||
var spfunction4 = new Array(0x802001, 0x2081, 0x2081, 0x80, 0x802080, 0x800081, 0x800001, 0x2001, 0, 0x802000, 0x802000, 0x802081, 0x81, 0, 0x800080, 0x800001, 0x1, 0x2000, 0x800000, 0x802001, 0x80, 0x800000, 0x2001, 0x2080, 0x800081, 0x1, 0x2080, 0x800080, 0x2000, 0x802080, 0x802081, 0x81, 0x800080, 0x800001, 0x802000, 0x802081, 0x81, 0, 0, 0x802000, 0x2080, 0x800080, 0x800081, 0x1, 0x802001, 0x2081, 0x2081, 0x80, 0x802081, 0x81, 0x1, 0x2000, 0x800001, 0x2001, 0x802080, 0x800081, 0x2001, 0x2080, 0x800000, 0x802001, 0x80, 0x800000, 0x2000, 0x802080);
|
||||
var spfunction5 = new Array(0x100, 0x2080100, 0x2080000, 0x42000100, 0x80000, 0x100, 0x40000000, 0x2080000, 0x40080100, 0x80000, 0x2000100, 0x40080100, 0x42000100, 0x42080000, 0x80100, 0x40000000, 0x2000000, 0x40080000, 0x40080000, 0, 0x40000100, 0x42080100, 0x42080100, 0x2000100, 0x42080000, 0x40000100, 0, 0x42000000, 0x2080100, 0x2000000, 0x42000000, 0x80100, 0x80000, 0x42000100, 0x100, 0x2000000, 0x40000000, 0x2080000, 0x42000100, 0x40080100, 0x2000100, 0x40000000, 0x42080000, 0x2080100, 0x40080100, 0x100, 0x2000000, 0x42080000, 0x42080100, 0x80100, 0x42000000, 0x42080100, 0x2080000, 0, 0x40080000, 0x42000000, 0x80100, 0x2000100, 0x40000100, 0x80000, 0, 0x40080000, 0x2080100, 0x40000100);
|
||||
var spfunction6 = new Array(0x20000010, 0x20400000, 0x4000, 0x20404010, 0x20400000, 0x10, 0x20404010, 0x400000, 0x20004000, 0x404010, 0x400000, 0x20000010, 0x400010, 0x20004000, 0x20000000, 0x4010, 0, 0x400010, 0x20004010, 0x4000, 0x404000, 0x20004010, 0x10, 0x20400010, 0x20400010, 0, 0x404010, 0x20404000, 0x4010, 0x404000, 0x20404000, 0x20000000, 0x20004000, 0x10, 0x20400010, 0x404000, 0x20404010, 0x400000, 0x4010, 0x20000010, 0x400000, 0x20004000, 0x20000000, 0x4010, 0x20000010, 0x20404010, 0x404000, 0x20400000, 0x404010, 0x20404000, 0, 0x20400010, 0x10, 0x4000, 0x20400000, 0x404010, 0x4000, 0x400010, 0x20004010, 0, 0x20404000, 0x20000000, 0x400010, 0x20004010);
|
||||
var spfunction7 = new Array(0x200000, 0x4200002, 0x4000802, 0, 0x800, 0x4000802, 0x200802, 0x4200800, 0x4200802, 0x200000, 0, 0x4000002, 0x2, 0x4000000, 0x4200002, 0x802, 0x4000800, 0x200802, 0x200002, 0x4000800, 0x4000002, 0x4200000, 0x4200800, 0x200002, 0x4200000, 0x800, 0x802, 0x4200802, 0x200800, 0x2, 0x4000000, 0x200800, 0x4000000, 0x200800, 0x200000, 0x4000802, 0x4000802, 0x4200002, 0x4200002, 0x2, 0x200002, 0x4000000, 0x4000800, 0x200000, 0x4200800, 0x802, 0x200802, 0x4200800, 0x802, 0x4000002, 0x4200802, 0x4200000, 0x200800, 0, 0x2, 0x4200802, 0, 0x200802, 0x4200000, 0x800, 0x4000002, 0x4000800, 0x800, 0x200002);
|
||||
var spfunction8 = new Array(0x10001040, 0x1000, 0x40000, 0x10041040, 0x10000000, 0x10001040, 0x40, 0x10000000, 0x40040, 0x10040000, 0x10041040, 0x41000, 0x10041000, 0x41040, 0x1000, 0x40, 0x10040000, 0x10000040, 0x10001000, 0x1040, 0x41000, 0x40040, 0x10040040, 0x10041000, 0x1040, 0, 0, 0x10040040, 0x10000040, 0x10001000, 0x41040, 0x40000, 0x41040, 0x40000, 0x10041000, 0x1000, 0x40, 0x10040040, 0x1000, 0x41040, 0x10001000, 0x40, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x40000, 0x10001040, 0, 0x10041040, 0x40040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0, 0x10041040, 0x41000, 0x41000, 0x1040, 0x1040, 0x40040, 0x10000000, 0x10041000);
|
||||
|
||||
//create the 16 or 48 subkeys we will need
|
||||
var keys = des_createKeys(beinetkey);
|
||||
var m = 0, i, j, temp, temp2, right1, right2, left, right, looping;
|
||||
var cbcleft, cbcleft2, cbcright, cbcright2
|
||||
var endloop, loopinc;
|
||||
var len = message.length;
|
||||
var chunk = 0;
|
||||
//set up the loops for single and triple des
|
||||
var iterations = keys.length == 32 ? 3 : 9; //single or triple des
|
||||
if (iterations == 3) { looping = encrypt ? new Array(0, 32, 2) : new Array(30, -2, -2); }
|
||||
else { looping = encrypt ? new Array(0, 32, 2, 62, 30, -2, 64, 96, 2) : new Array(94, 62, -2, 32, 64, 2, 30, -2, -2); }
|
||||
|
||||
message += '\0\0\0\0\0\0\0\0'; //pad the message out with null bytes
|
||||
//store the result here
|
||||
result = '';
|
||||
tempresult = '';
|
||||
|
||||
if (mode == 1) {//CBC mode
|
||||
cbcleft = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);
|
||||
cbcright = (iv.charCodeAt(m++) << 24) | (iv.charCodeAt(m++) << 16) | (iv.charCodeAt(m++) << 8) | iv.charCodeAt(m++);
|
||||
m = 0;
|
||||
}
|
||||
|
||||
//loop through each 64 bit chunk of the message
|
||||
while (m < len) {
|
||||
if (encrypt) {//加密时按双字节操作
|
||||
left = (message.charCodeAt(m++) << 16) | message.charCodeAt(m++);
|
||||
right = (message.charCodeAt(m++) << 16) | message.charCodeAt(m++);
|
||||
} else {
|
||||
left = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);
|
||||
right = (message.charCodeAt(m++) << 24) | (message.charCodeAt(m++) << 16) | (message.charCodeAt(m++) << 8) | message.charCodeAt(m++);
|
||||
}
|
||||
//for Cipher Block Chaining mode,xor the message with the previous result
|
||||
if (mode == 1) { if (encrypt) { left ^= cbcleft; right ^= cbcright; } else { cbcleft2 = cbcleft; cbcright2 = cbcright; cbcleft = left; cbcright = right; } }
|
||||
|
||||
//first each 64 but chunk of the message must be permuted according to IP
|
||||
temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
|
||||
temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);
|
||||
temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);
|
||||
temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
|
||||
temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
|
||||
|
||||
left = ((left << 1) | (left >>> 31));
|
||||
right = ((right << 1) | (right >>> 31));
|
||||
|
||||
//do this either 1 or 3 times for each chunk of the message
|
||||
for (j = 0; j < iterations; j += 3) {
|
||||
endloop = looping[j + 1];
|
||||
loopinc = looping[j + 2];
|
||||
//now go through and perform the encryption or decryption
|
||||
for (i = looping[j]; i != endloop; i += loopinc) {//for efficiency
|
||||
right1 = right ^ keys[i];
|
||||
right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];
|
||||
//the result is attained by passing these bytes through the S selection functions
|
||||
temp = left;
|
||||
left = right;
|
||||
right = temp ^ (spfunction2[(right1 >>> 24) & 0x3f] | spfunction4[(right1 >>> 16) & 0x3f] | spfunction6[(right1 >>> 8) & 0x3f] | spfunction8[right1 & 0x3f] | spfunction1[(right2 >>> 24) & 0x3f] | spfunction3[(right2 >>> 16) & 0x3f] | spfunction5[(right2 >>> 8) & 0x3f] | spfunction7[right2 & 0x3f]);
|
||||
}
|
||||
temp = left; left = right; right = temp; //unreverse left and right
|
||||
} //for either 1 or 3 iterations
|
||||
|
||||
//move then each one bit to the right
|
||||
left = ((left >>> 1) | (left << 31));
|
||||
right = ((right >>> 1) | (right << 31));
|
||||
|
||||
//now perform IP-1,which is IP in the opposite direction
|
||||
temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
|
||||
temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
|
||||
temp = ((right >>> 2) ^ left) & 0x33333333; left ^= temp; right ^= (temp << 2);
|
||||
temp = ((left >>> 16) ^ right) & 0x0000ffff; right ^= temp; left ^= (temp << 16);
|
||||
temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
|
||||
|
||||
//for Cipher Block Chaining mode,xor the message with the previous result
|
||||
if (mode == 1) { if (encrypt) { cbcleft = left; cbcright = right; } else { left ^= cbcleft2; right ^= cbcright2; } }
|
||||
if (encrypt) {
|
||||
tempresult += String.fromCharCode((left >>> 24), ((left >>> 16) & 0xff), ((left >>> 8) & 0xff), (left & 0xff), (right >>> 24), ((right >>> 16) & 0xff), ((right >>> 8) & 0xff), (right & 0xff));
|
||||
}
|
||||
else {
|
||||
tempresult += String.fromCharCode(((left >>> 16) & 0xffff), (left & 0xffff), ((right >>> 16) & 0xffff), (right & 0xffff));
|
||||
} //解密时输出双字节
|
||||
encrypt ? chunk += 16 : chunk += 8;
|
||||
if (chunk == 512) { result += tempresult; tempresult = ''; chunk = 0; }
|
||||
} //for every 8 characters,or 64 bits in the message
|
||||
|
||||
//return the result as an array
|
||||
return result + tempresult;
|
||||
} //end of des
|
||||
|
||||
//des_createKeys
|
||||
//this takes as input a 64 bit beinetkey(even though only 56 bits are used)
|
||||
//as an array of 2 integers,and returns 16 48 bit keys
|
||||
function des_createKeys(beinetkey) {
|
||||
//declaring this locally speeds things up a bit
|
||||
pc2bytes0 = new Array(0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204);
|
||||
pc2bytes1 = new Array(0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101);
|
||||
pc2bytes2 = new Array(0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808);
|
||||
pc2bytes3 = new Array(0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000);
|
||||
pc2bytes4 = new Array(0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010);
|
||||
pc2bytes5 = new Array(0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420);
|
||||
pc2bytes6 = new Array(0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002);
|
||||
pc2bytes7 = new Array(0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800);
|
||||
pc2bytes8 = new Array(0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002);
|
||||
pc2bytes9 = new Array(0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408);
|
||||
pc2bytes10 = new Array(0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020);
|
||||
pc2bytes11 = new Array(0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200);
|
||||
pc2bytes12 = new Array(0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010);
|
||||
pc2bytes13 = new Array(0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105);
|
||||
|
||||
//how many iterations(1 for des,3 for triple des)
|
||||
var iterations = beinetkey.length >= 24 ? 3 : 1;
|
||||
//stores the return keys
|
||||
var keys = new Array(32 * iterations);
|
||||
//now define the left shifts which need to be done
|
||||
var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);
|
||||
//other variables
|
||||
var lefttemp, righttemp, m = 0, n = 0, temp;
|
||||
|
||||
for (var j = 0; j < iterations; j++) {//either 1 or 3 iterations
|
||||
left = (beinetkey.charCodeAt(m++) << 24) | (beinetkey.charCodeAt(m++) << 16) | (beinetkey.charCodeAt(m++) << 8) | beinetkey.charCodeAt(m++);
|
||||
right = (beinetkey.charCodeAt(m++) << 24) | (beinetkey.charCodeAt(m++) << 16) | (beinetkey.charCodeAt(m++) << 8) | beinetkey.charCodeAt(m++);
|
||||
|
||||
temp = ((left >>> 4) ^ right) & 0x0f0f0f0f; right ^= temp; left ^= (temp << 4);
|
||||
temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);
|
||||
temp = ((left >>> 2) ^ right) & 0x33333333; right ^= temp; left ^= (temp << 2);
|
||||
temp = ((right >>> -16) ^ left) & 0x0000ffff; left ^= temp; right ^= (temp << -16);
|
||||
temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
|
||||
temp = ((right >>> 8) ^ left) & 0x00ff00ff; left ^= temp; right ^= (temp << 8);
|
||||
temp = ((left >>> 1) ^ right) & 0x55555555; right ^= temp; left ^= (temp << 1);
|
||||
|
||||
//the right side needs to be shifted and to get the last four bits of the left side
|
||||
temp = (left << 8) | ((right >>> 20) & 0x000000f0);
|
||||
//left needs to be put upside down
|
||||
left = (right << 24) | ((right << 8) & 0xff0000) | ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0);
|
||||
right = temp;
|
||||
|
||||
//now go through and perform these shifts on the left and right keys
|
||||
for (i = 0; i < shifts.length; i++) {
|
||||
//shift the keys either one or two bits to the left
|
||||
if (shifts[i]) { left = (left << 2) | (left >>> 26); right = (right << 2) | (right >>> 26); }
|
||||
else { left = (left << 1) | (left >>> 27); right = (right << 1) | (right >>> 27); }
|
||||
left &= -0xf; right &= -0xf;
|
||||
|
||||
//now apply PC-2,in such a way that E is easier when encrypting or decrypting
|
||||
//this conversion will look like PC-2 except only the last 6 bits of each byte are used
|
||||
//rather than 48 consecutive bits and the order of lines will be according to
|
||||
//how the S selection functions will be applied:S2,S4,S6,S8,S1,S3,S5,S7
|
||||
lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf]
|
||||
| pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf]
|
||||
| pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf]
|
||||
| pc2bytes6[(left >>> 4) & 0xf];
|
||||
righttemp = pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf]
|
||||
| pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf]
|
||||
| pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf]
|
||||
| pc2bytes13[(right >>> 4) & 0xf];
|
||||
temp = ((righttemp >>> 16) ^ lefttemp) & 0x0000ffff;
|
||||
keys[n++] = lefttemp ^ temp; keys[n++] = righttemp ^ (temp << 16);
|
||||
}
|
||||
} //for each iterations
|
||||
//return the keys we've created
|
||||
return keys;
|
||||
} //end of des_createKeys
|
||||
|
||||
|
||||
// 把字符串转换为16进制字符串
|
||||
// 如:a变成61(即10进制的97);abc变成616263
|
||||
function stringToHex(s) {
|
||||
var r = '';
|
||||
var hexes = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
|
||||
for (var i = 0; i < (s.length) ; i++) { r += hexes[s.charCodeAt(i) >> 4] + hexes[s.charCodeAt(i) & 0xf]; }
|
||||
return r;
|
||||
}
|
||||
// 16进制字符串转换为字符串
|
||||
// 如:61(即10进制的97)变成a;616263变成abc
|
||||
function HexTostring(s) {
|
||||
var r = '';
|
||||
for (var i = 0; i < s.length; i += 2) {
|
||||
var sxx = parseInt(s.substring(i, i + 2), 16);
|
||||
r += String.fromCharCode(sxx);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// 加密测试函数
|
||||
/// s 待加密的字符串
|
||||
/// k 密钥
|
||||
function encMe(s, k) {
|
||||
return stringToHex(des(k, s, 1, 0));
|
||||
}
|
||||
|
||||
/// 解密测试函数
|
||||
/// s 待解密的字符串
|
||||
/// k 密钥
|
||||
function uncMe(s, k) {
|
||||
return des(k, HexTostring(s), 0, 0);
|
||||
}
|
||||
@@ -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 |
|
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 |
@@ -0,0 +1,20 @@
|
||||
(function() {
|
||||
$(document).ready(function() {
|
||||
var timelineAnimate;
|
||||
timelineAnimate = function(elem) {
|
||||
return $(".timeline.animated .timeline-row").each(function(i) {
|
||||
var bottom_of_object, bottom_of_window;
|
||||
bottom_of_object = $(this).position().top + $(this).outerHeight();
|
||||
bottom_of_window = $(window).scrollTop() + $(window).height();
|
||||
if (bottom_of_window > bottom_of_object) {
|
||||
return $(this).addClass("active");
|
||||
}
|
||||
});
|
||||
};
|
||||
timelineAnimate();
|
||||
return $(window).scroll(function() {
|
||||
return timelineAnimate();
|
||||
});
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
@@ -0,0 +1,14 @@
|
||||
var $lang={
|
||||
errAlertMsg: "Invalid date or the date out of range,redo or not?",
|
||||
aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
||||
aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
|
||||
aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
|
||||
aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"],
|
||||
clearStr: "Clear",
|
||||
todayStr: "Today",
|
||||
okStr: "OK",
|
||||
updateStr: "OK",
|
||||
timeStr: "Time",
|
||||
quickStr: "Quick Selection",
|
||||
err_1: 'MinDate Cannot be bigger than MaxDate!'
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
var $lang={
|
||||
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?",
|
||||
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
|
||||
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
|
||||
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
|
||||
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
|
||||
clearStr: "\u6E05\u7A7A",
|
||||
todayStr: "\u4ECA\u5929",
|
||||
okStr: "\u786E\u5B9A",
|
||||
updateStr: "\u786E\u5B9A",
|
||||
timeStr: "\u65F6\u95F4",
|
||||
quickStr: "\u5FEB\u901F\u9009\u62E9",
|
||||
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!'
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
var $lang={
|
||||
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?",
|
||||
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
|
||||
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
|
||||
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
|
||||
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
|
||||
clearStr: "\u6E05\u7A7A",
|
||||
todayStr: "\u4ECA\u5929",
|
||||
okStr: "\u78BA\u5B9A",
|
||||
updateStr: "\u78BA\u5B9A",
|
||||
timeStr: "\u6642\u9593",
|
||||
quickStr: "\u5FEB\u901F\u9078\u64C7",
|
||||
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!'
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
.Wdate{
|
||||
border:#999 1px solid;
|
||||
height:20px;
|
||||
background:#fff url(datePicker.gif) no-repeat right;
|
||||
}
|
||||
.Wdate::-ms-clear{display:none;}
|
||||
|
||||
.WdateFmtErr{
|
||||
font-weight:bold;
|
||||
color:red;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,246 @@
|
||||
/*
|
||||
* My97 DatePicker 4.8
|
||||
*/
|
||||
|
||||
.WdateDiv{
|
||||
width:180px;
|
||||
background-color:#FFFFFF;
|
||||
border:#bbb 1px solid;
|
||||
padding:2px;
|
||||
}
|
||||
|
||||
.WdateDiv2{
|
||||
width:360px;
|
||||
}
|
||||
.WdateDiv *{font-size:9pt;}
|
||||
|
||||
.WdateDiv .NavImg a{
|
||||
display:block;
|
||||
cursor:pointer;
|
||||
height:16px;
|
||||
width:16px;
|
||||
}
|
||||
|
||||
.WdateDiv .NavImgll a{
|
||||
float:left;
|
||||
background:transparent url(img.gif) no-repeat scroll 0 0;
|
||||
}
|
||||
.WdateDiv .NavImgl a{
|
||||
float:left;
|
||||
background:transparent url(img.gif) no-repeat scroll -16px 0;
|
||||
}
|
||||
.WdateDiv .NavImgr a{
|
||||
float:right;
|
||||
background:transparent url(img.gif) no-repeat scroll -32px 0;
|
||||
}
|
||||
.WdateDiv .NavImgrr a{
|
||||
float:right;
|
||||
background:transparent url(img.gif) no-repeat scroll -48px 0;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTitle{
|
||||
height:24px;
|
||||
margin-bottom:2px;
|
||||
padding:1px;
|
||||
}
|
||||
|
||||
.WdateDiv .yminput{
|
||||
margin-top:2px;
|
||||
text-align:center;
|
||||
height:20px;
|
||||
border:0px;
|
||||
width:50px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.WdateDiv .yminputfocus{
|
||||
margin-top:2px;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
height:20px;
|
||||
color:blue;
|
||||
border:#ccc 1px solid;
|
||||
width:50px;
|
||||
}
|
||||
|
||||
.WdateDiv .menuSel{
|
||||
z-index:1;
|
||||
position:absolute;
|
||||
background-color:#FFFFFF;
|
||||
border:#ccc 1px solid;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.WdateDiv .menu{
|
||||
cursor:pointer;
|
||||
background-color:#fff;
|
||||
}
|
||||
|
||||
.WdateDiv .menuOn{
|
||||
cursor:pointer;
|
||||
background-color:#BEEBEE;
|
||||
}
|
||||
|
||||
.WdateDiv .invalidMenu{
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
.WdateDiv .YMenu{
|
||||
margin-top:20px;
|
||||
|
||||
}
|
||||
|
||||
.WdateDiv .MMenu{
|
||||
margin-top:20px;
|
||||
*width:62px;
|
||||
}
|
||||
|
||||
.WdateDiv .hhMenu{
|
||||
margin-top:-90px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .mmMenu{
|
||||
margin-top:-46px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .ssMenu{
|
||||
margin-top:-24px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .Wweek {
|
||||
text-align:center;
|
||||
background:#DAF3F5;
|
||||
border-right:#BDEBEE 1px solid;
|
||||
}
|
||||
|
||||
.WdateDiv .MTitle{
|
||||
background-color:#BDEBEE;
|
||||
}
|
||||
.WdateDiv .WdayTable2{
|
||||
border-collapse:collapse;
|
||||
border:#c5d9e8 1px solid;
|
||||
}
|
||||
.WdateDiv .WdayTable2 table{
|
||||
border:0;
|
||||
}
|
||||
|
||||
.WdateDiv .WdayTable{
|
||||
line-height:20px;
|
||||
border:#c5d9e8 1px solid;
|
||||
}
|
||||
.WdateDiv .WdayTable td{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.WdateDiv .Wday{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.WdateDiv .WdayOn{
|
||||
cursor:pointer;
|
||||
background-color:#C0EBEF;
|
||||
}
|
||||
|
||||
.WdateDiv .Wwday{
|
||||
cursor:pointer;
|
||||
color:#FF2F2F;
|
||||
}
|
||||
|
||||
.WdateDiv .WwdayOn{
|
||||
cursor:pointer;
|
||||
color:#000;
|
||||
background-color:#C0EBEF;
|
||||
}
|
||||
.WdateDiv .Wtoday{
|
||||
cursor:pointer;
|
||||
color:blue;
|
||||
}
|
||||
.WdateDiv .Wselday{
|
||||
background-color:#A9E4E9;
|
||||
}
|
||||
.WdateDiv .WspecialDay{
|
||||
background-color:#66F4DF;
|
||||
}
|
||||
|
||||
.WdateDiv .WotherDay{
|
||||
cursor:pointer;
|
||||
color:#6A6AFF;
|
||||
}
|
||||
|
||||
.WdateDiv .WotherDayOn{
|
||||
cursor:pointer;
|
||||
background-color:#C0EBEF;
|
||||
}
|
||||
|
||||
.WdateDiv .WinvalidDay{
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime{
|
||||
float:left;
|
||||
margin-top:3px;
|
||||
margin-right:30px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeStr{
|
||||
margin-left:1px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime input{
|
||||
width:18px;
|
||||
height:20px;
|
||||
text-align:center;
|
||||
border:#ccc 1px solid;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tB{
|
||||
border-right:0px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tE{
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tm{
|
||||
width:7px;
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeUp{
|
||||
height:10px;
|
||||
width:13px;
|
||||
border:0px;
|
||||
background:url(img.gif) no-repeat -32px -16px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeDown{
|
||||
height:10px;
|
||||
width:13px;
|
||||
border:0px;
|
||||
background:url(img.gif) no-repeat -48px -16px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpQS {
|
||||
float:left;
|
||||
margin-right:3px;
|
||||
margin-top:3px;
|
||||
background:url(img.gif) no-repeat 0px -16px;
|
||||
width:20px;
|
||||
height:20px;
|
||||
cursor:pointer;
|
||||
}
|
||||
.WdateDiv #dpControl {
|
||||
text-align:right;
|
||||
}
|
||||
.WdateDiv .dpButton{
|
||||
height:20px;
|
||||
width:45px;
|
||||
border:#ccc 1px solid;
|
||||
margin-top:2px;
|
||||
margin-right:1px;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 307 B |
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* My97 DatePicker 4.8 Skin:whyGreen
|
||||
*/
|
||||
.WdateDiv{
|
||||
width:180px;
|
||||
background-color:#fff;
|
||||
border:#C5E1E4 1px solid;
|
||||
padding:2px;
|
||||
}
|
||||
|
||||
.WdateDiv2{
|
||||
width:360px;
|
||||
}
|
||||
.WdateDiv *{font-size:9pt;}
|
||||
|
||||
.WdateDiv .NavImg a{
|
||||
cursor:pointer;
|
||||
display:block;
|
||||
width:16px;
|
||||
height:16px;
|
||||
margin-top:1px;
|
||||
}
|
||||
|
||||
.WdateDiv .NavImgll a{
|
||||
float:left;
|
||||
background:url(img.gif) no-repeat;
|
||||
}
|
||||
.WdateDiv .NavImgl a{
|
||||
float:left;
|
||||
background:url(img.gif) no-repeat -16px 0px;
|
||||
}
|
||||
.WdateDiv .NavImgr a{
|
||||
float:right;
|
||||
background:url(img.gif) no-repeat -32px 0px;
|
||||
}
|
||||
.WdateDiv .NavImgrr a{
|
||||
float:right;
|
||||
background:url(img.gif) no-repeat -48px 0px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTitle{
|
||||
height:24px;
|
||||
padding:1px;
|
||||
border:#c5d9e8 1px solid;
|
||||
background:url(bg.jpg);
|
||||
margin-bottom:2px;
|
||||
}
|
||||
|
||||
.WdateDiv .yminput{
|
||||
margin-top:2px;
|
||||
text-align:center;
|
||||
border:0px;
|
||||
height:20px;
|
||||
width:50px;
|
||||
color:#034c50;
|
||||
background-color:transparent;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.WdateDiv .yminputfocus{
|
||||
margin-top:2px;
|
||||
text-align:center;
|
||||
border:#939393 1px solid;
|
||||
font-weight:bold;
|
||||
color:#034c50;
|
||||
height:20px;
|
||||
width:50px;
|
||||
}
|
||||
|
||||
.WdateDiv .menuSel{
|
||||
z-index:1;
|
||||
position:absolute;
|
||||
background-color:#FFFFFF;
|
||||
border:#A3C6C8 1px solid;
|
||||
display:none;
|
||||
}
|
||||
|
||||
.WdateDiv .menu{
|
||||
cursor:pointer;
|
||||
background-color:#fff;
|
||||
color:#11777C;
|
||||
}
|
||||
|
||||
.WdateDiv .menuOn{
|
||||
cursor:pointer;
|
||||
background-color:#BEEBEE;
|
||||
}
|
||||
|
||||
.WdateDiv .invalidMenu{
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
.WdateDiv .YMenu{
|
||||
margin-top:20px;
|
||||
}
|
||||
|
||||
.WdateDiv .MMenu{
|
||||
margin-top:20px;
|
||||
*width:62px;
|
||||
}
|
||||
|
||||
.WdateDiv .hhMenu{
|
||||
margin-top:-90px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .mmMenu{
|
||||
margin-top:-46px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .ssMenu{
|
||||
margin-top:-24px;
|
||||
margin-left:26px;
|
||||
}
|
||||
|
||||
.WdateDiv .Wweek {
|
||||
text-align:center;
|
||||
background:#DAF3F5;
|
||||
border-right:#BDEBEE 1px solid;
|
||||
}
|
||||
|
||||
.WdateDiv .MTitle{
|
||||
color:#13777e;
|
||||
background-color:#bdebee;
|
||||
}
|
||||
.WdateDiv .WdayTable2{
|
||||
border-collapse:collapse;
|
||||
border:#BEE9F0 1px solid;
|
||||
}
|
||||
.WdateDiv .WdayTable2 table{
|
||||
border:0;
|
||||
}
|
||||
|
||||
.WdateDiv .WdayTable{
|
||||
line-height:20px;
|
||||
color:#13777e;
|
||||
background-color:#edfbfb;
|
||||
border:#BEE9F0 1px solid;
|
||||
}
|
||||
.WdateDiv .WdayTable td{
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.WdateDiv .Wday{
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.WdateDiv .WdayOn{
|
||||
cursor:pointer;
|
||||
background-color:#74d2d9 ;
|
||||
}
|
||||
|
||||
.WdateDiv .Wwday{
|
||||
cursor:pointer;
|
||||
color:#ab1e1e;
|
||||
}
|
||||
|
||||
.WdateDiv .WwdayOn{
|
||||
cursor:pointer;
|
||||
background-color:#74d2d9;
|
||||
}
|
||||
.WdateDiv .Wtoday{
|
||||
cursor:pointer;
|
||||
color:blue;
|
||||
}
|
||||
.WdateDiv .Wselday{
|
||||
background-color:#A7E2E7;
|
||||
}
|
||||
.WdateDiv .WspecialDay{
|
||||
background-color:#66F4DF;
|
||||
}
|
||||
|
||||
.WdateDiv .WotherDay{
|
||||
cursor:pointer;
|
||||
color:#0099CC;
|
||||
}
|
||||
|
||||
.WdateDiv .WotherDayOn{
|
||||
cursor:pointer;
|
||||
background-color:#C0EBEF;
|
||||
}
|
||||
|
||||
.WdateDiv .WinvalidDay{
|
||||
color:#aaa;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime{
|
||||
float:left;
|
||||
margin-top:3px;
|
||||
margin-right:30px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeStr{
|
||||
margin-left:1px;
|
||||
color:#497F7F;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime input{
|
||||
height:20px;
|
||||
width:18px;
|
||||
text-align:center;
|
||||
color:#333;
|
||||
border:#61CAD0 1px solid;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tB{
|
||||
border-right:0px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tE{
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime .tm{
|
||||
width:7px;
|
||||
border-left:0;
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeUp{
|
||||
height:10px;
|
||||
width:13px;
|
||||
border:0px;
|
||||
background:url(img.gif) no-repeat -32px -16px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpTime #dpTimeDown{
|
||||
height:10px;
|
||||
width:13px;
|
||||
border:0px;
|
||||
background:url(img.gif) no-repeat -48px -16px;
|
||||
}
|
||||
|
||||
.WdateDiv #dpQS {
|
||||
float:left;
|
||||
margin-right:3px;
|
||||
margin-top:3px;
|
||||
background:url(img.gif) no-repeat 0px -16px;
|
||||
width:20px;
|
||||
height:20px;
|
||||
cursor:pointer;
|
||||
}
|
||||
.WdateDiv #dpControl {
|
||||
text-align:right;
|
||||
margin-top:3px;
|
||||
}
|
||||
.WdateDiv .dpButton{
|
||||
height:20px;
|
||||
width:45px;
|
||||
margin-top:2px;
|
||||
border:#38B1B9 1px solid;
|
||||
background-color:#CFEBEE;
|
||||
color:#08575B;
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,181 @@
|
||||
|
||||
//ban_qh
|
||||
$.fn.banqh = function(can){
|
||||
can = $.extend({
|
||||
box:null,//总框架
|
||||
pic:null,//大图框架
|
||||
pnum:null,//小图框架
|
||||
prev_btn:null,//小图左箭头
|
||||
next_btn:null,//小图右箭头
|
||||
prev:null,//大图左箭头
|
||||
next:null,//大图右箭头
|
||||
pop_prev:null,//弹出框左箭头
|
||||
pop_next:null,//弹出框右箭头
|
||||
autoplay:false,//是否自动播放
|
||||
interTime:5000,//图片自动切换间隔
|
||||
delayTime:800,//切换一张图片时间
|
||||
pop_delayTime:800,//弹出框切换一张图片时间
|
||||
order:0,//当前显示的图片(从0开始)
|
||||
picdire:true,//大图滚动方向(true水平方向滚动)
|
||||
mindire:true,//小图滚动方向(true水平方向滚动)
|
||||
min_picnum:null,//小图显示数量
|
||||
pop_up:false,//大图是否有弹出框
|
||||
pop_div:null,//弹出框框架
|
||||
pop_pic:null,//弹出框图片框架
|
||||
pop_xx:null,//关闭弹出框按钮
|
||||
mhc:null//朦灰层
|
||||
}, can || {});
|
||||
var picnum = $(can.pic).find('ul li').length;
|
||||
var picw = $(can.pic).find('ul li').outerWidth(true);
|
||||
var pich = $(can.pic).find('ul li').outerHeight(true);
|
||||
var poppicw = $(can.pop_pic).find('ul li').outerWidth(true);
|
||||
var picminnum = $(can.pnum).find('ul li').length;
|
||||
var picpopnum = $(can.pop_pic).find('ul li').length;
|
||||
var picminw = $(can.pnum).find('ul li').outerWidth(true);
|
||||
var picminh = $(can.pnum).find('ul li').outerHeight(true);
|
||||
var pictime;
|
||||
var tpqhnum=0;
|
||||
var xtqhnum=0;
|
||||
var popnum=0;
|
||||
$(can.pic).find('ul').width(picnum*picw).height(picnum*pich);
|
||||
$(can.pnum).find('ul').width(picminnum*picminw).height(picminnum*picminh);
|
||||
$(can.pop_pic).find('ul').width(picpopnum*poppicw);
|
||||
|
||||
//点击小图切换大图
|
||||
$(can.pnum).find('li').click(function () {
|
||||
tpqhnum = xtqhnum = $(can.pnum).find('li').index(this);
|
||||
show(tpqhnum);
|
||||
minshow(xtqhnum);
|
||||
}).eq(can.order).trigger("click");
|
||||
//大图弹出框
|
||||
if(can.pop_up==true){
|
||||
$(can.pic).find('ul li').click(function(){
|
||||
$(can.mhc).height($(document).height()).show();
|
||||
$(can.pop_div).show();
|
||||
popnum = $(this).index();
|
||||
var gdjl_w=-popnum*poppicw;
|
||||
$(can.pop_pic).find('ul').css('left',gdjl_w);
|
||||
popshow(popnum);
|
||||
})
|
||||
$(can.pop_xx).click(function(){
|
||||
$(can.mhc).hide();
|
||||
$(can.pop_div).hide();
|
||||
})
|
||||
}
|
||||
|
||||
if(can.autoplay==true){
|
||||
//自动播放
|
||||
pictime = setInterval(function(){
|
||||
show(tpqhnum);
|
||||
minshow(tpqhnum)
|
||||
tpqhnum++;
|
||||
xtqhnum++;
|
||||
if(tpqhnum==picnum){tpqhnum=0};
|
||||
if(xtqhnum==picminnum){xtqhnum=0};
|
||||
|
||||
},can.interTime);
|
||||
|
||||
//鼠标经过停止播放
|
||||
$(can.box).hover(function(){
|
||||
clearInterval(pictime);
|
||||
},function(){
|
||||
pictime = setInterval(function(){
|
||||
show(tpqhnum);
|
||||
minshow(tpqhnum)
|
||||
tpqhnum++;
|
||||
xtqhnum++;
|
||||
if(tpqhnum==picnum){tpqhnum=0};
|
||||
if(xtqhnum==picminnum){xtqhnum=0};
|
||||
},can.interTime);
|
||||
});
|
||||
}
|
||||
//小图左右切换
|
||||
$(can.prev_btn).click(function(){
|
||||
if(tpqhnum==0){tpqhnum=picnum};
|
||||
if(xtqhnum==0){xtqhnum=picnum};
|
||||
xtqhnum--;
|
||||
tpqhnum--;
|
||||
show(tpqhnum);
|
||||
minshow(xtqhnum);
|
||||
})
|
||||
$(can.next_btn).click(function(){
|
||||
if(tpqhnum==picnum-1){tpqhnum=-1};
|
||||
if(xtqhnum==picminnum-1){xtqhnum=-1};
|
||||
xtqhnum++;
|
||||
minshow(xtqhnum)
|
||||
tpqhnum++;
|
||||
show(tpqhnum);
|
||||
})
|
||||
//大图左右切换
|
||||
$(can.prev).click(function(){
|
||||
if(tpqhnum==0){tpqhnum=picnum};
|
||||
if(xtqhnum==0){xtqhnum=picnum};
|
||||
xtqhnum--;
|
||||
tpqhnum--;
|
||||
show(tpqhnum);
|
||||
minshow(xtqhnum);
|
||||
})
|
||||
$(can.next).click(function(){
|
||||
if(tpqhnum==picnum-1){tpqhnum=-1};
|
||||
if(xtqhnum==picminnum-1){xtqhnum=-1};
|
||||
xtqhnum++;
|
||||
minshow(xtqhnum)
|
||||
tpqhnum++;
|
||||
show(tpqhnum);
|
||||
})
|
||||
//弹出框图片左右切换
|
||||
$(can.pop_prev).click(function(){
|
||||
if(popnum==0){popnum=picnum};
|
||||
popnum--;
|
||||
popshow(popnum);
|
||||
})
|
||||
$(can.pop_next).click(function(){
|
||||
if(popnum==picnum-1){popnum=-1};
|
||||
popnum++;
|
||||
popshow(popnum);
|
||||
})
|
||||
//小图切换过程
|
||||
function minshow(xtqhnum){
|
||||
var mingdjl_num =xtqhnum-can.min_picnum+2
|
||||
var mingdjl_w=-mingdjl_num*picminw;
|
||||
var mingdjl_h=-mingdjl_num*picminh;
|
||||
|
||||
if(can.mindire==true){
|
||||
$(can.pnum).find('ul li').css('float','left');
|
||||
if(picminnum>can.min_picnum){
|
||||
if(xtqhnum<3){mingdjl_w=0;}
|
||||
if(xtqhnum==picminnum-1){mingdjl_w=-(mingdjl_num-1)*picminw;}
|
||||
$(can.pnum).find('ul').stop().animate({'left':mingdjl_w},can.delayTime);
|
||||
}
|
||||
|
||||
}else{
|
||||
$(can.pnum).find('ul li').css('float','none');
|
||||
if(picminnum>can.min_picnum){
|
||||
if(xtqhnum<3){mingdjl_h=0;}
|
||||
if(xtqhnum==picminnum-1){mingdjl_h=-(mingdjl_num-1)*picminh;}
|
||||
$(can.pnum).find('ul').stop().animate({'top':mingdjl_h},can.delayTime);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//大图切换过程
|
||||
function show(tpqhnum){
|
||||
var gdjl_w=-tpqhnum*picw;
|
||||
var gdjl_h=-tpqhnum*pich;
|
||||
if(can.picdire==true){
|
||||
$(can.pic).find('ul li').css('float','left');
|
||||
$(can.pic).find('ul').stop().animate({'left':gdjl_w},can.delayTime);
|
||||
}else{
|
||||
$(can.pic).find('ul').stop().animate({'top':gdjl_h},can.delayTime);
|
||||
}//滚动
|
||||
//$(can.pic).find('ul li').eq(tpqhnum).fadeIn(can.delayTime).siblings('li').fadeOut(can.delayTime);//淡入淡出
|
||||
$(can.pnum).find('li').eq(tpqhnum).addClass("on").siblings(this).removeClass("on");
|
||||
};
|
||||
//弹出框图片切换过程
|
||||
function popshow(popnum){
|
||||
var gdjl_w=-popnum*poppicw;
|
||||
$(can.pop_pic).find('ul').stop().animate({'left':gdjl_w},can.pop_delayTime);
|
||||
//$(can.pop_pic).find('ul li').eq(tpqhnum).fadeIn(can.pop_delayTime).siblings('li').fadeOut(can.pop_delayTime);//淡入淡出
|
||||
};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,424 @@
|
||||
function Init () {
|
||||
if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
|
||||
var wow = new WOW({
|
||||
boxClass: 'wow',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true,
|
||||
live: true
|
||||
});
|
||||
wow.init()
|
||||
}
|
||||
|
||||
backTop();
|
||||
}
|
||||
|
||||
// 导航栏
|
||||
function navHover () {
|
||||
var top = 0;
|
||||
$(window).scroll(function () {
|
||||
top = $(this).scrollTop()
|
||||
if ( top !== 0 ) {
|
||||
$('.header').css({'background': '#fff'})
|
||||
} else {
|
||||
$('.header').css({'background': 'none'})
|
||||
}
|
||||
});
|
||||
|
||||
$('.nav-list > li').on('mouseover', function () {
|
||||
if(top == 0) {
|
||||
$('.header').css({'background': '#fff'})
|
||||
}
|
||||
$('.header').css({'border-bottom': '1px solid #e9eaea'});
|
||||
var findRes = $(this).find('.sec-nav').length;
|
||||
var num = $('.sec-nav').length;
|
||||
if (findRes > 0) {
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.sec-nav').eq(i).slideUp();
|
||||
}
|
||||
if ($('.sec-nav').is(':visible')) {
|
||||
$(this).find('.sec-nav').stop().show();
|
||||
} else {
|
||||
$(this).find('.sec-nav').slideDown();
|
||||
}
|
||||
}else {
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.sec-nav').eq(i).slideUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.header').on('mouseleave', function () {
|
||||
$('.sec-nav').slideUp(function () {
|
||||
setTimeout(function () {
|
||||
if(top == 0) {
|
||||
$('.header').css({'background': 'none'})
|
||||
}
|
||||
$('.header').css({'border-bottom': '0'});
|
||||
}, 300)
|
||||
});
|
||||
})
|
||||
}
|
||||
function navHover1 () {
|
||||
var top = 0;
|
||||
$(window).scroll(function () {
|
||||
top = $(this).scrollTop();
|
||||
});
|
||||
|
||||
$('.nav-list > li').on('mouseover', function () {
|
||||
if(top == 0) {
|
||||
$('.header').css({'background': '#fff'})
|
||||
}
|
||||
$('.header').css({'border-bottom': '1px solid #e9eaea'});
|
||||
var findRes = $(this).find('.sec-nav').length;
|
||||
var num = $('.sec-nav').length;
|
||||
if (findRes > 0) {
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.sec-nav').eq(i).slideUp();
|
||||
}
|
||||
if ($('.sec-nav').is(':visible')) {
|
||||
$(this).find('.sec-nav').stop().show();
|
||||
} else {
|
||||
$(this).find('.sec-nav').slideDown();
|
||||
}
|
||||
}else {
|
||||
for (var i = 0; i < num; i++) {
|
||||
$('.sec-nav').eq(i).slideUp();
|
||||
}
|
||||
}
|
||||
});
|
||||
$('.header').on('mouseleave', function () {
|
||||
$('.sec-nav').slideUp(function () {
|
||||
setTimeout(function () {
|
||||
if(top == 0) {
|
||||
$('.header').css({'background': 'none'})
|
||||
}
|
||||
$('.header').css({'border-bottom': '0'});
|
||||
}, 300)
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 首页 工程案例
|
||||
function caseHover () {
|
||||
$('.case-list').on('mouseover', 'li', function () {
|
||||
$(this).find('.case-hover').removeClass('moveOut').addClass('moveIn')
|
||||
} ).on('mouseleave', 'li', function () {
|
||||
$(this).find('.case-hover').removeClass('moveIn').addClass('moveOut')
|
||||
})
|
||||
}
|
||||
|
||||
// 首页新品上市
|
||||
function newPro() {
|
||||
// 显示右边的详情图片
|
||||
var index = 0;
|
||||
$('.npr-r-box').eq(0).show();
|
||||
|
||||
// 判断有几个三个产品一列
|
||||
var line = $('.npr-l-list .npr-l-box').length;
|
||||
|
||||
// 每个产品的点击
|
||||
$(document).on('click', '.nprl-pic-box', function() {
|
||||
var picI = $(this).index();
|
||||
index = ($(this).parent('.npr-l-list').index() * 3) + picI;
|
||||
active($('.nprl-pic-box'), 'new-pro-on', picI);
|
||||
var num = $('.npr-r-box').length;
|
||||
for(var i=0; i<num; i++) {
|
||||
$('.npr-r-box').eq(i).hide();
|
||||
}
|
||||
$('.npr-r-box').eq(index).show();
|
||||
wowAni();
|
||||
});
|
||||
|
||||
// 左右切换
|
||||
var click = 0;
|
||||
var animated = 0;
|
||||
$(document).on('click', '.npr-prev', function () {
|
||||
if(click == 0) {
|
||||
return;
|
||||
}
|
||||
// 判断大的box的是不是停留在初始的位置
|
||||
left = $('.npr-l-list')[0].offsetLeft;
|
||||
if(animated == 0) {
|
||||
animated = 1;
|
||||
if(top != 0) {
|
||||
click = (--click < 0)?0:click;
|
||||
$('.npr-l-list').animate({'left': -(click * 240) + 'px'}, 500, function() {
|
||||
animated = 0;
|
||||
});
|
||||
proOn(click);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.npr-next', function() {
|
||||
if(click == (line - 1)) {
|
||||
return;
|
||||
}
|
||||
if(animated == 0) {
|
||||
animated = 1;
|
||||
if(line > 1) {
|
||||
click = (++click > (line - 1))?(line - 1):click;
|
||||
$('.npr-l-list').animate({'left': -(click * 240) + 'px'}, 500, function() {
|
||||
animated = 0;
|
||||
});
|
||||
// 图片切换的时候,on对象跟着变,右边的图片详情页跟着变
|
||||
proOn(click);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 左右切换的时候,右边图片自动定位到相对应的产品
|
||||
function proOn(aIndex) {
|
||||
var num = $('.nprl-pic-box').length;
|
||||
for(var i=0; i<num; i++) {
|
||||
$('.nprl-pic-box').eq(i).removeClass('new-pro-on');
|
||||
$('.npr-r-box').eq(i).hide();
|
||||
}
|
||||
$('.npr-l-box').eq(aIndex).find('.nprl-pic-box').eq(0).addClass('new-pro-on');
|
||||
index = aIndex * 3;
|
||||
$('.npr-r-box').eq(index).show();
|
||||
wowAni();
|
||||
}
|
||||
// 重新调用动画
|
||||
function wowAni() {
|
||||
if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))) {
|
||||
var wow = new WOW({
|
||||
boxClass: 'npr-ani',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true,
|
||||
live: true
|
||||
});
|
||||
wow.init()
|
||||
}
|
||||
}
|
||||
|
||||
// 检测浏览器是否在ie8或者ie9下,显示输入框的提示
|
||||
function labelShow(formEle) {
|
||||
if(navigator.userAgent.indexOf("MSIE 8.0")>0 || navigator.userAgent.indexOf("MSIE 9.0")>0) {
|
||||
console.log('ie');
|
||||
formEle.find('label').css({'display':'block'});
|
||||
formEle.find('label').on('click', function() {
|
||||
$(this).parent('form').find('input').focus();
|
||||
});
|
||||
formEle.find('input').on('keyup', function() {
|
||||
if($(this).val().length == 0) {
|
||||
$(this).parent('form').find('label').css({'display':'block'});
|
||||
}else {
|
||||
$(this).parent('form').find('label').css({'display':'none'});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 人才招聘 动画
|
||||
function job() {
|
||||
$('.job-detail').stop().slideDown('slow');
|
||||
}
|
||||
function jobClose() {
|
||||
$('.job-detail').stop().slideUp('slow');
|
||||
}
|
||||
|
||||
// 问卷调查
|
||||
function btn() {
|
||||
$('.check-box a').attr('data-click',0);
|
||||
$('.qt').on('click', 'a', function() {
|
||||
var index = $(this).parent('p').parent('dd').parent('dl').index();
|
||||
var type = $(this).parent('p').parent('dd').attr('class');
|
||||
switch(type) {
|
||||
case 'radio':
|
||||
num = $(this).parent('p').parent('dd').parent('dl').find('a').length;
|
||||
for(var i=0; i<num; i++) {
|
||||
$('.qt').eq(index).find('a').eq(i).removeClass('radio-click');
|
||||
}
|
||||
$(this).addClass('radio-click');
|
||||
break;
|
||||
case 'check-box':
|
||||
if($(this).attr('data-click') == 0) {
|
||||
$(this).addClass('cb-click').attr('data-click',1);
|
||||
}else {
|
||||
$(this).removeClass('cb-click').attr('data-click',0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
function cj() {
|
||||
var check = false;
|
||||
var num = $('.qt').length;
|
||||
var qtNum = [];
|
||||
for(var i=0; i<num; i++) {
|
||||
var type = $('.qt').eq(i).find('dd').attr('class');
|
||||
switch(type) {
|
||||
case 'radio':
|
||||
length = $('.qt').eq(i).find('.radio-click').length;
|
||||
if(length == 1) {
|
||||
check = true;
|
||||
}else {
|
||||
check = false;
|
||||
}
|
||||
break;
|
||||
case 'check-box':
|
||||
length = $('.qt').eq(i).find('.cb-click').length;
|
||||
if(length >= 1) {
|
||||
check = true;
|
||||
}else {
|
||||
check = false;
|
||||
}
|
||||
break;
|
||||
case 'num':
|
||||
var val = $('.num input').val();
|
||||
if(val != '' && isNaN(val) == false) {
|
||||
check = true;
|
||||
}else {
|
||||
check = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
qtNum.push({'num':i,'res':check});
|
||||
console.log(qtNum[i]);
|
||||
}
|
||||
forNum = 0;
|
||||
for(var i=0; i<num; i++) {
|
||||
if(qtNum[i].res == false) {
|
||||
forNum++;
|
||||
alert('请填写完整');
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(forNum == 0) {
|
||||
$('.choujiang').stop().slideDown('slow');
|
||||
$(window).scrollTop(600);
|
||||
}
|
||||
}
|
||||
function cjClose() {
|
||||
$('.choujiang').stop().slideUp('slow');
|
||||
}
|
||||
|
||||
/**
|
||||
* 回到顶部
|
||||
*/
|
||||
function backTop() {
|
||||
top = $(window).scrollTop();
|
||||
if(top != 0) {
|
||||
$('html,body').animate({scrollTop: 0},300);
|
||||
}
|
||||
}
|
||||
function showBackTop() {
|
||||
var top = 0;
|
||||
$(window).scroll(function() {
|
||||
top = $(this).scrollTop();
|
||||
if(top > 200) {
|
||||
$('.backTop-box').show();
|
||||
}else {
|
||||
$('.backTop-box').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 新闻列表切换
|
||||
function newsTab(index) {
|
||||
var num = $('.news-tab li').length;
|
||||
for(var i=0; i<num; i++) {
|
||||
$('.news-list-box').eq(i).hide();
|
||||
}
|
||||
$('.news-list-box').eq(index).show();
|
||||
active($('.news-tab li'), 'news-tab-on', index);
|
||||
}
|
||||
|
||||
// 下拉,上移动画
|
||||
function show(ele, index) {
|
||||
var num = ele.length
|
||||
for(var i=0; i<num; i++) {
|
||||
ele.eq(i).stop().slideUp('slow')
|
||||
}
|
||||
ele.eq(index).stop().slideDown('slow')
|
||||
}
|
||||
|
||||
// 当前active
|
||||
function active (ele, active, index) {
|
||||
var num = ele.length
|
||||
for (var i=0; i<num; i++) {
|
||||
ele.eq(i).removeClass(active)
|
||||
}
|
||||
ele.eq(index).addClass(active)
|
||||
}
|
||||
|
||||
function showTan(){
|
||||
$(".viap_tan").animate({top:'0px'});
|
||||
$(".viap_tan_content").animate({top:'50%'});
|
||||
}
|
||||
function closeTan(){
|
||||
$(".viap_tan").animate({top:'-100%'});
|
||||
$(".viap_tan_content").animate({top:'-100%'});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var temp = 1;
|
||||
var n = $(".header_daohan ul li").length;
|
||||
var m = n - 7;
|
||||
if (n > 7) {
|
||||
for (var j = 0; j < m; j++) {
|
||||
$(".header_daohan ul li").eq(7 + j).hide();
|
||||
}
|
||||
$(".header_menu").click(function () {
|
||||
if (temp == 1) {
|
||||
for (var j = 0; j < m; j++) {
|
||||
$(".header_daohan ul li").eq(j).hide();
|
||||
}
|
||||
for (var j = 0; j < m; j++) {
|
||||
$(".header_daohan ul li").eq(7 + j).show();
|
||||
}
|
||||
|
||||
temp = 2;
|
||||
} else {
|
||||
for (var j = 0; j < m; j++) {
|
||||
$(".header_daohan ul li").eq(j).show();
|
||||
}
|
||||
for (var j = 0; j < m; j++) {
|
||||
$(".header_daohan ul li").eq(7 + j).hide();
|
||||
}
|
||||
temp = 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function topSearch() {
|
||||
var key = $("#key").val();
|
||||
if (!key || key == "") {
|
||||
alert('请输入搜索关键字');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('.header_search').click(function () {
|
||||
$('.search_form').toggleClass('open');
|
||||
return false;
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,353 @@
|
||||
/* Respond.js: min/max-width media query polyfill. (c) Scott Jehl. MIT Lic. j.mp/respondjs */
|
||||
(function( w ){
|
||||
|
||||
"use strict";
|
||||
|
||||
//exposed namespace
|
||||
var respond = {};
|
||||
w.respond = respond;
|
||||
|
||||
//define update even in native-mq-supporting browsers, to avoid errors
|
||||
respond.update = function(){};
|
||||
|
||||
//define ajax obj
|
||||
var requestQueue = [],
|
||||
xmlHttp = (function() {
|
||||
var xmlhttpmethod = false;
|
||||
try {
|
||||
xmlhttpmethod = new w.XMLHttpRequest();
|
||||
}
|
||||
catch( e ){
|
||||
xmlhttpmethod = new w.ActiveXObject( "Microsoft.XMLHTTP" );
|
||||
}
|
||||
return function(){
|
||||
return xmlhttpmethod;
|
||||
};
|
||||
})(),
|
||||
|
||||
//tweaked Ajax functions from Quirksmode
|
||||
ajax = function( url, callback ) {
|
||||
var req = xmlHttp();
|
||||
if (!req){
|
||||
return;
|
||||
}
|
||||
req.open( "GET", url, true );
|
||||
req.onreadystatechange = function () {
|
||||
if ( req.readyState !== 4 || req.status !== 200 && req.status !== 304 ){
|
||||
return;
|
||||
}
|
||||
callback( req.responseText );
|
||||
};
|
||||
if ( req.readyState === 4 ){
|
||||
return;
|
||||
}
|
||||
req.send( null );
|
||||
},
|
||||
isUnsupportedMediaQuery = function( query ) {
|
||||
return query.replace( respond.regex.minmaxwh, '' ).match( respond.regex.other );
|
||||
};
|
||||
|
||||
//expose for testing
|
||||
respond.ajax = ajax;
|
||||
respond.queue = requestQueue;
|
||||
respond.unsupportedmq = isUnsupportedMediaQuery;
|
||||
respond.regex = {
|
||||
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
|
||||
keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
|
||||
comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
|
||||
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
|
||||
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
|
||||
only: /(only\s+)?([a-zA-Z]+)\s?/,
|
||||
minw: /\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
|
||||
maxw: /\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
|
||||
minmaxwh: /\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,
|
||||
other: /\([^\)]*\)/g
|
||||
};
|
||||
|
||||
//expose media query support flag for external use
|
||||
respond.mediaQueriesSupported = w.matchMedia && w.matchMedia( "only all" ) !== null && w.matchMedia( "only all" ).matches;
|
||||
|
||||
//if media queries are supported, exit here
|
||||
if( respond.mediaQueriesSupported ){
|
||||
return;
|
||||
}
|
||||
|
||||
//define vars
|
||||
var doc = w.document,
|
||||
docElem = doc.documentElement,
|
||||
mediastyles = [],
|
||||
rules = [],
|
||||
appendedEls = [],
|
||||
parsedSheets = {},
|
||||
resizeThrottle = 30,
|
||||
head = doc.getElementsByTagName( "head" )[0] || docElem,
|
||||
base = doc.getElementsByTagName( "base" )[0],
|
||||
links = head.getElementsByTagName( "link" ),
|
||||
|
||||
lastCall,
|
||||
resizeDefer,
|
||||
|
||||
//cached container for 1em value, populated the first time it's needed
|
||||
eminpx,
|
||||
|
||||
// returns the value of 1em in pixels
|
||||
getEmValue = function() {
|
||||
var ret,
|
||||
div = doc.createElement('div'),
|
||||
body = doc.body,
|
||||
originalHTMLFontSize = docElem.style.fontSize,
|
||||
originalBodyFontSize = body && body.style.fontSize,
|
||||
fakeUsed = false;
|
||||
|
||||
div.style.cssText = "position:absolute;font-size:1em;width:1em";
|
||||
|
||||
if( !body ){
|
||||
body = fakeUsed = doc.createElement( "body" );
|
||||
body.style.background = "none";
|
||||
}
|
||||
|
||||
// 1em in a media query is the value of the default font size of the browser
|
||||
// reset docElem and body to ensure the correct value is returned
|
||||
docElem.style.fontSize = "100%";
|
||||
body.style.fontSize = "100%";
|
||||
|
||||
body.appendChild( div );
|
||||
|
||||
if( fakeUsed ){
|
||||
docElem.insertBefore( body, docElem.firstChild );
|
||||
}
|
||||
|
||||
ret = div.offsetWidth;
|
||||
|
||||
if( fakeUsed ){
|
||||
docElem.removeChild( body );
|
||||
}
|
||||
else {
|
||||
body.removeChild( div );
|
||||
}
|
||||
|
||||
// restore the original values
|
||||
docElem.style.fontSize = originalHTMLFontSize;
|
||||
if( originalBodyFontSize ) {
|
||||
body.style.fontSize = originalBodyFontSize;
|
||||
}
|
||||
|
||||
|
||||
//also update eminpx before returning
|
||||
ret = eminpx = parseFloat(ret);
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
//enable/disable styles
|
||||
applyMedia = function( fromResize ){
|
||||
var name = "clientWidth",
|
||||
docElemProp = docElem[ name ],
|
||||
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
|
||||
styleBlocks = {},
|
||||
lastLink = links[ links.length-1 ],
|
||||
now = (new Date()).getTime();
|
||||
|
||||
//throttle resize calls
|
||||
if( fromResize && lastCall && now - lastCall < resizeThrottle ){
|
||||
w.clearTimeout( resizeDefer );
|
||||
resizeDefer = w.setTimeout( applyMedia, resizeThrottle );
|
||||
return;
|
||||
}
|
||||
else {
|
||||
lastCall = now;
|
||||
}
|
||||
|
||||
for( var i in mediastyles ){
|
||||
if( mediastyles.hasOwnProperty( i ) ){
|
||||
var thisstyle = mediastyles[ i ],
|
||||
min = thisstyle.minw,
|
||||
max = thisstyle.maxw,
|
||||
minnull = min === null,
|
||||
maxnull = max === null,
|
||||
em = "em";
|
||||
|
||||
if( !!min ){
|
||||
min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
if( !!max ){
|
||||
max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
|
||||
// if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
|
||||
if( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
|
||||
if( !styleBlocks[ thisstyle.media ] ){
|
||||
styleBlocks[ thisstyle.media ] = [];
|
||||
}
|
||||
styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//remove any existing respond style element(s)
|
||||
for( var j in appendedEls ){
|
||||
if( appendedEls.hasOwnProperty( j ) ){
|
||||
if( appendedEls[ j ] && appendedEls[ j ].parentNode === head ){
|
||||
head.removeChild( appendedEls[ j ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
appendedEls.length = 0;
|
||||
|
||||
//inject active styles, grouped by media type
|
||||
for( var k in styleBlocks ){
|
||||
if( styleBlocks.hasOwnProperty( k ) ){
|
||||
var ss = doc.createElement( "style" ),
|
||||
css = styleBlocks[ k ].join( "\n" );
|
||||
|
||||
ss.type = "text/css";
|
||||
ss.media = k;
|
||||
|
||||
//originally, ss was appended to a documentFragment and sheets were appended in bulk.
|
||||
//this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
|
||||
head.insertBefore( ss, lastLink.nextSibling );
|
||||
|
||||
if ( ss.styleSheet ){
|
||||
ss.styleSheet.cssText = css;
|
||||
}
|
||||
else {
|
||||
ss.appendChild( doc.createTextNode( css ) );
|
||||
}
|
||||
|
||||
//push to appendedEls to track for later removal
|
||||
appendedEls.push( ss );
|
||||
}
|
||||
}
|
||||
},
|
||||
//find media blocks in css text, convert to style blocks
|
||||
translate = function( styles, href, media ){
|
||||
var qs = styles.replace( respond.regex.comments, '' )
|
||||
.replace( respond.regex.keyframes, '' )
|
||||
.match( respond.regex.media ),
|
||||
ql = qs && qs.length || 0;
|
||||
|
||||
//try to get CSS path
|
||||
href = href.substring( 0, href.lastIndexOf( "/" ) );
|
||||
|
||||
var repUrls = function( css ){
|
||||
return css.replace( respond.regex.urls, "$1" + href + "$2$3" );
|
||||
},
|
||||
useMedia = !ql && media;
|
||||
|
||||
//if path exists, tack on trailing slash
|
||||
if( href.length ){ href += "/"; }
|
||||
|
||||
//if no internal queries exist, but media attr does, use that
|
||||
//note: this currently lacks support for situations where a media attr is specified on a link AND
|
||||
//its associated stylesheet has internal CSS media queries.
|
||||
//In those cases, the media attribute will currently be ignored.
|
||||
if( useMedia ){
|
||||
ql = 1;
|
||||
}
|
||||
|
||||
for( var i = 0; i < ql; i++ ){
|
||||
var fullq, thisq, eachq, eql;
|
||||
|
||||
//media attr
|
||||
if( useMedia ){
|
||||
fullq = media;
|
||||
rules.push( repUrls( styles ) );
|
||||
}
|
||||
//parse for styles
|
||||
else{
|
||||
fullq = qs[ i ].match( respond.regex.findStyles ) && RegExp.$1;
|
||||
rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
|
||||
}
|
||||
|
||||
eachq = fullq.split( "," );
|
||||
eql = eachq.length;
|
||||
|
||||
for( var j = 0; j < eql; j++ ){
|
||||
thisq = eachq[ j ];
|
||||
|
||||
if( isUnsupportedMediaQuery( thisq ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
mediastyles.push( {
|
||||
media : thisq.split( "(" )[ 0 ].match( respond.regex.only ) && RegExp.$2 || "all",
|
||||
rules : rules.length - 1,
|
||||
hasquery : thisq.indexOf("(") > -1,
|
||||
minw : thisq.match( respond.regex.minw ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
|
||||
maxw : thisq.match( respond.regex.maxw ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
applyMedia();
|
||||
},
|
||||
|
||||
//recurse through request queue, get css text
|
||||
makeRequests = function(){
|
||||
if( requestQueue.length ){
|
||||
var thisRequest = requestQueue.shift();
|
||||
|
||||
ajax( thisRequest.href, function( styles ){
|
||||
translate( styles, thisRequest.href, thisRequest.media );
|
||||
parsedSheets[ thisRequest.href ] = true;
|
||||
|
||||
// by wrapping recursive function call in setTimeout
|
||||
// we prevent "Stack overflow" error in IE7
|
||||
w.setTimeout(function(){ makeRequests(); },0);
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
//loop stylesheets, send text content to translate
|
||||
ripCSS = function(){
|
||||
|
||||
for( var i = 0; i < links.length; i++ ){
|
||||
var sheet = links[ i ],
|
||||
href = sheet.href,
|
||||
media = sheet.media,
|
||||
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
|
||||
|
||||
//only links plz and prevent re-parsing
|
||||
if( !!href && isCSS && !parsedSheets[ href ] ){
|
||||
// selectivizr exposes css through the rawCssText expando
|
||||
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
|
||||
translate( sheet.styleSheet.rawCssText, href, media );
|
||||
parsedSheets[ href ] = true;
|
||||
} else {
|
||||
if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base) ||
|
||||
href.replace( RegExp.$1, "" ).split( "/" )[0] === w.location.host ){
|
||||
// IE7 doesn't handle urls that start with '//' for ajax request
|
||||
// manually add in the protocol
|
||||
if ( href.substring(0,2) === "//" ) { href = w.location.protocol + href; }
|
||||
requestQueue.push( {
|
||||
href: href,
|
||||
media: media
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
makeRequests();
|
||||
};
|
||||
|
||||
//translate CSS
|
||||
ripCSS();
|
||||
|
||||
//expose update for re-running respond later on
|
||||
respond.update = ripCSS;
|
||||
|
||||
//expose getEmValue
|
||||
respond.getEmValue = getEmValue;
|
||||
|
||||
//adjust on resize
|
||||
function callMedia(){
|
||||
applyMedia( true );
|
||||
}
|
||||
|
||||
if( w.addEventListener ){
|
||||
w.addEventListener( "resize", callMedia, false );
|
||||
}
|
||||
else if( w.attachEvent ){
|
||||
w.attachEvent( "onresize", callMedia );
|
||||
}
|
||||
})(this);
|
||||
@@ -0,0 +1,237 @@
|
||||
/*! Respond.js v1.4.2: min/max-width media query polyfill
|
||||
* Copyright 2014 Scott Jehl
|
||||
* Licensed under MIT
|
||||
* http://j.mp/respondjs */
|
||||
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
(function(w) {
|
||||
"use strict";
|
||||
w.matchMedia = w.matchMedia || function(doc, undefined) {
|
||||
var bool, docElem = doc.documentElement, refNode = docElem.firstElementChild || docElem.firstChild, fakeBody = doc.createElement("body"), div = doc.createElement("div");
|
||||
div.id = "mq-test-1";
|
||||
div.style.cssText = "position:absolute;top:-100em";
|
||||
fakeBody.style.background = "none";
|
||||
fakeBody.appendChild(div);
|
||||
return function(q) {
|
||||
div.innerHTML = '­<style media="' + q + '"> #mq-test-1 { width: 42px; }</style>';
|
||||
docElem.insertBefore(fakeBody, refNode);
|
||||
bool = div.offsetWidth === 42;
|
||||
docElem.removeChild(fakeBody);
|
||||
return {
|
||||
matches: bool,
|
||||
media: q
|
||||
};
|
||||
};
|
||||
}(w.document);
|
||||
})(this);
|
||||
|
||||
(function(w) {
|
||||
"use strict";
|
||||
var respond = {};
|
||||
w.respond = respond;
|
||||
respond.update = function() {};
|
||||
var requestQueue = [], xmlHttp = function() {
|
||||
var xmlhttpmethod = false;
|
||||
try {
|
||||
xmlhttpmethod = new w.XMLHttpRequest();
|
||||
} catch (e) {
|
||||
xmlhttpmethod = new w.ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
return function() {
|
||||
return xmlhttpmethod;
|
||||
};
|
||||
}(), ajax = function(url, callback) {
|
||||
var req = xmlHttp();
|
||||
if (!req) {
|
||||
return;
|
||||
}
|
||||
req.open("GET", url, true);
|
||||
req.onreadystatechange = function() {
|
||||
if (req.readyState !== 4 || req.status !== 200 && req.status !== 304) {
|
||||
return;
|
||||
}
|
||||
callback(req.responseText);
|
||||
};
|
||||
if (req.readyState === 4) {
|
||||
return;
|
||||
}
|
||||
req.send(null);
|
||||
}, isUnsupportedMediaQuery = function(query) {
|
||||
return query.replace(respond.regex.minmaxwh, "").match(respond.regex.other);
|
||||
};
|
||||
respond.ajax = ajax;
|
||||
respond.queue = requestQueue;
|
||||
respond.unsupportedmq = isUnsupportedMediaQuery;
|
||||
respond.regex = {
|
||||
media: /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,
|
||||
keyframes: /@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,
|
||||
comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
|
||||
urls: /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,
|
||||
findStyles: /@media *([^\{]+)\{([\S\s]+?)$/,
|
||||
only: /(only\s+)?([a-zA-Z]+)\s?/,
|
||||
minw: /\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
|
||||
maxw: /\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,
|
||||
minmaxwh: /\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,
|
||||
other: /\([^\)]*\)/g
|
||||
};
|
||||
respond.mediaQueriesSupported = w.matchMedia && w.matchMedia("only all") !== null && w.matchMedia("only all").matches;
|
||||
if (respond.mediaQueriesSupported) {
|
||||
return;
|
||||
}
|
||||
var doc = w.document, docElem = doc.documentElement, mediastyles = [], rules = [], appendedEls = [], parsedSheets = {}, resizeThrottle = 30, head = doc.getElementsByTagName("head")[0] || docElem, base = doc.getElementsByTagName("base")[0], links = head.getElementsByTagName("link"), lastCall, resizeDefer, eminpx, getEmValue = function() {
|
||||
var ret, div = doc.createElement("div"), body = doc.body, originalHTMLFontSize = docElem.style.fontSize, originalBodyFontSize = body && body.style.fontSize, fakeUsed = false;
|
||||
div.style.cssText = "position:absolute;font-size:1em;width:1em";
|
||||
if (!body) {
|
||||
body = fakeUsed = doc.createElement("body");
|
||||
body.style.background = "none";
|
||||
}
|
||||
docElem.style.fontSize = "100%";
|
||||
body.style.fontSize = "100%";
|
||||
body.appendChild(div);
|
||||
if (fakeUsed) {
|
||||
docElem.insertBefore(body, docElem.firstChild);
|
||||
}
|
||||
ret = div.offsetWidth;
|
||||
if (fakeUsed) {
|
||||
docElem.removeChild(body);
|
||||
} else {
|
||||
body.removeChild(div);
|
||||
}
|
||||
docElem.style.fontSize = originalHTMLFontSize;
|
||||
if (originalBodyFontSize) {
|
||||
body.style.fontSize = originalBodyFontSize;
|
||||
}
|
||||
ret = eminpx = parseFloat(ret);
|
||||
return ret;
|
||||
}, applyMedia = function(fromResize) {
|
||||
var name = "clientWidth", docElemProp = docElem[name], currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[name] || docElemProp, styleBlocks = {}, lastLink = links[links.length - 1], now = new Date().getTime();
|
||||
if (fromResize && lastCall && now - lastCall < resizeThrottle) {
|
||||
w.clearTimeout(resizeDefer);
|
||||
resizeDefer = w.setTimeout(applyMedia, resizeThrottle);
|
||||
return;
|
||||
} else {
|
||||
lastCall = now;
|
||||
}
|
||||
for (var i in mediastyles) {
|
||||
if (mediastyles.hasOwnProperty(i)) {
|
||||
var thisstyle = mediastyles[i], min = thisstyle.minw, max = thisstyle.maxw, minnull = min === null, maxnull = max === null, em = "em";
|
||||
if (!!min) {
|
||||
min = parseFloat(min) * (min.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
|
||||
}
|
||||
if (!!max) {
|
||||
max = parseFloat(max) * (max.indexOf(em) > -1 ? eminpx || getEmValue() : 1);
|
||||
}
|
||||
if (!thisstyle.hasquery || (!minnull || !maxnull) && (minnull || currWidth >= min) && (maxnull || currWidth <= max)) {
|
||||
if (!styleBlocks[thisstyle.media]) {
|
||||
styleBlocks[thisstyle.media] = [];
|
||||
}
|
||||
styleBlocks[thisstyle.media].push(rules[thisstyle.rules]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var j in appendedEls) {
|
||||
if (appendedEls.hasOwnProperty(j)) {
|
||||
if (appendedEls[j] && appendedEls[j].parentNode === head) {
|
||||
head.removeChild(appendedEls[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
appendedEls.length = 0;
|
||||
for (var k in styleBlocks) {
|
||||
if (styleBlocks.hasOwnProperty(k)) {
|
||||
var ss = doc.createElement("style"), css = styleBlocks[k].join("\n");
|
||||
ss.type = "text/css";
|
||||
ss.media = k;
|
||||
head.insertBefore(ss, lastLink.nextSibling);
|
||||
if (ss.styleSheet) {
|
||||
ss.styleSheet.cssText = css;
|
||||
} else {
|
||||
ss.appendChild(doc.createTextNode(css));
|
||||
}
|
||||
appendedEls.push(ss);
|
||||
}
|
||||
}
|
||||
}, translate = function(styles, href, media) {
|
||||
var qs = styles.replace(respond.regex.comments, "").replace(respond.regex.keyframes, "").match(respond.regex.media), ql = qs && qs.length || 0;
|
||||
href = href.substring(0, href.lastIndexOf("/"));
|
||||
var repUrls = function(css) {
|
||||
return css.replace(respond.regex.urls, "$1" + href + "$2$3");
|
||||
}, useMedia = !ql && media;
|
||||
if (href.length) {
|
||||
href += "/";
|
||||
}
|
||||
if (useMedia) {
|
||||
ql = 1;
|
||||
}
|
||||
for (var i = 0; i < ql; i++) {
|
||||
var fullq, thisq, eachq, eql;
|
||||
if (useMedia) {
|
||||
fullq = media;
|
||||
rules.push(repUrls(styles));
|
||||
} else {
|
||||
fullq = qs[i].match(respond.regex.findStyles) && RegExp.$1;
|
||||
rules.push(RegExp.$2 && repUrls(RegExp.$2));
|
||||
}
|
||||
eachq = fullq.split(",");
|
||||
eql = eachq.length;
|
||||
for (var j = 0; j < eql; j++) {
|
||||
thisq = eachq[j];
|
||||
if (isUnsupportedMediaQuery(thisq)) {
|
||||
continue;
|
||||
}
|
||||
mediastyles.push({
|
||||
media: thisq.split("(")[0].match(respond.regex.only) && RegExp.$2 || "all",
|
||||
rules: rules.length - 1,
|
||||
hasquery: thisq.indexOf("(") > -1,
|
||||
minw: thisq.match(respond.regex.minw) && parseFloat(RegExp.$1) + (RegExp.$2 || ""),
|
||||
maxw: thisq.match(respond.regex.maxw) && parseFloat(RegExp.$1) + (RegExp.$2 || "")
|
||||
});
|
||||
}
|
||||
}
|
||||
applyMedia();
|
||||
}, makeRequests = function() {
|
||||
if (requestQueue.length) {
|
||||
var thisRequest = requestQueue.shift();
|
||||
ajax(thisRequest.href, function(styles) {
|
||||
translate(styles, thisRequest.href, thisRequest.media);
|
||||
parsedSheets[thisRequest.href] = true;
|
||||
w.setTimeout(function() {
|
||||
makeRequests();
|
||||
}, 0);
|
||||
});
|
||||
}
|
||||
}, ripCSS = function() {
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
var sheet = links[i], href = sheet.href, media = sheet.media, isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
|
||||
if (!!href && isCSS && !parsedSheets[href]) {
|
||||
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
|
||||
translate(sheet.styleSheet.rawCssText, href, media);
|
||||
parsedSheets[href] = true;
|
||||
} else {
|
||||
if (!/^([a-zA-Z:]*\/\/)/.test(href) && !base || href.replace(RegExp.$1, "").split("/")[0] === w.location.host) {
|
||||
if (href.substring(0, 2) === "//") {
|
||||
href = w.location.protocol + href;
|
||||
}
|
||||
requestQueue.push({
|
||||
href: href,
|
||||
media: media
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
makeRequests();
|
||||
};
|
||||
ripCSS();
|
||||
respond.update = ripCSS;
|
||||
respond.getEmValue = getEmValue;
|
||||
function callMedia() {
|
||||
applyMedia(true);
|
||||
}
|
||||
if (w.addEventListener) {
|
||||
w.addEventListener("resize", callMedia, false);
|
||||
} else if (w.attachEvent) {
|
||||
w.attachEvent("onresize", callMedia);
|
||||
}
|
||||
})(this);
|
||||
@@ -0,0 +1,341 @@
|
||||
//所有异步提交 formId 不需要加上# last:2015-11-12 by Hogen Wang
|
||||
//依赖jquery jquery.form jquery.validate jquery.metadata
|
||||
function DoPost(formId, rules, messages) {
|
||||
//提交地址
|
||||
var $myform = $("#" + formId);
|
||||
var url = $myform.attr("action");
|
||||
var btn;
|
||||
if ($myform.find("input[type='submit']").length > 0) {
|
||||
btn = $myform.find("input[type='submit']");
|
||||
} else if ($myform.find("button[type='submit']").length > 0) {
|
||||
btn = $myform.find("button[type='submit']");
|
||||
}
|
||||
//alert(queryString);
|
||||
var v = $myform.validate({
|
||||
rules: rules,
|
||||
messages: messages,
|
||||
submitHandler: function (form) {
|
||||
//loadding效果
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
|
||||
btn.attr("disabled", "disabled");
|
||||
//执行loadding 并且ajax提交
|
||||
//如果是有CKEditor的话,需要update,否则取不到值
|
||||
if (window.CKEDITOR) {
|
||||
for (instance in CKEDITOR.instances)
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
var queryString = $myform.formSerialize();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: queryString,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
//alert(data.message);
|
||||
//window.location.href= data.returnUrl;
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
//alert(data.returnUrl);
|
||||
if (data.returnUrl) {
|
||||
if (data.returnUrl == "close") {
|
||||
var dindex = parent.layer.getFrameIndex(window.name);
|
||||
if (dindex) {
|
||||
parent.layer.close(dindex);
|
||||
var current = top.$(".page-tabs-content .active").attr("data-id");
|
||||
var target = top.$('.J_iframe[data-id="' + current + '"]');
|
||||
if (target[0].contentWindow.reloadlist) {
|
||||
target[0].contentWindow.reloadlist();
|
||||
}
|
||||
else if (target[0].contentWindow.doSearch) {
|
||||
target[0].contentWindow.doSearch();
|
||||
}
|
||||
else if (target[0].contentWindow.refresh) {
|
||||
target[0].contentWindow.refresh();
|
||||
}
|
||||
else {
|
||||
top.refreshCurrentTab();
|
||||
}
|
||||
} else {
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
}
|
||||
else if (data.returnUrl == "closeandreload") {
|
||||
var dindex = parent.layer.getFrameIndex(window.name);
|
||||
if (dindex) {
|
||||
//top.refreshCurrentTab();
|
||||
//刷新页面列表 如果有就刷新,没有就刷新整个界面
|
||||
var current = top.$(".page-tabs-content .active").attr("data-id");
|
||||
var target = top.$('.J_iframe[data-id="' + current + '"]');
|
||||
if (target[0].contentWindow.reloadlist) {
|
||||
target[0].contentWindow.reloadlist();
|
||||
}
|
||||
else if (target[0].contentWindow.doSearch) {
|
||||
target[0].contentWindow.doSearch();
|
||||
}
|
||||
else if (target[0].contentWindow.refresh) {
|
||||
target[0].contentWindow.refresh();
|
||||
}
|
||||
else {
|
||||
top.refreshCurrentTab();
|
||||
}
|
||||
parent.layer.close(dindex);
|
||||
}
|
||||
}
|
||||
else {
|
||||
window.location.href = data.returnUrl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
btn.removeAttr("disabled");
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
btn.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//后台异步删除
|
||||
function doDel(url, id) {
|
||||
layer.confirm('确认要删除当前记录?此操作不可恢复!', {
|
||||
icon: 3,
|
||||
title: '系统提示',
|
||||
btn: ['确定', '取消 '] //按钮
|
||||
}, function () {
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: 'id=' + id,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
if ($("#row_" + id).length > 0) {
|
||||
$("#row_" + id).fadeOut(300).remove();
|
||||
} else {
|
||||
//window.location.href = window.location.href;
|
||||
var dindex = parent.layer.getFrameIndex(window.name);
|
||||
if (dindex) {
|
||||
layer.close(dindex);
|
||||
return;
|
||||
}
|
||||
if (top.toplayerindex) {
|
||||
//window.location.href = window.location.href;
|
||||
} else {
|
||||
top.refreshCurrentTab();//刷新本tab
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
});
|
||||
}
|
||||
//执行添加
|
||||
function doAdd(formid, url) {
|
||||
var strQuery = $("#" + formid + " .addnew").fieldSerialize();
|
||||
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: strQuery,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}
|
||||
//执行异步编辑
|
||||
function doEdit(formid, url, id) {
|
||||
var strQuery = $("#" + formid + " #row_" + id + " .rt-edit").fieldSerialize();
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: strQuery,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//后台异步提示操作
|
||||
function doAction(url, id, tiptitle) {
|
||||
layer.confirm(tiptitle, {
|
||||
icon: 3,
|
||||
title: '系统提示',
|
||||
btn: ['确定', '取消 '] //按钮
|
||||
}, function () {
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: 'id=' + id,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
//window.location.href = window.location.href;
|
||||
if (index) {
|
||||
window.location.href = window.location.href;
|
||||
} else {
|
||||
//判断是否是列表
|
||||
var current = top.$(".page-tabs-content .active").attr("data-id");
|
||||
var target = top.$('.J_iframe[data-id="' + current + '"]');
|
||||
if (target[0].contentWindow.doSearch) {
|
||||
target[0].contentWindow.doSearch();
|
||||
} else {
|
||||
refreshCurrentTab();
|
||||
}
|
||||
//refreshCurrentTab();//刷新本tab
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
});
|
||||
}
|
||||
|
||||
function DoAdminLogin(formId, rules, messages) {
|
||||
//提交地址
|
||||
var $myform = $("#" + formId);
|
||||
var url = $myform.attr("action");
|
||||
var rvtoken = $("input[name='__RequestVerificationToken']").val();
|
||||
var btn;
|
||||
if ($myform.find("input[type='submit']").length > 0) {
|
||||
btn = $myform.find("input[type='submit']");
|
||||
} else if ($myform.find("button[type='submit']").length > 0) {
|
||||
btn = $myform.find("button[type='submit']");
|
||||
}
|
||||
//alert(queryString);
|
||||
var v = $myform.validate({
|
||||
rules: rules,
|
||||
messages: messages,
|
||||
submitHandler: function (form) {
|
||||
//loadding效果
|
||||
var loading = layer.load(0, {
|
||||
shade: [0.2, '#000'] //0.1透明度的背景
|
||||
});
|
||||
|
||||
btn.attr("disabled", "disabled");
|
||||
//执行loadding 并且ajax提交
|
||||
|
||||
var password = $("#password").val();
|
||||
var username = $("#username").val();
|
||||
password = encMe(password, encrypt_key, 1, 0);
|
||||
username = encMe(username, encrypt_key, 1, 0);
|
||||
var queryString = $myform.formSerialize();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: "username=" + username + "&password=" + password + "&__RequestVerificationToken=" + rvtoken,
|
||||
dataType: "JSON",
|
||||
success: function (data) {
|
||||
if (data.status == "success") {
|
||||
layer.close(loading);
|
||||
//alert(data.message);
|
||||
//window.location.href= data.returnUrl;
|
||||
layer.msg(data.message, {
|
||||
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
||||
}, function () {
|
||||
window.location.href = data.returnUrl;
|
||||
});
|
||||
} else {
|
||||
layer.close(loading);
|
||||
layer.alert(data.message, { icon: 2 });
|
||||
btn.removeAttr("disabled");
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
layer.close(loading);
|
||||
layer.alert('执行错误,请联系管理员!', { icon: 2 });
|
||||
btn.removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 342 B |
|
After Width: | Height: | Size: 537 B |
@@ -0,0 +1,4 @@
|
||||
$.extend($.fn.treegrid.defaults, {
|
||||
expanderExpandedClass: 'glyphicon glyphicon-chevron-down',
|
||||
expanderCollapsedClass: 'glyphicon glyphicon-chevron-right'
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
.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);}
|
||||
@@ -0,0 +1,626 @@
|
||||
/*
|
||||
* jQuery treegrid Plugin 0.3.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);
|
||||
$this.treegrid('getRootNodes').treegrid('render');
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 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('initChangeEvent').treegrid("initSettingsEvents");
|
||||
});
|
||||
},
|
||||
initChangeEvent: 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');
|
||||
}
|
||||
});
|
||||
return $this;
|
||||
},
|
||||
/**
|
||||
* Initialize node events
|
||||
*
|
||||
* @returns {Node}
|
||||
*/
|
||||
initEvents: function() {
|
||||
var $this = $(this);
|
||||
//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();
|
||||
var tpl = $this.treegrid('getSetting', 'indentTemplate');
|
||||
var expander = $this.find('.treegrid-expander');
|
||||
var depth = $this.treegrid('getDepth');
|
||||
for (var i = 0; i < depth; i++) {
|
||||
$(tpl).insertBefore(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() {
|
||||
if (!this.treegrid('isLeaf') && !this.treegrid("isExpanded")) {
|
||||
this.trigger("expand");
|
||||
this.trigger("change");
|
||||
return this;
|
||||
}
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* 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 parent colapsed we hidden
|
||||
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);
|
||||
@@ -0,0 +1,191 @@
|
||||
$(function () {
|
||||
//初始化绑定默认的属性
|
||||
$.upLoadDefaults = $.upLoadDefaults || {};
|
||||
$.upLoadDefaults.property = {
|
||||
multiple: false, //是否多文件
|
||||
notwater: false, //是否加水印
|
||||
thumbnail: false, //是否生成缩略图
|
||||
sendurl: null, //发送地址
|
||||
filetypes: "jpg,jpge,png,gif", //文件类型
|
||||
filesize: "2048", //文件大小
|
||||
btntext: "浏览...", //上传按钮的文字
|
||||
swf: null //SWF上传控件相对地址
|
||||
};
|
||||
//初始化上传控件
|
||||
$.fn.InitUploader = function (p) {
|
||||
var fun = function (parentObj) {
|
||||
p = $.extend({}, $.upLoadDefaults.property, p || {});
|
||||
var btnObj = $('<div class="upload-btn">' + p.btntext + '</div>').appendTo(parentObj);
|
||||
//初始化属性
|
||||
p.sendurl += "?action=UpLoadFile";
|
||||
if (p.notwater) {
|
||||
p.sendurl += "¬water=1";
|
||||
}
|
||||
if (p.thumbnail) {
|
||||
p.sendurl += "&IsThumbnail=1";
|
||||
}
|
||||
|
||||
//初始化WebUploader
|
||||
var uploader = WebUploader.create({
|
||||
auto: true, //自动上传
|
||||
swf: p.swf, //SWF路径
|
||||
server: p.sendurl, //上传地址
|
||||
pick: {
|
||||
id: btnObj,
|
||||
multiple: p.multiple
|
||||
},
|
||||
accept: {
|
||||
//title: 'Images',
|
||||
extensions: p.filetypes,
|
||||
//mimeTypes: 'image/*'
|
||||
},
|
||||
formData: {
|
||||
//'DelFilePath': '' //定义参数
|
||||
},
|
||||
fileVal: 'Filedata', //上传域的名称
|
||||
fileSingleSizeLimit: p.filesize * 1024 //文件大小
|
||||
});
|
||||
|
||||
//当validate不通过时,会以派送错误事件的形式通知
|
||||
uploader.on('error', function (type) {
|
||||
switch (type) {
|
||||
case 'Q_EXCEED_NUM_LIMIT':
|
||||
alert("错误:上传文件数量过多!");
|
||||
break;
|
||||
case 'Q_EXCEED_SIZE_LIMIT':
|
||||
alert("错误:文件总大小超出限制!");
|
||||
break;
|
||||
case 'F_EXCEED_SIZE':
|
||||
alert("错误:文件大小超出限制!");
|
||||
break;
|
||||
case 'Q_TYPE_DENIED':
|
||||
alert("错误:禁止上传该类型文件!");
|
||||
break;
|
||||
case 'F_DUPLICATE':
|
||||
alert("错误:请勿重复上传该文件!");
|
||||
break;
|
||||
default:
|
||||
alert('错误代码:' + type);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
//当有文件添加进来的时候
|
||||
uploader.on('fileQueued', function (file) {
|
||||
//如果是单文件上传,把旧的文件地址传过去
|
||||
if (!p.multiple) {
|
||||
uploader.options.formData.DelFilePath = parentObj.siblings(".upload-path").val();
|
||||
}
|
||||
//防止重复创建
|
||||
if (parentObj.children(".upload-progress").length == 0) {
|
||||
//创建进度条
|
||||
//var fileProgressObj = $('<div class="upload-progress"></div>').appendTo(parentObj);
|
||||
//var progressText = $('<span class="txt">正在上传,请稍候...</span>').appendTo(fileProgressObj);
|
||||
//var progressBar = $('<span class="bar"><b></b></span>').appendTo(fileProgressObj);
|
||||
//var progressCancel = $('<a class="close" title="取消上传">关闭</a>').appendTo(fileProgressObj);
|
||||
//使用loadding
|
||||
layer.load(0, {shade: [0.2, '#000']});
|
||||
//绑定点击事件
|
||||
//progressCancel.click(function () {
|
||||
// uploader.cancelFile(file);
|
||||
// fileProgressObj.remove();
|
||||
//});
|
||||
}
|
||||
});
|
||||
|
||||
//文件上传过程中创建进度条实时显示
|
||||
uploader.on('uploadProgress', function (file, percentage) {
|
||||
//var progressObj = parentObj.children(".upload-progress");
|
||||
//progressObj.children(".txt").html(file.name);
|
||||
//progressObj.find(".bar b").width(percentage * 100 + "%");
|
||||
});
|
||||
|
||||
//当文件上传出错时触发
|
||||
uploader.on('uploadError', function (file, reason) {
|
||||
uploader.removeFile(file); //从队列中移除
|
||||
alert(file.name + "上传失败,错误代码:" + reason);
|
||||
});
|
||||
|
||||
//当文件上传成功时触发
|
||||
uploader.on('uploadSuccess', function (file, data) {
|
||||
if (data.status == 0) {
|
||||
layer.closeAll();
|
||||
alert(data.msg);
|
||||
var progressObj = parentObj.children(".upload-progress");
|
||||
progressObj.children(".txt").html(data.msg);
|
||||
}
|
||||
if (data.status == 1) {
|
||||
layer.closeAll();
|
||||
//如果是单文件上传,则赋值相应的表单
|
||||
if (!p.multiple) {
|
||||
//parentObj.siblings(".upload-name").val(data.name);
|
||||
parentObj.siblings(".upload-path").val(data.path);
|
||||
//parentObj.siblings(".upload-size").val(data.size);
|
||||
} else {
|
||||
addImage(parentObj, data.path, data.thumb);
|
||||
}
|
||||
var progressObj = parentObj.children(".upload-progress");
|
||||
//progressObj.children(".txt").html("上传成功:" + file.name);
|
||||
}
|
||||
uploader.removeFile(file); //从队列中移除
|
||||
});
|
||||
|
||||
//不管成功或者失败,文件上传完成时触发
|
||||
uploader.on('uploadComplete', function (file) {
|
||||
var progressObj = parentObj.children(".upload-progress");
|
||||
progressObj.children(".txt").html("上传完成");
|
||||
//如果队列为空,则移除进度条
|
||||
if (uploader.getStats().queueNum == 0) {
|
||||
progressObj.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
return $(this).each(function () {
|
||||
fun($(this));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//添加图片相册
|
||||
function addImage(targetObj, originalSrc, thumbSrc) {
|
||||
//插入到相册UL里面
|
||||
//验证是否是图片
|
||||
var newLi;
|
||||
if(CheckImageType(originalSrc)){
|
||||
newLi = $('<li class="addbutton">'
|
||||
+ '<input type="hidden" class="upopladfile" name="hid_photo_name" value="' + originalSrc + '" />'
|
||||
+ '<img class="img_size" src="' + thumbSrc + '" bigsrc="' + originalSrc + '" />'
|
||||
+ '</li>');
|
||||
} else{
|
||||
newLi = $('<li class="addbutton">'
|
||||
+ '<input type="hidden" class="upopladfile" name="hid_photo_name" value="' + originalSrc + '" />'
|
||||
+ '<img class="img_size" src="/templates/default/images/video.jpg" />'
|
||||
+ '</li>');
|
||||
}
|
||||
newLi.appendTo('.img_ul');
|
||||
}
|
||||
|
||||
//验证图片格式
|
||||
function CheckImageType(imagesrc) {
|
||||
var filename = imagesrc;
|
||||
if (filename.lastIndexOf(".") != -1) {
|
||||
var fileType = (filename.substring(filename.lastIndexOf(".") + 1, filename.length)).toLowerCase();
|
||||
var suppotFile = new Array();
|
||||
suppotFile[0] = "jpeg";
|
||||
suppotFile[1] = "jpg";
|
||||
suppotFile[2] = "gif";
|
||||
suppotFile[3] = "png";
|
||||
suppotFile[4] = "bmp";
|
||||
for (var i = 0; i < suppotFile.length; i++) {
|
||||
if (suppotFile[i] == fileType) {
|
||||
return true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
(function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( ["jquery", "../jquery.validate"], factory );
|
||||
} else if (typeof module === "object" && module.exports) {
|
||||
module.exports = factory( require( "jquery" ) );
|
||||
} else {
|
||||
factory( jQuery );
|
||||
}
|
||||
}(function( $ ) {
|
||||
|
||||
/*
|
||||
* Translated default messages for the jQuery validation plugin.
|
||||
* Locale: ZH (Chinese, 中文 (Zhōngwén), 汉语, 漢語)
|
||||
*/
|
||||
$.extend( $.validator.messages, {
|
||||
required: "这是必填字段",
|
||||
remote: "请修正此字段",
|
||||
email: "请输入有效的电子邮件地址",
|
||||
url: "请输入有效的网址",
|
||||
date: "请输入有效的日期",
|
||||
dateISO: "请输入有效的日期 (YYYY-MM-DD)",
|
||||
number: "请输入有效的数字",
|
||||
digits: "只能输入数字",
|
||||
creditcard: "请输入有效的信用卡号码",
|
||||
equalTo: "你的输入不相同",
|
||||
extension: "请输入有效的后缀",
|
||||
maxlength: $.validator.format( "最多可以输入 {0} 个字符" ),
|
||||
minlength: $.validator.format( "最少要输入 {0} 个字符" ),
|
||||
rangelength: $.validator.format( "请输入长度在 {0} 到 {1} 之间的字符串" ),
|
||||
range: $.validator.format( "请输入范围在 {0} 到 {1} 之间的数值" ),
|
||||
max: $.validator.format( "请输入不大于 {0} 的数值" ),
|
||||
min: $.validator.format( "请输入不小于 {0} 的数值" )
|
||||
} );
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,4 @@
|
||||
/*! jQuery Validation Plugin - v1.15.1 - 7/22/2016
|
||||
* http://jqueryvalidation.org/
|
||||
* Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"这是必填字段",remote:"请修正此字段",email:"请输入有效的电子邮件地址",url:"请输入有效的网址",date:"请输入有效的日期",dateISO:"请输入有效的日期 (YYYY-MM-DD)",number:"请输入有效的数字",digits:"只能输入数字",creditcard:"请输入有效的信用卡号码",equalTo:"你的输入不相同",extension:"请输入有效的后缀",maxlength:a.validator.format("最多可以输入 {0} 个字符"),minlength:a.validator.format("最少要输入 {0} 个字符"),rangelength:a.validator.format("请输入长度在 {0} 到 {1} 之间的字符串"),range:a.validator.format("请输入范围在 {0} 到 {1} 之间的数值"),max:a.validator.format("请输入不大于 {0} 的数值"),min:a.validator.format("请输入不小于 {0} 的数值")})});
|
||||
@@ -0,0 +1,36 @@
|
||||
(function( factory ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( ["jquery", "../jquery.validate"], factory );
|
||||
} else if (typeof module === "object" && module.exports) {
|
||||
module.exports = factory( require( "jquery" ) );
|
||||
} else {
|
||||
factory( jQuery );
|
||||
}
|
||||
}(function( $ ) {
|
||||
|
||||
/*
|
||||
* Translated default messages for the jQuery validation plugin.
|
||||
* Locale: ZH (Chinese; 中文 (Zhōngwén), 汉语, 漢語)
|
||||
* Region: TW (Taiwan)
|
||||
*/
|
||||
$.extend( $.validator.messages, {
|
||||
required: "必須填寫",
|
||||
remote: "請修正此欄位",
|
||||
email: "請輸入有效的電子郵件",
|
||||
url: "請輸入有效的網址",
|
||||
date: "請輸入有效的日期",
|
||||
dateISO: "請輸入有效的日期 (YYYY-MM-DD)",
|
||||
number: "請輸入正確的數值",
|
||||
digits: "只可輸入數字",
|
||||
creditcard: "請輸入有效的信用卡號碼",
|
||||
equalTo: "請重複輸入一次",
|
||||
extension: "請輸入有效的後綴",
|
||||
maxlength: $.validator.format( "最多 {0} 個字" ),
|
||||
minlength: $.validator.format( "最少 {0} 個字" ),
|
||||
rangelength: $.validator.format( "請輸入長度為 {0} 至 {1} 之間的字串" ),
|
||||
range: $.validator.format( "請輸入 {0} 至 {1} 之間的數值" ),
|
||||
max: $.validator.format( "請輸入不大於 {0} 的數值" ),
|
||||
min: $.validator.format( "請輸入不小於 {0} 的數值" )
|
||||
} );
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,4 @@
|
||||
/*! jQuery Validation Plugin - v1.15.1 - 7/22/2016
|
||||
* http://jqueryvalidation.org/
|
||||
* Copyright (c) 2016 Jörn Zaefferer; Licensed MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery","../jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"必須填寫",remote:"請修正此欄位",email:"請輸入有效的電子郵件",url:"請輸入有效的網址",date:"請輸入有效的日期",dateISO:"請輸入有效的日期 (YYYY-MM-DD)",number:"請輸入正確的數值",digits:"只可輸入數字",creditcard:"請輸入有效的信用卡號碼",equalTo:"請重複輸入一次",extension:"請輸入有效的後綴",maxlength:a.validator.format("最多 {0} 個字"),minlength:a.validator.format("最少 {0} 個字"),rangelength:a.validator.format("請輸入長度為 {0} 至 {1} 之間的字串"),range:a.validator.format("請輸入 {0} 至 {1} 之間的數值"),max:a.validator.format("請輸入不大於 {0} 的數值"),min:a.validator.format("請輸入不小於 {0} 的數值")})});
|
||||
@@ -0,0 +1,77 @@
|
||||
.webuploader-container {
|
||||
position: relative;
|
||||
height:100%
|
||||
}
|
||||
.webuploader-container label{
|
||||
margin-bottom:0px
|
||||
}
|
||||
.webuploader-element-invisible {
|
||||
position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
|
||||
clip: rect(1px,1px,1px,1px);
|
||||
}
|
||||
.webuploader-pick {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
background: #00b7ee;
|
||||
padding: 0px 15px;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 3px;
|
||||
height:100% !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
.webuploader-pick-hover {
|
||||
background: #00a2d4;
|
||||
}
|
||||
|
||||
.webuploader-pick-disable {
|
||||
opacity: 0.6;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.my-upload-span {
|
||||
padding: 0px;
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.my-upload-span lable {
|
||||
margin-bottom: 0px
|
||||
}
|
||||
/*=====================以下部分是WebUploader必须的====================*/
|
||||
.webuploader-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.webuploader-element-invisible {
|
||||
position: absolute !important;
|
||||
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
|
||||
clip: rect(1px,1px,1px,1px);
|
||||
}
|
||||
|
||||
.webuploader-pick {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
line-height: 30px;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
background: #18a689;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
|
||||
.webuploader-pick-hover {
|
||||
background: #18a689;
|
||||
}
|
||||
|
||||
.webuploader-pick-disable {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
/*=====================以上部分是WebUploader必须的====================*/
|
||||
@@ -0,0 +1,452 @@
|
||||
(function() {
|
||||
var MutationObserver, Util, WeakMap, getComputedStyle, getComputedStyleRX,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
Util = (function() {
|
||||
function Util() {}
|
||||
|
||||
Util.prototype.extend = function(custom, defaults) {
|
||||
var key, value;
|
||||
for (key in defaults) {
|
||||
value = defaults[key];
|
||||
if (custom[key] == null) {
|
||||
custom[key] = value;
|
||||
}
|
||||
}
|
||||
return custom;
|
||||
};
|
||||
|
||||
Util.prototype.isMobile = function(agent) {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
|
||||
};
|
||||
|
||||
Util.prototype.addEvent = function(elem, event, fn) {
|
||||
if (elem.addEventListener != null) {
|
||||
return elem.addEventListener(event, fn, false);
|
||||
} else if (elem.attachEvent != null) {
|
||||
return elem.attachEvent("on" + event, fn);
|
||||
} else {
|
||||
return elem[event] = fn;
|
||||
}
|
||||
};
|
||||
|
||||
Util.prototype.removeEvent = function(elem, event, fn) {
|
||||
if (elem.removeEventListener != null) {
|
||||
return elem.removeEventListener(event, fn, false);
|
||||
} else if (elem.detachEvent != null) {
|
||||
return elem.detachEvent("on" + event, fn);
|
||||
} else {
|
||||
return delete elem[event];
|
||||
}
|
||||
};
|
||||
|
||||
Util.prototype.innerHeight = function() {
|
||||
if ('innerHeight' in window) {
|
||||
return window.innerHeight;
|
||||
} else {
|
||||
return document.documentElement.clientHeight;
|
||||
}
|
||||
};
|
||||
|
||||
return Util;
|
||||
|
||||
})();
|
||||
|
||||
WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
|
||||
function WeakMap() {
|
||||
this.keys = [];
|
||||
this.values = [];
|
||||
}
|
||||
|
||||
WeakMap.prototype.get = function(key) {
|
||||
var i, item, _i, _len, _ref;
|
||||
_ref = this.keys;
|
||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||
item = _ref[i];
|
||||
if (item === key) {
|
||||
return this.values[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WeakMap.prototype.set = function(key, value) {
|
||||
var i, item, _i, _len, _ref;
|
||||
_ref = this.keys;
|
||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||
item = _ref[i];
|
||||
if (item === key) {
|
||||
this.values[i] = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.keys.push(key);
|
||||
return this.values.push(value);
|
||||
};
|
||||
|
||||
return WeakMap;
|
||||
|
||||
})());
|
||||
|
||||
MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
|
||||
function MutationObserver() {
|
||||
if (typeof console !== "undefined" && console !== null) {
|
||||
console.warn('MutationObserver is not supported by your browser.');
|
||||
}
|
||||
if (typeof console !== "undefined" && console !== null) {
|
||||
console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
|
||||
}
|
||||
}
|
||||
|
||||
MutationObserver.notSupported = true;
|
||||
|
||||
MutationObserver.prototype.observe = function() {};
|
||||
|
||||
return MutationObserver;
|
||||
|
||||
})());
|
||||
|
||||
getComputedStyle = this.getComputedStyle || function(el, pseudo) {
|
||||
this.getPropertyValue = function(prop) {
|
||||
var _ref;
|
||||
if (prop === 'float') {
|
||||
prop = 'styleFloat';
|
||||
}
|
||||
if (getComputedStyleRX.test(prop)) {
|
||||
prop.replace(getComputedStyleRX, function(_, char) {
|
||||
return char.toUpperCase();
|
||||
});
|
||||
}
|
||||
return ((_ref = el.currentStyle) != null ? _ref[prop] : void 0) || null;
|
||||
};
|
||||
return this;
|
||||
};
|
||||
|
||||
getComputedStyleRX = /(\-([a-z]){1})/g;
|
||||
|
||||
this.WOW = (function() {
|
||||
WOW.prototype.defaults = {
|
||||
boxClass: 'wow',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true,
|
||||
live: true
|
||||
};
|
||||
|
||||
function WOW(options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.scrollCallback = __bind(this.scrollCallback, this);
|
||||
this.scrollHandler = __bind(this.scrollHandler, this);
|
||||
this.start = __bind(this.start, this);
|
||||
this.scrolled = true;
|
||||
this.config = this.util().extend(options, this.defaults);
|
||||
this.animationNameCache = new WeakMap();
|
||||
}
|
||||
|
||||
WOW.prototype.init = function() {
|
||||
var _ref;
|
||||
this.element = window.document.documentElement;
|
||||
if ((_ref = document.readyState) === "interactive" || _ref === "complete") {
|
||||
this.start();
|
||||
} else {
|
||||
this.util().addEvent(document, 'DOMContentLoaded', this.start);
|
||||
}
|
||||
return this.finished = [];
|
||||
};
|
||||
|
||||
WOW.prototype.start = function() {
|
||||
var box, _i, _len, _ref;
|
||||
this.stopped = false;
|
||||
this.boxes = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.element.querySelectorAll("." + this.config.boxClass);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
this.all = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (this.boxes.length) {
|
||||
if (this.disabled()) {
|
||||
this.resetStyle();
|
||||
} else {
|
||||
_ref = this.boxes;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
this.applyStyle(box, true);
|
||||
}
|
||||
this.util().addEvent(window, 'scroll', this.scrollHandler);
|
||||
this.util().addEvent(window, 'resize', this.scrollHandler);
|
||||
this.interval = setInterval(this.scrollCallback, 50);
|
||||
}
|
||||
}
|
||||
if (this.config.live) {
|
||||
return new MutationObserver((function(_this) {
|
||||
return function(records) {
|
||||
var node, record, _j, _len1, _results;
|
||||
_results = [];
|
||||
for (_j = 0, _len1 = records.length; _j < _len1; _j++) {
|
||||
record = records[_j];
|
||||
_results.push((function() {
|
||||
var _k, _len2, _ref1, _results1;
|
||||
_ref1 = record.addedNodes || [];
|
||||
_results1 = [];
|
||||
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
|
||||
node = _ref1[_k];
|
||||
_results1.push(this.doSync(node));
|
||||
}
|
||||
return _results1;
|
||||
}).call(_this));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
})(this)).observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.stop = function() {
|
||||
this.stopped = true;
|
||||
this.util().removeEvent(window, 'scroll', this.scrollHandler);
|
||||
this.util().removeEvent(window, 'resize', this.scrollHandler);
|
||||
if (this.interval != null) {
|
||||
return clearInterval(this.interval);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.sync = function(element) {
|
||||
if (MutationObserver.notSupported) {
|
||||
return this.doSync(this.element);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.doSync = function(element) {
|
||||
var box, _i, _len, _ref, _results;
|
||||
if (!this.stopped) {
|
||||
if (element == null) {
|
||||
element = this.element;
|
||||
}
|
||||
if (element.nodeType !== 1) {
|
||||
return;
|
||||
}
|
||||
element = element.parentNode || element;
|
||||
_ref = element.querySelectorAll("." + this.config.boxClass);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
if (__indexOf.call(this.all, box) < 0) {
|
||||
this.applyStyle(box, true);
|
||||
this.boxes.push(box);
|
||||
this.all.push(box);
|
||||
_results.push(this.scrolled = true);
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.show = function(box) {
|
||||
this.applyStyle(box);
|
||||
return box.className = "" + box.className + " " + this.config.animateClass;
|
||||
};
|
||||
|
||||
WOW.prototype.applyStyle = function(box, hidden) {
|
||||
var delay, duration, iteration;
|
||||
duration = box.getAttribute('data-wow-duration');
|
||||
delay = box.getAttribute('data-wow-delay');
|
||||
iteration = box.getAttribute('data-wow-iteration');
|
||||
return this.animate((function(_this) {
|
||||
return function() {
|
||||
return _this.customStyle(box, hidden, duration, delay, iteration);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
WOW.prototype.animate = (function() {
|
||||
if ('requestAnimationFrame' in window) {
|
||||
return function(callback) {
|
||||
return window.requestAnimationFrame(callback);
|
||||
};
|
||||
} else {
|
||||
return function(callback) {
|
||||
return callback();
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
WOW.prototype.resetStyle = function() {
|
||||
var box, _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box.setAttribute('style', 'visibility: visible;'));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
|
||||
if (hidden) {
|
||||
this.cacheAnimationName(box);
|
||||
}
|
||||
box.style.visibility = hidden ? 'hidden' : 'visible';
|
||||
if (duration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDuration: duration
|
||||
});
|
||||
}
|
||||
if (delay) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDelay: delay
|
||||
});
|
||||
}
|
||||
if (iteration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationIterationCount: iteration
|
||||
});
|
||||
}
|
||||
this.vendorSet(box.style, {
|
||||
animationName: hidden ? 'none' : this.cachedAnimationName(box)
|
||||
});
|
||||
return box;
|
||||
};
|
||||
|
||||
WOW.prototype.vendors = ["moz", "webkit"];
|
||||
|
||||
WOW.prototype.vendorSet = function(elem, properties) {
|
||||
var name, value, vendor, _results;
|
||||
_results = [];
|
||||
for (name in properties) {
|
||||
value = properties[name];
|
||||
elem["" + name] = value;
|
||||
_results.push((function() {
|
||||
var _i, _len, _ref, _results1;
|
||||
_ref = this.vendors;
|
||||
_results1 = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
vendor = _ref[_i];
|
||||
_results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
|
||||
}
|
||||
return _results1;
|
||||
}).call(this));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
WOW.prototype.vendorCSS = function(elem, property) {
|
||||
var result, style, vendor, _i, _len, _ref;
|
||||
style = getComputedStyle(elem);
|
||||
result = style.getPropertyCSSValue(property);
|
||||
_ref = this.vendors;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
vendor = _ref[_i];
|
||||
result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
WOW.prototype.animationName = function(box) {
|
||||
var animationName;
|
||||
try {
|
||||
animationName = this.vendorCSS(box, 'animation-name').cssText;
|
||||
} catch (_error) {
|
||||
animationName = getComputedStyle(box).getPropertyValue('animation-name');
|
||||
}
|
||||
if (animationName === 'none') {
|
||||
return '';
|
||||
} else {
|
||||
return animationName;
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.cacheAnimationName = function(box) {
|
||||
return this.animationNameCache.set(box, this.animationName(box));
|
||||
};
|
||||
|
||||
WOW.prototype.cachedAnimationName = function(box) {
|
||||
return this.animationNameCache.get(box);
|
||||
};
|
||||
|
||||
WOW.prototype.scrollHandler = function() {
|
||||
return this.scrolled = true;
|
||||
};
|
||||
|
||||
WOW.prototype.scrollCallback = function() {
|
||||
var box;
|
||||
if (this.scrolled) {
|
||||
this.scrolled = false;
|
||||
this.boxes = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
if (!(box)) {
|
||||
continue;
|
||||
}
|
||||
if (this.isVisible(box)) {
|
||||
this.show(box);
|
||||
continue;
|
||||
}
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (!(this.boxes.length || this.config.live)) {
|
||||
return this.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.offsetTop = function(element) {
|
||||
var top;
|
||||
while (element.offsetTop === void 0) {
|
||||
element = element.parentNode;
|
||||
}
|
||||
top = element.offsetTop;
|
||||
while (element = element.offsetParent) {
|
||||
top += element.offsetTop;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
|
||||
WOW.prototype.isVisible = function(box) {
|
||||
var bottom, offset, top, viewBottom, viewTop;
|
||||
offset = box.getAttribute('data-wow-offset') || this.config.offset;
|
||||
viewTop = window.pageYOffset;
|
||||
viewBottom = viewTop + Math.min(this.element.clientHeight, this.util().innerHeight()) - offset;
|
||||
top = this.offsetTop(box);
|
||||
bottom = top + box.clientHeight;
|
||||
return top <= viewBottom && bottom >= viewTop;
|
||||
};
|
||||
|
||||
WOW.prototype.util = function() {
|
||||
return this._util != null ? this._util : this._util = new Util();
|
||||
};
|
||||
|
||||
WOW.prototype.disabled = function() {
|
||||
return !this.config.mobile && this.util().isMobile(navigator.userAgent);
|
||||
};
|
||||
|
||||
return WOW;
|
||||
|
||||
})();
|
||||
|
||||
}).call(this);
|
||||