1、后台登录界面更换
2、增加问题方便后面界面调整
This commit is contained in:
2
web/static/plugs/jquery/base64.min.js
vendored
Normal file
2
web/static/plugs/jquery/base64.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:self,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();
|
||||
//# sourceMappingURL=base64.min.js.map
|
||||
201
web/static/plugs/jquery/jquery.PrintArea.js
Normal file
201
web/static/plugs/jquery/jquery.PrintArea.js
Normal file
@@ -0,0 +1,201 @@
|
||||
/**
|
||||
* Version 2.4.0 Copyright (C) 2013
|
||||
* Tested in IE 11, FF 28.0 and Chrome 33.0.1750.154
|
||||
* No official support for other browsers, but will TRY to accommodate challenges in other browsers.
|
||||
* Example:
|
||||
* Print Button: <div id="print_button">Print</div>
|
||||
* Print Area : <div class="PrintArea" id="MyId" class="MyClass"> ... html ... </div>
|
||||
* Javascript : <script>
|
||||
* $("div#print_button").click(function(){
|
||||
* $("div.PrintArea").printArea( [OPTIONS] );
|
||||
* });
|
||||
* </script>
|
||||
* options are passed as json (example: {mode: "popup", popClose: false})
|
||||
*
|
||||
* {OPTIONS} | [type] | (default), values | Explanation
|
||||
* --------- | --------- | ---------------------- | -----------
|
||||
* @mode | [string] | (iframe),popup | printable window is either iframe or browser popup
|
||||
* @popHt | [number] | (500) | popup window height
|
||||
* @popWd | [number] | (400) | popup window width
|
||||
* @popX | [number] | (500) | popup window screen X position
|
||||
* @popY | [number] | (500) | popup window screen Y position
|
||||
* @popTitle | [string] | ('') | popup window title element
|
||||
* @popClose | [boolean] | (false),true | popup window close after printing
|
||||
* @extraCss | [string] | ('') | comma separated list of extra css to include
|
||||
* @retainAttr | [string[]] | ["id","class","style"] | string array of attributes to retain for the containment area. (ie: id, style, class)
|
||||
* @standard | [string] | strict, loose, (html5) | Only for popup. For html 4.01, strict or loose document standard, or html 5 standard
|
||||
* @extraHead | [string] | ('') | comma separated list of extra elements to be appended to the head tag
|
||||
*/
|
||||
(function ($) {
|
||||
var counter = 0;
|
||||
var modes = {iframe: "iframe", popup: "popup"};
|
||||
var standards = {strict: "strict", loose: "loose", html5: "html5"};
|
||||
var defaults = {
|
||||
mode: modes.iframe,
|
||||
standard: standards.html5,
|
||||
popHt: 500,
|
||||
popWd: 400,
|
||||
popX: 200,
|
||||
popY: 200,
|
||||
popTitle: '',
|
||||
popClose: false,
|
||||
extraCss: '',
|
||||
extraHead: '',
|
||||
retainAttr: ["id", "class", "style"]
|
||||
};
|
||||
|
||||
var settings = {};//global settings
|
||||
|
||||
$.fn.printArea = function (options) {
|
||||
$.extend(settings, defaults, options);
|
||||
|
||||
counter++;
|
||||
var idPrefix = "printArea_";
|
||||
$("[id^=" + idPrefix + "]").remove();
|
||||
|
||||
settings.id = idPrefix + counter;
|
||||
|
||||
var $printSource = $(this);
|
||||
|
||||
var PrintAreaWindow = PrintArea.getPrintWindow();
|
||||
|
||||
PrintArea.write(PrintAreaWindow.doc, $printSource);
|
||||
|
||||
setTimeout(function () {
|
||||
PrintArea.print(PrintAreaWindow);
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var PrintArea = {
|
||||
print: function (PAWindow) {
|
||||
var paWindow = PAWindow.win;
|
||||
|
||||
$(PAWindow.doc).ready(function () {
|
||||
paWindow.focus();
|
||||
paWindow.print();
|
||||
|
||||
if (settings.mode == modes.popup && settings.popClose)
|
||||
setTimeout(function () {
|
||||
paWindow.close();
|
||||
}, 2000);
|
||||
});
|
||||
},
|
||||
write: function (PADocument, $ele) {
|
||||
PADocument.open();
|
||||
PADocument.write(PrintArea.docType() + "<html>" + PrintArea.getHead() + PrintArea.getBody($ele) + "</html>");
|
||||
PADocument.close();
|
||||
},
|
||||
docType: function () {
|
||||
if (settings.mode == modes.iframe) return "";
|
||||
|
||||
if (settings.standard == standards.html5) return "<!DOCTYPE html>";
|
||||
|
||||
var transitional = settings.standard == standards.loose ? " Transitional" : "";
|
||||
var dtd = settings.standard == standards.loose ? "loose" : "strict";
|
||||
|
||||
return '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01' + transitional + '//EN" "http://www.w3.org/TR/html4/' + dtd + '.dtd">';
|
||||
},
|
||||
getHead: function () {
|
||||
var extraHead = "";
|
||||
var links = "";
|
||||
|
||||
if (settings.extraHead) settings.extraHead.replace(/([^,]+)/g, function (m) {
|
||||
extraHead += m
|
||||
});
|
||||
|
||||
$(document).find("link")
|
||||
.filter(function () { // Requirement: <link> element MUST have rel="stylesheet" to be considered in print document
|
||||
var relAttr = $(this).attr("rel");
|
||||
return ($.type(relAttr) === 'undefined') == false && relAttr.toLowerCase() == 'stylesheet';
|
||||
})
|
||||
.filter(function () { // Include if media is undefined, empty, print or all
|
||||
var mediaAttr = $(this).attr("media");
|
||||
return $.type(mediaAttr) === 'undefined' || mediaAttr == "" || mediaAttr.toLowerCase() == 'print' || mediaAttr.toLowerCase() == 'all'
|
||||
})
|
||||
.each(function () {
|
||||
links += '<link type="text/css" rel="stylesheet" href="' + $(this).attr("href") + '" >';
|
||||
});
|
||||
if (settings.extraCss) settings.extraCss.replace(/([^,\s]+)/g, function (m) {
|
||||
links += '<link type="text/css" rel="stylesheet" href="' + m + '">'
|
||||
});
|
||||
|
||||
return "<head><title>" + settings.popTitle + "</title>" + extraHead + links + "</head>";
|
||||
},
|
||||
getBody: function (elements) {
|
||||
var htm = "";
|
||||
var attrs = settings.retainAttr;
|
||||
elements.each(function () {
|
||||
var ele = PrintArea.getFormData($(this));
|
||||
|
||||
var attributes = ""
|
||||
for (var x = 0; x < attrs.length; x++) {
|
||||
var eleAttr = $(ele).attr(attrs[x]);
|
||||
if (eleAttr) attributes += (attributes.length > 0 ? " " : "") + attrs[x] + "='" + eleAttr + "'";
|
||||
}
|
||||
|
||||
htm += '<div ' + attributes + '>' + $(ele).html() + '</div>';
|
||||
});
|
||||
|
||||
return "<body>" + htm + "</body>";
|
||||
},
|
||||
getFormData: function (ele) {
|
||||
var copy = ele.clone();
|
||||
var copiedInputs = $("input,select,textarea", copy);
|
||||
$("input,select,textarea", ele).each(function (i) {
|
||||
var typeInput = $(this).attr("type");
|
||||
if ($.type(typeInput) === 'undefined') typeInput = $(this).is("select") ? "select" : $(this).is("textarea") ? "textarea" : "";
|
||||
var copiedInput = copiedInputs.eq(i);
|
||||
|
||||
if (typeInput == "radio" || typeInput == "checkbox") copiedInput.attr("checked", $(this).is(":checked"));
|
||||
else if (typeInput == "text") copiedInput.attr("value", $(this).val());
|
||||
else if (typeInput == "select")
|
||||
$(this).find("option").each(function (i) {
|
||||
if ($(this).is(":selected")) $("option", copiedInput).eq(i).attr("selected", true);
|
||||
});
|
||||
else if (typeInput == "textarea") copiedInput.text($(this).val());
|
||||
});
|
||||
return copy;
|
||||
},
|
||||
getPrintWindow: function () {
|
||||
switch (settings.mode) {
|
||||
case modes.iframe :
|
||||
var f = new PrintArea.Iframe();
|
||||
return {win: f.contentWindow || f, doc: f.doc};
|
||||
case modes.popup :
|
||||
var p = new PrintArea.Popup();
|
||||
return {win: p, doc: p.doc};
|
||||
}
|
||||
},
|
||||
Iframe: function () {
|
||||
var frameId = settings.id;
|
||||
var iframeStyle = 'border:0;position:absolute;width:0px;height:0px;right:0px;top:0px;';
|
||||
var iframe;
|
||||
|
||||
try {
|
||||
iframe = document.createElement('iframe');
|
||||
document.body.appendChild(iframe);
|
||||
$(iframe).attr({style: iframeStyle, id: frameId, src: "#" + new Date().getTime()});
|
||||
iframe.doc = null;
|
||||
iframe.doc = iframe.contentDocument ? iframe.contentDocument : ( iframe.contentWindow ? iframe.contentWindow.document : iframe.document);
|
||||
}
|
||||
catch (e) {
|
||||
throw e + ". iframes may not be supported in this browser.";
|
||||
}
|
||||
|
||||
if (iframe.doc == null) throw "Cannot find document.";
|
||||
|
||||
return iframe;
|
||||
},
|
||||
Popup: function () {
|
||||
var windowAttr = "location=yes,statusbar=no,directories=no,menubar=no,titlebar=no,toolbar=no,dependent=no";
|
||||
windowAttr += ",width=" + settings.popWd + ",height=" + settings.popHt;
|
||||
windowAttr += ",resizable=yes,screenX=" + settings.popX + ",screenY=" + settings.popY + ",personalbar=no,scrollbars=yes";
|
||||
|
||||
var newWin = window.open("", "_blank", windowAttr);
|
||||
|
||||
newWin.doc = newWin.document;
|
||||
|
||||
return newWin;
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
100
web/static/plugs/jquery/jquery.cascade.js
Normal file
100
web/static/plugs/jquery/jquery.cascade.js
Normal file
@@ -0,0 +1,100 @@
|
||||
!function ($) {
|
||||
var Cascade = function (element, options) {
|
||||
this.init('cascade', element, options);
|
||||
};
|
||||
Cascade.prototype = {
|
||||
constructor: Cascade,
|
||||
init: function (type, element, options) {
|
||||
this.type = type;
|
||||
this.$element = $(element);
|
||||
this.options = this.getOptions(options);
|
||||
this.layout();
|
||||
}, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options);
|
||||
return options;
|
||||
}, layout: function () {
|
||||
$('.additem').remove();
|
||||
this.item();
|
||||
this.endDecorate();
|
||||
this.box();
|
||||
}, item: function () {
|
||||
var $box = this.$element, _coord = [], _num = 0, _options = this.options, i = 0,
|
||||
$items = $box.find(this.options.fallsCss), fallsWidth = $items.eq(0).outerWidth() + this.options.margin,
|
||||
boxWidth = $box.outerWidth() + this.options.margin, _autoWidth = 0;
|
||||
_num = Math.floor(boxWidth / fallsWidth);
|
||||
_autoWidth = (boxWidth - _num * fallsWidth) / 2;
|
||||
for (; i < _num; i++) {
|
||||
_coord.push([i * fallsWidth, 0]);
|
||||
}
|
||||
$items.each(function () {
|
||||
var $item = $(this), fallsHeight = $item.outerHeight() + _options.margin, temp = 0;
|
||||
for (i = 0; i < _num; i++) {
|
||||
if (_coord[i][1] < _coord[temp][1]) {
|
||||
temp = i;
|
||||
}
|
||||
}
|
||||
$item.stop().animate({
|
||||
left: _coord[temp][0] + _autoWidth + 'px', top: _coord[temp][1] + 'px'
|
||||
});
|
||||
_coord[temp][1] += fallsHeight;
|
||||
$item.on('mouseenter' + '.' + _options.type, function () {
|
||||
$(this).addClass('hover');
|
||||
});
|
||||
$item.on('mouseleave' + '.' + _options.type, function () {
|
||||
$(this).removeClass('hover');
|
||||
});
|
||||
});
|
||||
this.coord = _coord;
|
||||
this.num = _num;
|
||||
this.autoWidth = _autoWidth;
|
||||
}, box: function () {
|
||||
this.$element.height(this.getFallsMaxHeight());
|
||||
}, endDecorate: function () {
|
||||
var _coord = this.coord, i = 0, _num = this.num, fallsMaxHeight = this.getFallsMaxHeight(),
|
||||
falls = document.createElement('div'), fallsClone, fallsHeight = 0;
|
||||
falls.className = 'additem';
|
||||
for (; i < _num; i++) {
|
||||
if (fallsMaxHeight != _coord[i][1]) {
|
||||
fallsClone = falls.cloneNode();
|
||||
fallsHeight = fallsMaxHeight - this.options.margin - _coord[i][1];
|
||||
// fallsClone.style.cssText = 'left: ' + _coord[i][0] + 'px; ' + 'top: ' + _coord[i][1] + 'px; height: ' + fallsHeight + 'px;';
|
||||
this.$element.append($(fallsClone).stop().animate({
|
||||
left: _coord[i][0] + this.autoWidth + 'px', top: _coord[i][1] + 'px', height: fallsHeight + 'px'
|
||||
}));
|
||||
}
|
||||
}
|
||||
}, getFallsMaxHeight: function () {
|
||||
var i = 0, heightArry = [], _coord = this.coord, _num = this.num;
|
||||
for (; i < _num; i++) {
|
||||
heightArry.push(_coord[i][1]);
|
||||
}
|
||||
heightArry.sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
return heightArry[_num - 1];
|
||||
}
|
||||
};
|
||||
var old = $.fn.cascade;
|
||||
$.fn.cascade = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this), data = $this.data('cascade'), options = typeof option == 'object' && option;
|
||||
if (!data) {
|
||||
$this.data('cascade', data = new Cascade(this, options));
|
||||
$(window).on('resize.cascade', function () {
|
||||
data['layout']();
|
||||
});
|
||||
}
|
||||
if (typeof option === 'string') {
|
||||
data[option]();
|
||||
}
|
||||
});
|
||||
};
|
||||
$.fn.cascade.Constructor = Cascade;
|
||||
$.fn.cascade.defaults = {
|
||||
fallsCss: '.item', margin: 15
|
||||
};
|
||||
$.fn.cascade.noConflict = function () {
|
||||
$.fn.cascade = old;
|
||||
return this;
|
||||
};
|
||||
}(window.jQuery);
|
||||
249
web/static/plugs/jquery/jquery.citys.js
Normal file
249
web/static/plugs/jquery/jquery.citys.js
Normal file
@@ -0,0 +1,249 @@
|
||||
/**
|
||||
* jquery.citys.js 1.0
|
||||
* http://jquerywidget.com
|
||||
* Github:https://github.com/mumuy/widget
|
||||
* -------------- DEMO ---------------
|
||||
* $('#demo1').citys({valueType:'name',province:'福建',city:'厦门',area:'思明'});
|
||||
*/
|
||||
;(function (factory) {
|
||||
if (typeof define === "function" && (define.amd || define.cmd) && !jQuery) {
|
||||
// AMD或CMD
|
||||
define(["jquery"], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node/CommonJS
|
||||
module.exports = function (root, jQuery) {
|
||||
if (jQuery === undefined) {
|
||||
if (typeof window !== 'undefined') {
|
||||
jQuery = require('jquery');
|
||||
} else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
//Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
$.support.cors = true;
|
||||
$.fn.citys = function (parameter, getApi) {
|
||||
if (typeof parameter === 'function') { //重载
|
||||
getApi = parameter;
|
||||
parameter = {};
|
||||
} else {
|
||||
parameter = parameter || {};
|
||||
getApi = getApi || function () {
|
||||
};
|
||||
}
|
||||
var dataUrl = 'http://passer-by.com/data_location/list.json';
|
||||
if (window.ROOT_URL) {
|
||||
dataUrl = window.ROOT_URL + '/index.php/admin/plugs/region.html';
|
||||
}
|
||||
var defaults = {
|
||||
dataUrl: dataUrl, //数据库地址
|
||||
crossDomain: true, //是否开启跨域
|
||||
dataType: 'json', //数据库类型:'json'或'jsonp'
|
||||
provinceField: 'province', //省份字段名
|
||||
cityField: 'city', //城市字段名
|
||||
areaField: 'area', //地区字段名
|
||||
valueType: 'code', //下拉框值的类型,code行政区划代码,name地名
|
||||
code: 0, //地区编码
|
||||
province: 0, //省份,可以为地区编码或者名称
|
||||
city: 0, //城市,可以为地区编码或者名称
|
||||
area: 0, //地区,可以为地区编码或者名称
|
||||
required: true, //是否必须选一个
|
||||
nodata: 'hidden', //当无数据时的表现形式:'hidden'隐藏,'disabled'禁用,为空不做任何处理
|
||||
onChange: function () { //地区切换时触发,回调函数传入地区数据
|
||||
}
|
||||
};
|
||||
var options = $.extend({}, defaults, parameter);
|
||||
return this.each(function () {
|
||||
//对象定义
|
||||
var _api = {};
|
||||
var $this = $(this);
|
||||
var $province = $this.find('select[name="' + options.provinceField + '"]'),
|
||||
$city = $this.find('select[name="' + options.cityField + '"]'),
|
||||
$area = $this.find('select[name="' + options.areaField + '"]');
|
||||
$.ajax({
|
||||
url: options.dataUrl,
|
||||
type: 'GET',
|
||||
crossDomain: options.crossDomain,
|
||||
dataType: options.dataType,
|
||||
jsonpCallback: 'jsonp_location',
|
||||
success: function (data) {
|
||||
var province, city, area, hasCity;
|
||||
if (options.code) { //如果设置地区编码,则忽略单独设置的信息
|
||||
var c = options.code - options.code % 1e4;
|
||||
if (data[c]) {
|
||||
options.province = c;
|
||||
}
|
||||
c = options.code - (options.code % 1e4 ? options.code % 1e2 : options.code);
|
||||
if (data[c]) {
|
||||
options.city = c;
|
||||
}
|
||||
c = options.code % 1e2 ? options.code : 0;
|
||||
if (data[c]) {
|
||||
options.area = c;
|
||||
}
|
||||
}
|
||||
var updateData = function () {
|
||||
province = {}, city = {}, area = {};
|
||||
hasCity = false; //判断是非有地级城市
|
||||
for (var code in data) {
|
||||
if (!(code % 1e4)) { //获取所有的省级行政单位
|
||||
province[code] = data[code];
|
||||
if (options.required && !options.province) {
|
||||
if (options.city && !(options.city % 1e4)) { //省未填,并判断为直辖市
|
||||
options.province = options.city;
|
||||
} else {
|
||||
options.province = code;
|
||||
}
|
||||
} else if (isNaN(options.province) && data[code].indexOf(options.province) > -1) {
|
||||
options.province = code;
|
||||
}
|
||||
} else {
|
||||
var p = code - options.province;
|
||||
if (options.province && p > 0 && p < 1e4) { //同省的城市或地区
|
||||
if (!(code % 100)) {
|
||||
hasCity = true;
|
||||
city[code] = data[code];
|
||||
if (options.required && !options.city) {
|
||||
options.city = code;
|
||||
} else if (isNaN(options.city) && data[code].indexOf(options.city) > -1) {
|
||||
options.city = code;
|
||||
}
|
||||
} else if (p > 8000) { //省直辖县级行政单位
|
||||
city[code] = data[code];
|
||||
if (options.required && !options.city) {
|
||||
options.city = code;
|
||||
} else if (isNaN(options.city) && data[code].indexOf(options.city) > -1) {
|
||||
options.city = code;
|
||||
}
|
||||
} else if (hasCity) { //非直辖市
|
||||
var c = code - options.city;
|
||||
if (options.city && c > 0 && c < 100) { //同个城市的地区
|
||||
area[code] = data[code];
|
||||
if (options.required && !options.area) {
|
||||
options.area = code;
|
||||
} else if (isNaN(options.area) && data[code].indexOf(options.area) > -1) {
|
||||
options.area = code;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
area[code] = data[code]; //直辖市
|
||||
if (options.required && !options.area) {
|
||||
options.area = code;
|
||||
} else if (isNaN(options.area) && data[code].indexOf(options.area) > -1) {
|
||||
options.area = code;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var format = {
|
||||
province: function () {
|
||||
$province.empty();
|
||||
if (!options.required) {
|
||||
$province.append('<option value=""> - 请选择 - </option>');
|
||||
}
|
||||
for (var i in province) {
|
||||
$province.append('<option value="' + (options.valueType === 'code' ? i : province[i]) + '" data-code="' + i + '">' + province[i] + '</option>');
|
||||
}
|
||||
if (options.province) {
|
||||
var value = options.valueType === 'code' ? options.province : province[options.province];
|
||||
$province.val(value);
|
||||
}
|
||||
this.city();
|
||||
},
|
||||
city: function () {
|
||||
$city.empty();
|
||||
if (!hasCity) {
|
||||
$city.css('display', 'none');
|
||||
} else {
|
||||
$city.css('display', '');
|
||||
if (!options.required) {
|
||||
$city.append('<option value=""> - 请选择 - </option>');
|
||||
}
|
||||
if (options.nodata === 'disabled') {
|
||||
$city.prop('disabled', $.isEmptyObject(city));
|
||||
} else if (options.nodata === 'hidden') {
|
||||
$city.css('display', $.isEmptyObject(city) ? 'none' : '');
|
||||
}
|
||||
for (var i in city) {
|
||||
$city.append('<option value="' + (options.valueType === 'code' ? i : city[i]) + '" data-code="' + i + '">' + city[i] + '</option>');
|
||||
}
|
||||
if (options.city) {
|
||||
var value = options.valueType === 'code' ? options.city : city[options.city];
|
||||
$city.val(value);
|
||||
} else if (options.area) {
|
||||
var value = options.valueType === 'code' ? options.area : city[options.area];
|
||||
$city.val(value);
|
||||
}
|
||||
}
|
||||
this.area();
|
||||
},
|
||||
area: function () {
|
||||
$area.empty();
|
||||
if (!options.required) {
|
||||
$area.append('<option value=""> - 请选择 - </option>');
|
||||
}
|
||||
if (options.nodata === 'disabled') {
|
||||
$area.prop('disabled', $.isEmptyObject(area));
|
||||
} else if (options.nodata === 'hidden') {
|
||||
$area.css('display', $.isEmptyObject(area) ? 'none' : '');
|
||||
}
|
||||
for (var i in area) {
|
||||
$area.append('<option value="' + (options.valueType === 'code' ? i : area[i]) + '" data-code="' + i + '">' + area[i] + '</option>');
|
||||
}
|
||||
if (options.area) {
|
||||
var value = options.valueType === 'code' ? options.area : area[options.area];
|
||||
$area.val(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
//获取当前地理信息
|
||||
_api.getInfo = function () {
|
||||
var status = {
|
||||
direct: !hasCity,
|
||||
province: data[options.province] || '',
|
||||
city: data[options.city] || '',
|
||||
area: data[options.area] || '',
|
||||
code: options.area || options.city || options.province
|
||||
};
|
||||
return status;
|
||||
};
|
||||
//事件绑定
|
||||
$province.on('change', function () {
|
||||
options.province = $(this).find('option:selected').data('code') || 0; //选中节点的区划代码
|
||||
options.city = 0;
|
||||
options.area = 0;
|
||||
updateData();
|
||||
format.city();
|
||||
options.onChange(_api.getInfo());
|
||||
});
|
||||
$city.on('change', function () {
|
||||
options.city = $(this).find('option:selected').data('code') || 0; //选中节点的区划代码
|
||||
options.area = 0;
|
||||
updateData();
|
||||
format.area();
|
||||
options.onChange(_api.getInfo());
|
||||
});
|
||||
$area.on('change', function () {
|
||||
options.area = $(this).find('option:selected').data('code') || 0; //选中节点的区划代码
|
||||
options.onChange(_api.getInfo());
|
||||
});
|
||||
//初始化
|
||||
updateData();
|
||||
format.province();
|
||||
if (options.code) {
|
||||
options.onChange(_api.getInfo());
|
||||
}
|
||||
getApi(_api);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}));
|
||||
118
web/static/plugs/jquery/jquery.cookie.js
Normal file
118
web/static/plugs/jquery/jquery.cookie.js
Normal file
@@ -0,0 +1,118 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2013 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (value !== undefined && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setTime(+t + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {};
|
||||
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
||||
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
var name = decode(parts.shift());
|
||||
var cookie = parts.join('=');
|
||||
|
||||
if (key && key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) === undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, {expires: -1}));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
|
||||
}));
|
||||
5
web/static/plugs/jquery/jquery.min.js
vendored
Normal file
5
web/static/plugs/jquery/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
web/static/plugs/jquery/json2.min.js
vendored
Normal file
1
web/static/plugs/jquery/json2.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,u,f,a=gap,i=e[t];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(t)),"function"==typeof rep&&(i=rep.call(e,t,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,f=[],"[object Array]"===Object.prototype.toString.apply(i)){for(u=i.length,r=0;r<u;r+=1)f[r]=str(r,i)||"null";return o=0===f.length?"[]":gap?"[\n"+gap+f.join(",\n"+gap)+"\n"+a+"]":"["+f.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(u=rep.length,r=0;r<u;r+=1)"string"==typeof rep[r]&&(n=rep[r],o=str(n,i),o&&f.push(quote(n)+(gap?": ":":")+o));else for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=str(n,i),o&&f.push(quote(n)+(gap?": ":":")+o));return o=0===f.length?"{}":gap?"{\n"+gap+f.join(",\n"+gap)+"\n"+a+"}":"{"+f.join(",")+"}",gap=a,o}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,r){var n;if(gap="",indent="","number"==typeof r)for(n=0;n<r;n+=1)indent+=" ";else"string"==typeof r&&(indent=r);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var r,n,o=t[e];if(o&&"object"==typeof o)for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n=walk(o,r),void 0!==n?o[r]=n:delete o[r]);return reviver.call(t,e,o)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();
|
||||
9
web/static/plugs/jquery/masonry.min.js
vendored
Normal file
9
web/static/plugs/jquery/masonry.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
web/static/plugs/jquery/pace.min.js
vendored
Normal file
2
web/static/plugs/jquery/pace.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
30
web/static/plugs/jquery/pcasunzips.js
vendored
Normal file
30
web/static/plugs/jquery/pcasunzips.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user