Conflicts: src/main/resources/application.ymlmaster
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB |
@ -1 +0,0 @@ |
||||
ms.manager={initMenu:function(e){$("#ms-menu-parent-tmpl").tmpl(e).appendTo(".ms-menu"),$(".ms-menu-parent").each(function(s){var n=new Array;for(i=0;i<e.length;i++)e[i].modelModelId==$(this).data("model-id")&&n.push(e[i]);$("#ms-menu-child-tmpl").tmpl(n).appendTo($(this).find("ul:first"))}),$('[data-toggle="tooltip"]').tooltip(),$("body").delegate(".ms-menu-parent > div","click",function(){$(this).siblings(".ms-menu-child").hasClass("openMenuChild")?($(this).removeClass("nav-title"),$(this).addClass("ms-menu-parent-header"),$(this).siblings(".ms-menu-child").slideUp(),$(this).siblings(".ms-menu-child").removeClass("openMenuChild")):($(".ms-menu-parent").children("div").removeClass("nav-title"),$(".ms-menu-parent").children("div").addClass("ms-menu-parent-header"),$(".ms-menu-child").slideUp(),$(".ms-menu-child").removeClass("openMenuChild"),$(this).addClass("nav-title"),$(this).removeClass("ms-menu-parent-header"),$(this).siblings(".ms-menu-child").slideDown(),$(this).siblings(".ms-menu-child").addClass("openMenuChild"),$(this).siblings(".ms-menu-child > li").click(function(){$(this).siblings(".ms-menu-child").show(),$(".ms-menu-parent").siblings(".ms-menu-child > li >a").css("color","#e4e4e4"),$(this).siblings(".ms-menu-child > li > a").css("color","#1CAF9A")}))})}},$(function(){$("body").delegate(".ms-menu-parent","mouseover",function(){$(this).children("div").addClass("nav-title"),$(this).children("div").removeClass("ms-menu-parent-header")}),$("body").delegate(".ms-menu-parent","mouseout",function(){$(this).children(".ms-menu-child").hasClass("openMenuChild")?($(this).children("div").addClass("nav-title"),$(this).children("div").removeClass("ms-menu-parent-header")):($(this).children("div").removeClass("nav-title"),$(this).children("div").addClass("ms-menu-parent-header"))}),$('[data-toggle="tooltip"]').tooltip()}); |
||||
@ -1,261 +0,0 @@ |
||||
//后台分页js
|
||||
(function($){ |
||||
|
||||
var methods = { |
||||
init: function(options) { |
||||
var o = $.extend({ |
||||
items: 1,//总数量
|
||||
itemsOnPage: 1,//每页显示数量
|
||||
pages: 1,//总页数
|
||||
displayedPages: 5,//显示页数
|
||||
edges: 3,//边界显示页数
|
||||
currentPage: 1, |
||||
hrefTextPrefix: '#page-',//分页链接地址的的前缀
|
||||
hrefTextSuffix: '', |
||||
prevText: '上一页',//上一页显示文字
|
||||
nextText: '下一页', |
||||
ellipseText: '…', |
||||
cssStyle: 'light-theme',//分页使用的样式
|
||||
labelMap: [],//分页显示的信息
|
||||
selectOnClick: true, |
||||
onPageClick: function(pageNumber, event) { |
||||
//点击分页进行的操作
|
||||
}, |
||||
onInit: function() { |
||||
//初始化时进行的操作
|
||||
} |
||||
}, options || {}); |
||||
|
||||
var self = this; |
||||
|
||||
o.pages = o.pages ? o.pages : Math.ceil(o.items / o.itemsOnPage) ? Math.ceil(o.items / o.itemsOnPage) : 1; |
||||
o.currentPage = o.currentPage - 1; |
||||
o.halfDisplayed = o.displayedPages / 2; |
||||
|
||||
this.each(function() { |
||||
self.addClass(o.cssStyle).data('pagination', o); |
||||
methods._draw.call(self); |
||||
}); |
||||
|
||||
o.onInit(); |
||||
|
||||
return this; |
||||
}, |
||||
|
||||
selectPage: function(page) { |
||||
methods._selectPage.call(this, page - 1); |
||||
return this; |
||||
}, |
||||
|
||||
prevPage: function() { |
||||
var o = this.data('pagination'); |
||||
if (o.currentPage > 0) { |
||||
methods._selectPage.call(this, o.currentPage - 1); |
||||
} |
||||
return this; |
||||
}, |
||||
|
||||
nextPage: function() { |
||||
var o = this.data('pagination'); |
||||
if (o.currentPage < o.pages - 1) { |
||||
methods._selectPage.call(this, o.currentPage + 1); |
||||
} |
||||
return this; |
||||
}, |
||||
|
||||
getPagesCount: function() { |
||||
return this.data('pagination').pages; |
||||
}, |
||||
|
||||
getCurrentPage: function () { |
||||
return this.data('pagination').currentPage + 1; |
||||
}, |
||||
|
||||
destroy: function(){ |
||||
this.empty(); |
||||
return this; |
||||
}, |
||||
|
||||
drawPage: function (page) { |
||||
var o = this.data('pagination'); |
||||
o.currentPage = page - 1; |
||||
this.data('pagination', o); |
||||
methods._draw.call(this); |
||||
return this; |
||||
}, |
||||
|
||||
redraw: function(){ |
||||
methods._draw.call(this); |
||||
return this; |
||||
}, |
||||
|
||||
disable: function(){ |
||||
var o = this.data('pagination'); |
||||
o.disabled = true; |
||||
this.data('pagination', o); |
||||
methods._draw.call(this); |
||||
return this; |
||||
}, |
||||
|
||||
enable: function(){ |
||||
var o = this.data('pagination'); |
||||
o.disabled = false; |
||||
this.data('pagination', o); |
||||
methods._draw.call(this); |
||||
return this; |
||||
}, |
||||
|
||||
updateItems: function (newItems) { |
||||
var o = this.data('pagination'); |
||||
o.items = newItems; |
||||
o.pages = methods._getPages(o); |
||||
this.data('pagination', o); |
||||
methods._draw.call(this); |
||||
}, |
||||
|
||||
updateItemsOnPage: function (itemsOnPage) { |
||||
var o = this.data('pagination'); |
||||
o.itemsOnPage = itemsOnPage; |
||||
o.pages = methods._getPages(o); |
||||
this.data('pagination', o); |
||||
methods._selectPage.call(this, 0); |
||||
return this; |
||||
}, |
||||
|
||||
_draw: function() { |
||||
var o = this.data('pagination'), |
||||
interval = methods._getInterval(o), |
||||
i, |
||||
tagName; |
||||
|
||||
methods.destroy.call(this); |
||||
|
||||
tagName = (typeof this.prop === 'function') ? this.prop('tagName') : this.attr('tagName'); |
||||
|
||||
var $panel = tagName === 'UL' ? this : $('<ul></ul>').appendTo(this); |
||||
|
||||
//上一页
|
||||
if (o.prevText) { |
||||
methods._appendItem.call(this, o.currentPage - 1, {text: o.prevText, classes: 'prev'}); |
||||
} |
||||
|
||||
// 开始位置的分页
|
||||
if (interval.start > 0 && o.edges > 0) { |
||||
var end = Math.min(o.edges, interval.start); |
||||
for (i = 0; i < end; i++) { |
||||
methods._appendItem.call(this, i); |
||||
} |
||||
if (o.edges < interval.start && (interval.start - o.edges != 1)) { |
||||
$panel.append('<li class="disabled"><a>' + o.ellipseText + '</a></span></li>'); |
||||
} else if (interval.start - o.edges == 1) { |
||||
methods._appendItem.call(this, o.edges); |
||||
} |
||||
} |
||||
|
||||
// 中间段的分页显示
|
||||
for (i = interval.start; i < interval.end; i++) { |
||||
methods._appendItem.call(this, i); |
||||
} |
||||
|
||||
//结束的分页显示
|
||||
if (interval.end < o.pages && o.edges > 0) { |
||||
if (o.pages - o.edges > interval.end && (o.pages - o.edges - interval.end != 1)) { |
||||
$panel.append('<li class="disabled"><a>' + o.ellipseText + '</a></li>'); |
||||
} else if (o.pages - o.edges - interval.end == 1) { |
||||
methods._appendItem.call(this, interval.end++); |
||||
} |
||||
var begin = Math.max(o.pages - o.edges, interval.end); |
||||
for (i = begin; i < o.pages; i++) { |
||||
methods._appendItem.call(this, i); |
||||
} |
||||
} |
||||
|
||||
// Generate Next link
|
||||
if (o.nextText) { |
||||
methods._appendItem.call(this, o.currentPage + 1, {text: o.nextText, classes: 'next'}); |
||||
} |
||||
}, |
||||
//获取总页数
|
||||
_getPages: function(o) { |
||||
var pages = Math.ceil(o.items / o.itemsOnPage); |
||||
return pages || 1; |
||||
}, |
||||
//获取中间显示的页数
|
||||
_getInterval: function(o) { |
||||
return { |
||||
start: Math.ceil(o.currentPage > o.halfDisplayed ? Math.max(Math.min(o.currentPage - o.halfDisplayed, (o.pages - o.displayedPages)), 0) : 0), |
||||
end: Math.ceil(o.currentPage > o.halfDisplayed ? Math.min(o.currentPage + o.halfDisplayed, o.pages) : Math.min(o.displayedPages, o.pages)) |
||||
}; |
||||
}, |
||||
|
||||
_appendItem: function(pageIndex, opts) { |
||||
var self = this, options, $link, o = self.data('pagination'), $linkWrapper = $('<li></li>'), $ul = self.find('ul'); |
||||
|
||||
pageIndex = pageIndex < 0 ? 0 : (pageIndex < o.pages ? pageIndex : o.pages - 1); |
||||
|
||||
options = { |
||||
text: pageIndex + 1, |
||||
classes: '' |
||||
}; |
||||
|
||||
if (o.labelMap.length && o.labelMap[pageIndex]) { |
||||
options.text = o.labelMap[pageIndex]; |
||||
} |
||||
|
||||
options = $.extend(options, opts || {}); |
||||
|
||||
if (pageIndex == o.currentPage || o.disabled) { |
||||
if (o.disabled) { |
||||
$linkWrapper.addClass('disabled'); |
||||
} else { |
||||
if (!options.classes) { |
||||
$linkWrapper.addClass('active'); |
||||
} |
||||
|
||||
} |
||||
$link = $('<a target="_self">' + (options.text) + '</a>'); |
||||
} else { |
||||
$link = $('<a target="_self" href="' + o.hrefTextPrefix + (pageIndex + 1) + o.hrefTextSuffix + '" class="page-link">' + (options.text) + '</a>'); |
||||
$link.click(function(event){ |
||||
return methods._selectPage.call(self, pageIndex, event); |
||||
}); |
||||
} |
||||
|
||||
if (options.classes) { |
||||
$link.addClass(options.classes); |
||||
} |
||||
|
||||
$linkWrapper.append($link); |
||||
|
||||
if ($ul.length) { |
||||
$ul.append($linkWrapper); |
||||
} else { |
||||
self.append($linkWrapper); |
||||
} |
||||
}, |
||||
|
||||
_selectPage: function(pageIndex, event) { |
||||
var o = this.data('pagination'); |
||||
o.currentPage = pageIndex; |
||||
if (o.selectOnClick) { |
||||
methods._draw.call(this); |
||||
} |
||||
return o.onPageClick(pageIndex + 1, event); |
||||
} |
||||
|
||||
}; |
||||
|
||||
$.fn.pagination = function(method) { |
||||
|
||||
// Method calling logic
|
||||
if (methods[method] && method.charAt(0) != '_') { |
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); |
||||
} else if (typeof method === 'object' || !method) { |
||||
return methods.init.apply(this, arguments); |
||||
} else { |
||||
$.error('Method ' + method + ' does not exist on jQuery.pagination'); |
||||
} |
||||
|
||||
}; |
||||
|
||||
})(jQuery); |
||||
@ -1,820 +0,0 @@ |
||||
var Ms={}; |
||||
Ms.validate = { |
||||
/** |
||||
* ================================================================== |
||||
* 功能:替换空格(将多个连续空格替换为一个空格) 使用:ReplaceSpace(obj) 返回:string |
||||
* ================================================================== |
||||
*/ |
||||
"replaceSpace":function(str) { |
||||
while ( str.indexOf(" ") >= 0 ) |
||||
{ |
||||
str = str.replace(" " ," "); |
||||
} |
||||
return str; |
||||
}, |
||||
/** |
||||
* ==================================================================
|
||||
* 功能:检查是否要显示提示窗口 |
||||
* ================================================================== |
||||
*/ |
||||
"ifShow":function(ShowMsg){ |
||||
if (ShowMsg == "" ){ |
||||
return false; |
||||
}else{ |
||||
return true; |
||||
}
|
||||
}, |
||||
/** |
||||
* ================================================================== |
||||
* 功能:检测是否存在变量 |
||||
* ================================================================== |
||||
*/ |
||||
"isExitsFunction":function(funcName){ |
||||
try { |
||||
if (typeof(eval(funcName)) == "function") { |
||||
return true; |
||||
} |
||||
} catch(e) {} |
||||
return false; |
||||
},
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:检测是否存在变量 |
||||
* ================================================================== |
||||
*/ |
||||
"isExitsVariable":function(variableName){ |
||||
try { |
||||
if (typeof(variableName) == "undefined") { |
||||
//alert("value is undefined");
|
||||
return false; |
||||
} else { |
||||
//alert("value is true");
|
||||
return true; |
||||
} |
||||
} catch(e) {} |
||||
return false; |
||||
},
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:非空检查,不忽略空格 提示信息:输入框为空,请输入! 使用:isNull(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isNull":function(str,ShowMsg){ |
||||
var show =this.ifShow(ShowMsg) ; |
||||
// 非空检查
|
||||
if(str == ""){ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
}else { |
||||
return true; |
||||
}
|
||||
}, |
||||
/** |
||||
* ================================================================== 功能:邮箱地址检查 |
||||
* 提示信息:未输入邮件地址或邮件地址无效! 使用:MailCheck(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"mailCheck":function(obj,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg) ; |
||||
|
||||
if(obj.value!= "") |
||||
{ |
||||
var ok1=obj.value.indexOf("@"); |
||||
var ok2=obj.value.indexOf("."); |
||||
if(!((ok1!=-1)&&(ok2!=-1))) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
var allowstrlist = "&#%<>"; |
||||
var endvalue = true; |
||||
for (i=0;i<obj.value.length;i++)
|
||||
{ |
||||
if (allowstrlist.indexOf(obj.value.substr(i,1))!=-1)
|
||||
{ |
||||
endvalue=false;
|
||||
break; |
||||
} |
||||
} |
||||
if(endvalue==false) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false;
|
||||
} |
||||
// 邮件地址正确
|
||||
return true; |
||||
} |
||||
else |
||||
{ |
||||
// 请输入电子信箱地址
|
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
}, |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:检查输入的是否为数字 提示信息:未输入或输入的不是一个合法的数字! 使用:isNumeric(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isNumeric":function(obj,ShowMsg) |
||||
{
|
||||
var show = ifShow(ShowMsg) ; |
||||
|
||||
var IfTrue = obj.value.search(/^(-|\+)?\d+(\.\d+)?$/) != -1; |
||||
|
||||
if (show && IfTrue ==false) |
||||
{
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
}
|
||||
else |
||||
{ |
||||
return true; |
||||
} |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== 功能:打印 |
||||
* 使用:Print() 返回: |
||||
* ================================================================== |
||||
*/ |
||||
"Print":function() |
||||
{ |
||||
|
||||
document.all.print.style.display = "none"; |
||||
window.print(); |
||||
window.close(); |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:判断是否为日期(格式:yyyy-mm-dd) 提示信息:未输入或输入的日期格式错误! 使用:isDate(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isDate":function(obj,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg) ; |
||||
|
||||
if(obj.value==null) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
|
||||
if(obj.value=="") |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
|
||||
var datePat=/^(\d{2}|\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/; |
||||
|
||||
var dateStr=obj.value; |
||||
// is the format ok?
|
||||
var matchArray = dateStr.match(datePat); |
||||
|
||||
|
||||
if (matchArray==null) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
year=matchArray[1]; |
||||
month=matchArray[3]; |
||||
day=matchArray[5]; |
||||
|
||||
if (year.length!=4 || month.length!=2 || day.length!=2) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
if (month < 1 || month > 12) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
if (day < 1 || day > 31) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
|
||||
if ((month==4 || month==6 || month==9 || month==11) && day==31) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
|
||||
if (month==2) |
||||
{ |
||||
var isleap=(year % 4==0 && (year % 100 !=0 || year % 400==0)); |
||||
if (day>29 || ((day==29) && (!isleap))) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:日期大小判断(格式:yyyy-mm-dd) 提示信息:未输入或输入的开始日期大于结束日期! |
||||
* 使用:JudgeDate(obj1,obj2,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"JudgeDate":function(obj1,obj2,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg) ; |
||||
|
||||
var eva = isDate(obj1,"") && isDate(obj2,""); |
||||
|
||||
if(obj1.value!="" && obj2.value!="" & eva != false) |
||||
{ |
||||
var date1 = obj1.value; |
||||
var myDate1 = Date.parse(date1.replace("-","/")); |
||||
var date2 = obj2.value; |
||||
var myDate2 = Date.parse(date2.replace("-","/")); |
||||
if(myDate1 > myDate2) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
return false; |
||||
} |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:字符串操作,去除字符串两边的空格 使用:Trim(string) 返回:string |
||||
* ================================================================== |
||||
*/ |
||||
/** |
||||
* ================================================================== |
||||
* 功能:去除左边的空格 使用:LTrim(string) 返回:string |
||||
* ================================================================== |
||||
*/ |
||||
"LTrim":function(str) |
||||
{ |
||||
var whitespace = new String(" \t\n\r"); |
||||
var s = new String(str); |
||||
|
||||
if (whitespace.indexOf(s.charAt(0)) != -1) |
||||
{ |
||||
var j=0, i = s.length; |
||||
while (j < i && whitespace.indexOf(s.charAt(j)) != -1) |
||||
{ |
||||
j++; |
||||
} |
||||
s = s.substring(j, i); |
||||
} |
||||
return s; |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:去除右边的空格 使用:RTrim(string) 返回:string |
||||
* ================================================================== |
||||
*/ |
||||
"RTrim":function(str) |
||||
{ |
||||
var whitespace = new String(" \t\n\r"); |
||||
var s = new String(str); |
||||
|
||||
if (whitespace.indexOf(s.charAt(s.length-1)) != -1) |
||||
{ |
||||
var i = s.length - 1; |
||||
while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) |
||||
{ |
||||
i--; |
||||
} |
||||
s = s.substring(0, i+1); |
||||
} |
||||
return s; |
||||
}, |
||||
|
||||
// 去除前后空格
|
||||
"Trim":function(str) |
||||
{ |
||||
return this.RTrim(this.LTrim(str)); |
||||
},
|
||||
|
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:无效字符的检测(不允许输入特殊字符) 提示信息:未输入或输入包含非法字符 使用:CheckChar(obj,Lchar,string) |
||||
* Lchar:要检查的特殊字符 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"CheckChar":function(obj,Lchar,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg); |
||||
|
||||
var strlist = Lchar; // "~!@#$%^&*?<>\"\'";
|
||||
|
||||
// 无效字符的检测
|
||||
if(obj.value!= "") |
||||
{
|
||||
var tmpbool=true; |
||||
for (i=0;i<obj.value.length;i++) |
||||
{ |
||||
if(strlist.indexOf(obj.value.substr(i,1))!=-1) |
||||
{ |
||||
tmpbool=false; |
||||
break; |
||||
} |
||||
else |
||||
{} |
||||
} |
||||
|
||||
if(tmpbool==false) |
||||
{ |
||||
if (show) alert(ShowMsg + strlist); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
return true; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if (show) alert(ShowMsg + strlist); |
||||
return false; |
||||
} |
||||
|
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:判断是否为整数、正整数、负整数、正整数+0、负整数+0 提示信息:参数错误或输入的不是一个(整数)。。 |
||||
* 使用:isInt(obj,string,int or string,string) (测试对象,+ or - or empty,empty or |
||||
* 0,显示信息) 空 整数 + 正整数 - 负整数 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isInt":function(obj,sign,zero,ShowMsg) |
||||
{ |
||||
var show =this.ifShow(ShowMsg); |
||||
|
||||
var objStr = obj.value; |
||||
var reg;
|
||||
var bolzero;
|
||||
|
||||
if(this.Trim(objStr)=="") |
||||
{
|
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
objStr=objStr.toString(); |
||||
}
|
||||
|
||||
if((sign==null)||(this.Trim(sign)=="")) |
||||
{ |
||||
sign="+-"; |
||||
} |
||||
|
||||
if((zero==null)||(this.Trim(zero)=="")) |
||||
{ |
||||
bolzero=false; |
||||
} |
||||
else |
||||
{ |
||||
zero=zero.toString(); |
||||
if(zero==0) |
||||
{ |
||||
bolzero=true; |
||||
} |
||||
else |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
switch(sign) |
||||
{ |
||||
case "+-": |
||||
// 整数
|
||||
reg=/(^-?|^\+?)\d+$/;
|
||||
break; |
||||
case "+":
|
||||
if(!bolzero)
|
||||
{ |
||||
// 正整数
|
||||
reg=/^\+?[0-9]*[1-9][0-9]*$/; |
||||
} |
||||
else |
||||
{ |
||||
// 正整数+0
|
||||
// reg=/^\+?\d+$/;
|
||||
reg=/^\+?[0-9]*[0-9][0-9]*$/; |
||||
} |
||||
break; |
||||
case "-": |
||||
if(!bolzero) |
||||
{ |
||||
// 负整数
|
||||
reg=/^-[0-9]*[1-9][0-9]*$/; |
||||
} |
||||
else |
||||
{ |
||||
// 负整数+0
|
||||
// reg=/^-\d+$/;
|
||||
reg=/^-[0-9]*[0-9][0-9]*$/; |
||||
}
|
||||
break; |
||||
default: |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
break; |
||||
} |
||||
|
||||
var r=objStr.match(reg); |
||||
if(r==null) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
else |
||||
{
|
||||
return true;
|
||||
} |
||||
}, |
||||
/** |
||||
* ================================================================== |
||||
* 功能:判断是否为浮点数、正浮点数、负浮点数、正浮点数+0、负浮点数+0 提示信息:参数错误或输入的不是一个(浮点数)。。 |
||||
* 使用:isFloat(obj,string,int or string,string) (测试对象,+ or - or empty,empty or |
||||
* 0,提示信息) 参数二: 空 浮点数 + 正浮点数 - 负浮点数 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isFloat":function(obj,sign,zero,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg); |
||||
|
||||
var objStr = obj.value; |
||||
var reg;
|
||||
var bolzero;
|
||||
|
||||
if(Trim(objStr)=="") |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
else |
||||
{ |
||||
objStr=objStr.toString(); |
||||
}
|
||||
|
||||
if((sign==null)||(Trim(sign)=="")) |
||||
{ |
||||
sign="+-"; |
||||
} |
||||
|
||||
if((zero==null)||(Trim(zero)=="")) |
||||
{ |
||||
bolzero=false; |
||||
} |
||||
else |
||||
{ |
||||
zero=zero.toString(); |
||||
if(zero==0) |
||||
{ |
||||
bolzero=true; |
||||
} |
||||
else |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
switch(sign) |
||||
{ |
||||
case "+-": |
||||
// 浮点数
|
||||
reg=/^((-?|\+?)\d+)(\.\d+)?$/; |
||||
break; |
||||
case "+":
|
||||
if(!bolzero)
|
||||
{ |
||||
// 正浮点数
|
||||
reg=/^\+?(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/; |
||||
} |
||||
else |
||||
{ |
||||
// 正浮点数+0
|
||||
reg=/^\+?\d+(\.\d+)?$/; |
||||
} |
||||
break; |
||||
case "-": |
||||
if(!bolzero) |
||||
{ |
||||
// 负浮点数
|
||||
reg=/^-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/; |
||||
} |
||||
else |
||||
{ |
||||
// 负浮点数+0
|
||||
reg=/^((-\d+(\.\d+)?)|(0+(\.0+)?))$/; |
||||
}
|
||||
break; |
||||
default: |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
break; |
||||
} |
||||
|
||||
var r=objStr.match(reg); |
||||
if(r==null) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
else |
||||
{
|
||||
return true;
|
||||
} |
||||
}, |
||||
|
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:验证身份证号码是否有效 提示信息:未输入或输入身份证号不正确! 使用:isIDno(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isIDcard":function(obj,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg); |
||||
|
||||
// aCity={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",71:"台湾",81:"香港",82:"澳门",91:"国外"};
|
||||
var aCity = "11,12,13,14,15,21,22,23,31,32,33,34,35,36,37,41,42,43,44,45,46,50,51,52,53,54,61,62,63,64,65,71,81,82,91"; |
||||
|
||||
var iSum = 0; |
||||
var info = ""; |
||||
var idCardLength = obj.value.length; |
||||
|
||||
if(!/^\d{17}(\d|x)$/i.test(obj.value)&&!/^\d{15}$/i.test(obj.value))
|
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
|
||||
// 在后面的运算中x相当于数字10,所以转换成a
|
||||
obj.value = obj.value.replace(/x$/i,"a"); |
||||
|
||||
var curCity = obj.value.substr(0,2); |
||||
|
||||
if(!(aCity.indexOf(curCity) > 0) ) |
||||
{ |
||||
if (show) alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
|
||||
if (idCardLength==18) |
||||
{ |
||||
sBirthday=obj.value.substr(6,4)+"-"+Number(obj.value.substr(10,2))+"-"+Number(obj.value.substr(12,2)); |
||||
var d = new Date(sBirthday.replace(/-/g,"/")); |
||||
if(sBirthday!=(d.getFullYear()+"-"+ (d.getMonth()+1) + "-" + d.getDate())) |
||||
{ |
||||
if (show)
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
|
||||
for(var i = 17;i>=0;i --) |
||||
iSum += (Math.pow(2,i) % 11) * parseInt(obj.value.charAt(17 - i),11); |
||||
|
||||
if(iSum%11!=1) |
||||
{ |
||||
if (show)
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
|
||||
} |
||||
else if (idCardLength==15) |
||||
{ |
||||
sBirthday = "19" + obj.value.substr(6,2) + "-" + Number(obj.value.substr(8,2)) + "-" + Number(obj.value.substr(10,2)); |
||||
var d = new Date(sBirthday.replace(/-/g,"/")); |
||||
var dd = d.getFullYear().toString() + "-" + (d.getMonth()+1) + "-" + d.getDate(); |
||||
|
||||
if(sBirthday != dd) |
||||
{
|
||||
if (show)
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
} |
||||
return true;
|
||||
}, |
||||
|
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:验证电话号码格式是否正确 提示信息:未输入或输入电话号码格式不正确! 使用:isPhoneNo(obj,string) 返回:bool |
||||
* ================================================================== |
||||
*/ |
||||
"isPhoneNo":function(obj,ShowMsg) |
||||
{ |
||||
var show = ifShow(ShowMsg); |
||||
|
||||
var phoneNo = obj.value; |
||||
var Endvalue = true; |
||||
var allowstrlist = "1234567890()-"; |
||||
if(phoneNo!="") |
||||
{
|
||||
for (i=0;i<phoneNo.length;i++)
|
||||
{ |
||||
if (allowstrlist.indexOf(phoneNo.substr(i,1)) == -1)
|
||||
{ |
||||
Endvalue = false;
|
||||
break; |
||||
} |
||||
} |
||||
if(Endvalue == false) |
||||
{ |
||||
if (show)
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
if (show)
|
||||
alert(ShowMsg); |
||||
obj.focus(); |
||||
obj.select(); |
||||
return false; |
||||
} |
||||
return true; |
||||
}, |
||||
|
||||
/** |
||||
* ================================================================== |
||||
* 功能:将金额小写转化成汉字大写 提示信息: |
||||
* 使用:MoneyToUpper('零,壹,贰,叁,肆,伍,陆,柒,捌,玖,','元,拾,佰,仟,万,拾,佰,仟,亿,拾,角,分,整,零零,零亿,亿万,零万,零元,零角,零分,',obj.value) |
||||
* 返回:string str1 = "零,壹,贰,叁,肆,伍,陆,柒,捌,玖," str2 = |
||||
* "元,拾,佰,仟,万,拾,佰,仟,亿,拾,角,分,整,零零,零亿,亿万,零万,零元,零角,零分," |
||||
* ================================================================== |
||||
*/ |
||||
"MoneyToUpper":function(str1,str2,Num) |
||||
{ |
||||
var charList1 = str1.split(","); |
||||
var charList2 = str2.split(","); |
||||
|
||||
for( i = Num.length-1;i>=0;i--) |
||||
{ |
||||
// 替换tomoney()中的“,”
|
||||
Num = Num.replace(",",""); |
||||
// 替换tomoney()中的空格
|
||||
Num = Num.replace(" ",""); |
||||
} |
||||
|
||||
// 替换掉可能出现的¥字符
|
||||
Num = Num.replace("¥",""); |
||||
// 验证输入的字符是否为数字
|
||||
if(isNaN(Num))
|
||||
{ |
||||
alert("Error: Not a Number !"); |
||||
return ""; |
||||
} |
||||
|
||||
// ---字符处理完毕,开始转换,转换采用前后两部分分别转换---
|
||||
var part = String(Num).split("."); |
||||
var newchar = "";
|
||||
// 小数点前进行转化
|
||||
for(i = part[0].length - 1; i>= 0 ; i--) |
||||
{ |
||||
// 若数量超过拾亿单位,提示
|
||||
if(part[0].length > 10) |
||||
{
|
||||
alert("Error Over Max Length !"); |
||||
return ""; |
||||
} |
||||
var tmpnewchar = ""; |
||||
|
||||
var perchar = part[0].charAt(i); |
||||
|
||||
tmpnewchar= charList1[perchar] + tmpnewchar; |
||||
|
||||
var indx = part[0].length-i-1; |
||||
if (indx == 0 || indx == 4 || indx == 8 || indx == 9) |
||||
{ |
||||
tmpnewchar = tmpnewchar + charList2[indx]; |
||||
} |
||||
else |
||||
{ |
||||
if(perchar!=0) tmpnewchar = tmpnewchar + charList2[indx]; |
||||
} |
||||
newchar = tmpnewchar + newchar; |
||||
|
||||
} |
||||
|
||||
// 小数点之后进行转化
|
||||
if( String(Num).indexOf(".") != -1) |
||||
{ |
||||
if(part[1].length > 2)
|
||||
{ |
||||
part[1] = part[1].substr(0,2); |
||||
} |
||||
for(i=0;i<part[1].length;i++) |
||||
{ |
||||
tmpnewchar = ""; |
||||
perchar = part[1].charAt(i); |
||||
|
||||
tmpnewchar = charList1[perchar] + tmpnewchar;
|
||||
if(i==0)tmpnewchar =tmpnewchar + charList2[10]; // 角
|
||||
if(i==1)tmpnewchar = tmpnewchar + charList2[11]; // 分
|
||||
newchar = newchar + tmpnewchar; |
||||
}
|
||||
|
||||
}
|
||||
|
||||
// alert(newchar);
|
||||
|
||||
// 替换 零零 为 零
|
||||
while(newchar.search(charList2[13]) != -1) |
||||
{ |
||||
newchar = newchar.replace(charList2[13], charList1[0]); // 零零 to 零
|
||||
newchar = newchar.replace(charList2[14], charList2[8]); // "零亿" to "亿"
|
||||
newchar = newchar.replace(charList2[15], charList2[8]); // "亿万" to "亿"
|
||||
|
||||
newchar = newchar.replace(charList2[16], charList2[4]); // "零万" to "万"
|
||||
newchar = newchar.replace(charList2[17], charList2[0]); // "零元" to "元"
|
||||
newchar = newchar.replace(charList2[18], ""); // "零角" to ""
|
||||
newchar = newchar.replace(charList2[19], ""); // "零分" to ""
|
||||
} |
||||
|
||||
newchar = newchar.replace(charList2[14], charList2[8]); // "零亿" to "亿"
|
||||
newchar = newchar.replace(charList2[15], charList2[8]); // "亿万" to "亿"
|
||||
|
||||
newchar = newchar.replace(charList2[16], charList2[4]); // "零万" to "万"
|
||||
newchar = newchar.replace(charList2[17], charList2[0]); // "零元" to "元"
|
||||
newchar = newchar.replace(charList2[18], ""); // "零角" to ""
|
||||
newchar = newchar.replace(charList2[19], ""); // "零分" to ""
|
||||
|
||||
newchar = newchar + charList2[12]; |
||||
|
||||
// 0.6元的情况
|
||||
if(newchar.indexOf(charList2[0]) == 0) |
||||
newchar = newchar.replace(charList2[0],""); |
||||
|
||||
return newchar; |
||||
}, |
||||
|
||||
}; |
||||
@ -1,329 +0,0 @@ |
||||
// JavaScript Document
|
||||
(function($) { |
||||
|
||||
/** |
||||
* ajax提交表单 |
||||
*
|
||||
* @form 表单 格式:#表单id |
||||
* @config 配置扩展用,可包含参数:func,回调方法 |
||||
*/ |
||||
$.fn.postForm = function(form, config) { |
||||
var target = $(this); |
||||
if (isEmpty($(form).attr("action")) && isEmpty(config.action)) { |
||||
alert("配置错误:from表单不存在action属性"); |
||||
return; |
||||
} |
||||
var func; |
||||
var action = $(form).attr("action"); |
||||
var data_type = "json"; |
||||
if (config != undefined) { |
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
if (config.action != undefined) { |
||||
action = config.action; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : "POST", |
||||
url : action, |
||||
dataType : data_type, |
||||
data : $(form).serialize(), |
||||
beforeSend : function() { |
||||
target.attr("disabled", true); |
||||
}, |
||||
success : function(data) { |
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
target.removeAttr("disabled"); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 发起ajax连接请求 |
||||
*
|
||||
* @config(优先) 配置扩展用,可包含参数:func,回调方法 |
||||
* config格式:{url:请求地址,data:请求参数,loadingText:加载时文字} |
||||
* 调用该方法的元素必须存在data-ajax-url参数; 参数:data-ajax-url必须 |
||||
* data-ajax-data 可选 |
||||
*/ |
||||
$.fn.request = function(config) { |
||||
var target = $(this); |
||||
if (isEmpty(target.attr("data-ajax-url")) |
||||
&& isEmpty(config.url)) { |
||||
alert(target.selector + "配置错误:data-ajax-url属性不存在"); |
||||
return; |
||||
} |
||||
var method = "POST"; |
||||
var data_type = "json"; |
||||
var func = null; |
||||
var _url = isEmpty(target.attr("data-ajax-url")) ? null |
||||
: target.attr("data-ajax-url");// 请求地址
|
||||
var _data = isEmpty(target.attr("data-ajax-data")) ? null |
||||
: target.attr("data-ajax-data");// 请求参数
|
||||
var _loadingText = isEmpty(target |
||||
.attr("data-ajax-loading-text")) ? null : target |
||||
.attr("data-ajax-loading-text");// 加载状态;
|
||||
var data_type = isEmpty(target.attr("data-ajax-type")) ? null |
||||
: target.attr("data-ajax-type");// 返回数据类型
|
||||
var text = target.text(); |
||||
if (config != undefined) { |
||||
// 请求方法
|
||||
if (config.method != undefined) { |
||||
var _method = config.method; |
||||
if (_method.toLowerCase() != "post" |
||||
|| _method.toLowerCase() != "get") { |
||||
method = _method; |
||||
} |
||||
} |
||||
// 回调方法
|
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
// 返回数据类型
|
||||
if (config.type != undefined) { |
||||
var _type = config.type.toLowerCase(); |
||||
if (_type == "xml" || _type == "html" |
||||
|| _type == "script" || _type == "jsonp" |
||||
|| _type == "json" || _type == "text") { |
||||
data_type = _type; |
||||
} |
||||
|
||||
} |
||||
if (config.url != undefined) { |
||||
_url = config.url; |
||||
} |
||||
if (config.data != undefined) { |
||||
_data = config.data; |
||||
} |
||||
if (config.loadingText != undefined) { |
||||
_loadingText = config.loadingText; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : method, |
||||
url : _url, |
||||
dataType : data_type, |
||||
data : _data, |
||||
beforeSend : function() { |
||||
if (target[0].nodeName == "INPUT") { |
||||
if (!isEmpty(_loadingText)) { |
||||
target.text(_loadingText); |
||||
} |
||||
target.attr("disabled", true); |
||||
} |
||||
|
||||
}, |
||||
success : function(data) { |
||||
|
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
if (target[0].nodeName == "INPUT") { |
||||
target.removeAttr("disabled"); |
||||
target.text(text); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
$.fn.noDataMsg = function(config) { |
||||
if (config != undefined) { |
||||
|
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 判断是否为空, target:判断对象 message:提示信息 true:为空 false:不为空 |
||||
*/ |
||||
function isEmpty(target, message) { |
||||
if (target == undefined || target == null || target.trim() == "" |
||||
|| target.trim().length == 0) { |
||||
if (message != undefined) { |
||||
alert(message); |
||||
} |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
})(jQuery); |
||||
|
||||
var Ms = { |
||||
_target : this, |
||||
"msg" : function(str, url) { // 提示消息 Ms.msg()调用
|
||||
var obj = $("<div class='ms-msg'></div>"); |
||||
$("body").append(obj); |
||||
obj.html(str).show(); |
||||
obj.animate({ |
||||
opacity : 1, |
||||
}, 500, 'ease', function() { |
||||
$(this).animate({ |
||||
opacity : 0, |
||||
}, 800, 'ease', function() { |
||||
if (typeof (url) != "undefined") { |
||||
_target.loadUrl(url); |
||||
} |
||||
}); |
||||
}); |
||||
}, |
||||
"loadUrl" : function(url) { |
||||
location.href = url; |
||||
}, |
||||
"post" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "POST", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
try { |
||||
_target.msg("加载中...");
|
||||
} catch (e) { |
||||
|
||||
} |
||||
}, |
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
try { |
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} catch (e) { |
||||
|
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
"get" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "GET", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
_target.msg("加载中..."); |
||||
}, |
||||
|
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} |
||||
}); |
||||
}, |
||||
"load" : function(url, method, params, func) { // 非会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : method, |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
_target.msg("加载中..."); |
||||
}, |
||||
success : function(json) { |
||||
if (func != null && func != undefined) { |
||||
func(json); |
||||
} |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} |
||||
}); |
||||
}, |
||||
"setCookie" : function(key, value, time) { // 依赖zepto.cookie.min.js
|
||||
// time单位为天数字
|
||||
$.fn.cookie(key, value, { |
||||
path : '/', |
||||
expires : time |
||||
}); |
||||
}, |
||||
"getCookie" : function(key) { // 读取cookie
|
||||
return decodeURIComponent($.fn.cookie(key)); |
||||
}, |
||||
"delCookie" : function(key) { |
||||
$.fn.cookie(key, null); |
||||
}, |
||||
"queryString" : function(param) { |
||||
var svalue = location.search.match(new RegExp("[\?\&]" + param |
||||
+ "=([^\&]*)(\&?)", "i")); |
||||
return svalue ? svalue[1] : svalue; |
||||
}, |
||||
"initModal" : function() { // 初始化模态框
|
||||
// 弹出框处理
|
||||
if ($("*[data-toggle='modal']").size() > 0) { |
||||
$("*[data-toggle='modal']").each( |
||||
function(index) { |
||||
$("body").on( |
||||
"tap", |
||||
"[data-target=\"" + $(this).attr("data-target") |
||||
+ "\"]", |
||||
function() { |
||||
if ($(this).attr("data-target") != "") { |
||||
openModal($(this).attr("data-target"), |
||||
w, h); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
function openModal(modalId, w, h) { |
||||
|
||||
$(modalId).show(); |
||||
Ms.init(w, h); |
||||
|
||||
if (!$(modalId).parent().hasClass("modalMask")) { |
||||
$(modalId) |
||||
.wrap( |
||||
"<div class='modalMask' style='width:" |
||||
+ w |
||||
+ "px;height:" |
||||
+ h |
||||
+ "px;position: absolute;background:rgba(0, 0, 0, 0.6) none repeat scroll 0 0 !important;filter:Alpha(opacity=80); background:#fff;z-index: 9997;top: 0;'>"); |
||||
} else { |
||||
$(modalId).parent().show(); |
||||
} |
||||
$(modalId).find(".ms-modal-button").css("line-height", "200%"); |
||||
$(modalId).css( |
||||
"margin-left", |
||||
($(modalId).parent().width() - $(modalId).width()) / 2 |
||||
+ "px"); |
||||
$(modalId).css("margin-top", "10%"); |
||||
$(modalId).on("tap", ".close", function() { |
||||
// $(modalId).hide();
|
||||
// $(modalId).unwrap().parent();
|
||||
hideModal(modalId); |
||||
}) |
||||
} |
||||
|
||||
function hideModal(modalId) { |
||||
|
||||
$(modalId).parent().hide(); |
||||
$(modalId).hide(); |
||||
} |
||||
}, |
||||
"browser" : { |
||||
versions : function() { |
||||
var u = navigator.userAgent, app = navigator.appVersion; |
||||
return { |
||||
android4 : u.indexOf('Android 4') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
android2 : u.indexOf('Android 2') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
iPhone : u.indexOf('iPhone') > -1, |
||||
iPad : u.indexOf('iPad') > -1, |
||||
iPod : u.indexOf('iPod') > -1, |
||||
}; |
||||
}(), |
||||
language : (navigator.browserLanguage || navigator.language) |
||||
.toLowerCase() |
||||
} |
||||
}; |
||||
var ms = Ms; |
||||
@ -1,52 +0,0 @@ |
||||
body { |
||||
padding-top: 40px; |
||||
padding-bottom: 40px; |
||||
background-color: #eee; |
||||
} |
||||
|
||||
.form-signin { |
||||
max-width: 330px; |
||||
padding: 15px; |
||||
margin: 0 auto; |
||||
} |
||||
.form-signin .form-signin-heading, |
||||
.form-signin .checkbox { |
||||
margin-bottom: 10px; |
||||
} |
||||
.form-signin .checkbox { |
||||
font-weight: normal; |
||||
} |
||||
.form-signin .form-control { |
||||
position: relative; |
||||
height: auto; |
||||
-webkit-box-sizing: border-box; |
||||
-moz-box-sizing: border-box; |
||||
box-sizing: border-box; |
||||
padding: 10px; |
||||
font-size: 16px; |
||||
} |
||||
.form-signin .form-control:focus { |
||||
z-index: 2; |
||||
} |
||||
.form-signin input[type="email"] { |
||||
margin-bottom: -1px; |
||||
border-bottom-right-radius: 0; |
||||
border-bottom-left-radius: 0; |
||||
} |
||||
.form-signin input[type="password"] { |
||||
border-top-left-radius: 0; |
||||
border-top-right-radius: 0; |
||||
} |
||||
.form-signin input[name="verify"] { |
||||
margin-bottom:10px; |
||||
width:60%; |
||||
float:left; |
||||
border-top-left-radius: 0; |
||||
border-top-right-radius: 0; |
||||
} |
||||
.form-signin .checkimage { |
||||
width: 70px; |
||||
height:33px; |
||||
float: left; |
||||
margin: 5px 25px; |
||||
} |
||||
@ -1,44 +0,0 @@ |
||||
|
||||
/* ------- This is the CSS Reset ------- */ |
||||
|
||||
html, body, div, span, applet, object, iframe, |
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, |
||||
abbr, acronym, address, big, cite, code, del, |
||||
dfn, em, img, ins, kbd, q, s, samp, small, |
||||
strike, strong, sub, sup, tt, var, u, i, center, |
||||
dl, dt, dd, ol, ul, li, fieldset, form, label, |
||||
legend, table, caption, tbody, tfoot, thead, tr, |
||||
th, td, article, aside, canvas, details, embed, |
||||
figure, figcaption, footer, header, hgroup, menu, |
||||
nav, output, ruby, section, summary, time, mark, audio, video { |
||||
margin: 0; |
||||
padding: 0; |
||||
border: 0; |
||||
font-size: 100%; |
||||
font: inherit; |
||||
vertical-align: baseline; |
||||
} |
||||
|
||||
/* ------- HTML5 display-role reset for older browsers ------- */ |
||||
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { |
||||
display: block; |
||||
} |
||||
body { |
||||
line-height: 1; |
||||
} |
||||
ol, ul { |
||||
list-style: none; |
||||
} |
||||
blockquote, q { |
||||
quotes: none; |
||||
} |
||||
blockquote:before, blockquote:after, q:before, q:after { |
||||
content: ''; |
||||
content: none; |
||||
} |
||||
table { |
||||
border-collapse: collapse; |
||||
border-spacing: 0; |
||||
} |
||||
|
||||
@ -1,188 +0,0 @@ |
||||
/* |
||||
* |
||||
* Template Name: Fullscreen Login |
||||
* Description: Login Template with Fullscreen Background Slideshow |
||||
* Author: Anli Zaimi |
||||
* Author URI: http://azmind.com |
||||
* |
||||
*/ |
||||
|
||||
|
||||
body { |
||||
background: #f8f8f8; |
||||
font-family: 'PT Sans', Helvetica, Arial, sans-serif; |
||||
text-align: center; |
||||
color: #fff; |
||||
} |
||||
|
||||
.page-container { |
||||
position: relative; |
||||
top:25%; |
||||
} |
||||
|
||||
h1 { |
||||
font-size: 30px; |
||||
font-weight: 700; |
||||
text-shadow: 0 1px 4px rgba(0,0,0,.2); |
||||
} |
||||
|
||||
form { |
||||
position: relative; |
||||
width: 305px; |
||||
margin: 15px auto 0 auto; |
||||
text-align: center; |
||||
} |
||||
|
||||
input { |
||||
width: 300px; |
||||
height: 42px; |
||||
margin-top: 10px; |
||||
padding: 0 15px; |
||||
background: #2d2d2d; /* browsers that don't support rgba */ |
||||
background: rgba(45,45,45,.15); |
||||
-moz-border-radius: 6px; |
||||
-webkit-border-radius: 6px; |
||||
border-radius: 6px; |
||||
border: 1px solid #3d3d3d; /* browsers that don't support rgba */ |
||||
border: 1px solid rgba(255,255,255,.15); |
||||
-moz-box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset; |
||||
-webkit-box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset; |
||||
box-shadow: 0 2px 3px 0 rgba(0,0,0,.1) inset; |
||||
font-family: 'PT Sans', Helvetica, Arial, sans-serif; |
||||
font-size: 14px; |
||||
color: #fff; |
||||
text-shadow: 0 1px 2px rgba(0,0,0,.1); |
||||
-o-transition: all .2s; |
||||
-moz-transition: all .2s; |
||||
-webkit-transition: all .2s; |
||||
-ms-transition: all .2s; |
||||
} |
||||
|
||||
input:-moz-placeholder { color: #fff; } |
||||
input:-ms-input-placeholder { color: #fff; } |
||||
input::-webkit-input-placeholder { color: #fff; } |
||||
|
||||
input:focus { |
||||
outline: none; |
||||
-moz-box-shadow: |
||||
0 2px 3px 0 rgba(0,0,0,.1) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
-webkit-box-shadow: |
||||
0 2px 3px 0 rgba(0,0,0,.1) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
box-shadow: |
||||
0 2px 3px 0 rgba(0,0,0,.1) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
} |
||||
|
||||
button { |
||||
cursor: pointer; |
||||
width: 300px; |
||||
height: 44px; |
||||
margin-top: 25px; |
||||
padding: 0; |
||||
background: #ef4300; |
||||
-moz-border-radius: 6px; |
||||
-webkit-border-radius: 6px; |
||||
border-radius: 6px; |
||||
border: 1px solid #ff730e; |
||||
-moz-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.25) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
-webkit-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.25) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.25) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
font-family: 'PT Sans', Helvetica, Arial, sans-serif; |
||||
font-size: 14px; |
||||
font-weight: 700; |
||||
color: #fff; |
||||
text-shadow: 0 1px 2px rgba(0,0,0,.1); |
||||
-o-transition: all .2s; |
||||
-moz-transition: all .2s; |
||||
-webkit-transition: all .2s; |
||||
-ms-transition: all .2s; |
||||
} |
||||
|
||||
button:hover { |
||||
-moz-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.15) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
-webkit-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.15) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.15) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
} |
||||
|
||||
button:active { |
||||
-moz-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.15) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
-webkit-box-shadow: |
||||
0 15px 30px 0 rgba(255,255,255,.15) inset, |
||||
0 2px 7px 0 rgba(0,0,0,.2); |
||||
box-shadow: |
||||
0 5px 8px 0 rgba(0,0,0,.1) inset, |
||||
0 1px 4px 0 rgba(0,0,0,.1); |
||||
|
||||
border: 0px solid #ef4300; |
||||
} |
||||
|
||||
.error { |
||||
display: none; |
||||
position: absolute; |
||||
top: 27px; |
||||
right: -55px; |
||||
width: 40px; |
||||
height: 40px; |
||||
background: #2d2d2d; /* browsers that don't support rgba */ |
||||
background: rgba(45,45,45,.25); |
||||
-moz-border-radius: 8px; |
||||
-webkit-border-radius: 8px; |
||||
border-radius: 8px; |
||||
} |
||||
|
||||
.error span { |
||||
display: inline-block; |
||||
margin-left: 2px; |
||||
font-size: 40px; |
||||
font-weight: 700; |
||||
line-height: 40px; |
||||
text-shadow: 0 1px 2px rgba(0,0,0,.1); |
||||
-o-transform: rotate(45deg); |
||||
-moz-transform: rotate(45deg); |
||||
-webkit-transform: rotate(45deg); |
||||
-ms-transform: rotate(45deg); |
||||
|
||||
} |
||||
|
||||
.connect { |
||||
width: 305px; |
||||
margin: 35px auto 0 auto; |
||||
font-size: 18px; |
||||
font-weight: 700; |
||||
text-shadow: 0 1px 3px rgba(0,0,0,.2); |
||||
} |
||||
|
||||
.connect a { |
||||
display: inline-block; |
||||
width: 32px; |
||||
height: 35px; |
||||
margin-top: 15px; |
||||
-o-transition: all .2s; |
||||
-moz-transition: all .2s; |
||||
-webkit-transition: all .2s; |
||||
-ms-transition: all .2s; |
||||
} |
||||
|
||||
.connect a.facebook { background: url(../images/facebook.png) center center no-repeat; } |
||||
.connect a.twitter { background: url(../images/twitter.png) center center no-repeat; } |
||||
|
||||
.connect a:hover { background-position: center bottom; } |
||||
|
||||
|
||||
|
||||
@ -1,34 +0,0 @@ |
||||
/* |
||||
|
||||
Supersized - Fullscreen Slideshow jQuery Plugin |
||||
Version : 3.2.7 |
||||
Site : www.buildinternet.com/project/supersized |
||||
|
||||
Author : Sam Dunn |
||||
Company : One Mighty Roar (www.onemightyroar.com) |
||||
License : MIT License / GPL License |
||||
|
||||
*/ |
||||
|
||||
* { margin:0; padding:0; } |
||||
body { background:#111; height:100%; } |
||||
img { border:none; } |
||||
|
||||
#supersized-loader { position:absolute; top:50%; left:50%; z-index:0; width:60px; height:60px; margin:-30px 0 0 -30px; text-indent:-999em; background:url(../images/progress.gif) no-repeat center center;} |
||||
|
||||
#supersized { display:block; position:fixed; left:0; top:0; overflow:hidden; z-index:-999; height:100%; width:100%; } |
||||
#supersized img { width:auto; height:auto; position:relative; display:none; outline:none; border:none; } |
||||
#supersized.speed img { -ms-interpolation-mode:nearest-neighbor; image-rendering: -moz-crisp-edges; } /*Speed*/ |
||||
#supersized.quality img { -ms-interpolation-mode:bicubic; image-rendering: optimizeQuality; } /*Quality*/ |
||||
|
||||
#supersized li { display:block; list-style:none; z-index:-30; position:fixed; overflow:hidden; top:0; left:0; width:100%; height:100%; background:#111; } |
||||
#supersized a { width:100%; height:100%; display:block; } |
||||
#supersized li.prevslide { z-index:-20; } |
||||
#supersized li.activeslide { z-index:-10; } |
||||
#supersized li.image-loading { background:#111 url(../images/progress.gif) no-repeat center center; width:100%; height:100%; } |
||||
#supersized li.image-loading img{ visibility:hidden; } |
||||
#supersized li.prevslide img, #supersized li.activeslide img{ display:inline; } |
||||
|
||||
|
||||
#supersized img { max-width: none !important } |
||||
|
||||
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 34 KiB |
@ -1,292 +0,0 @@ |
||||
//点击页面其他位置头部菜单收缩
|
||||
$(document).bind("click",function(e){ |
||||
var target = $(e.target); |
||||
if(target.closest(".menu-default").length == 0){ |
||||
manager.topMenu.initTop(); |
||||
} |
||||
}) |
||||
//浏览器窗口调整事件
|
||||
$(window).resize(function () {
|
||||
$(".categoryTree").height($(document).height()); |
||||
$("#listFrame").height($(document).height()); |
||||
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width: $('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
});
|
||||
})
|
||||
$(function(){ |
||||
//左侧菜单滚动条,鼠标上移显示
|
||||
$(".ms-menu,.ms-content-menu").mouseover(function () { |
||||
$(this).css("overflow-y","auto"); |
||||
}); |
||||
$(".ms-menu,.ms-content-menu").mouseleave(function () { |
||||
$(this).css("overflow-y","hidden"); |
||||
}); |
||||
|
||||
//收缩左侧菜单
|
||||
$(".slideMenu").click(function(){ |
||||
var obj = $(this); |
||||
if ($(".ms-menu").css("left") == "0px") { |
||||
//修改图标
|
||||
obj.children(".icon-open").show(); |
||||
obj.children(".icon-close").hide(); |
||||
$(".ms-menu-div").css("position","absolute"); |
||||
$(".ms-menu,.ms-menu-div").animate({left:'-180px'},100) |
||||
//改变右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width() |
||||
}); |
||||
} else { |
||||
//修改图标
|
||||
obj.children(".icon-open").hide(); |
||||
obj.children(".icon-close").show(); |
||||
$(".ms-menu-div").css("position","relative"); |
||||
$(".ms-menu,.ms-menu-div").animate({left:'0px'},50) |
||||
|
||||
//恢复右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
}); |
||||
} |
||||
}) |
||||
|
||||
//点击左侧菜单添加选项卡
|
||||
$(".ms-menu").delegate(".ms-menu-child a","click",function(){ |
||||
$(".easyui-tabs").show(); |
||||
$(".wellcome").hide(); |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
$(this).addClass("active"); |
||||
var title=$(this).data("title"); |
||||
var content=$(this).data("url"); |
||||
var id=$(this).data("id"); |
||||
if (!$('.easyui-tabs').tabs('exists', title)) { |
||||
$('.easyui-tabs').tabs('add', { |
||||
title: title, |
||||
content: '<iframe src='+content+' frameborder="0" height="100%" width="100%" id="mainFrame'+id+'" name="mainFrame'+id+'"></iframe>', |
||||
closable: true, |
||||
tools:[{ |
||||
iconCls:'icon-mini-refresh', |
||||
title:"刷新当前选项卡", |
||||
handler:function(){ |
||||
$('#mainFrame'+id).attr('src', $('#mainFrame'+id).attr('src')); |
||||
} |
||||
}] |
||||
}); |
||||
|
||||
|
||||
} else { |
||||
$('.easyui-tabs').tabs('select', title); |
||||
} |
||||
}) |
||||
|
||||
|
||||
//用户在切换选项卡时,和导航树保持同步
|
||||
$('.easyui-tabs').tabs({ |
||||
onSelect: function(title){ |
||||
var _select = $(".easyui-tabs").tabs("getSelected"); |
||||
var obj = _select.panel("options").tab; |
||||
//循环左侧菜单里每个菜单的text进行选项卡的title进行对比
|
||||
$(".ms-menu").find("li").each(function(){ |
||||
var target = $(this); |
||||
if(target.text() == obj.text()){ |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
//左侧对应菜单展开选中
|
||||
$(".ms-menu-none").hide(); |
||||
target.parent().parent().slideDown(); |
||||
target.parent().slideDown(); |
||||
target.find("a").addClass("active"); |
||||
//头部对应一级菜单进行选中
|
||||
$(".ms-menu-list").find("li").removeClass("active").each(function(){ |
||||
if(target.parent().parent().data("model-id") == $(this).data("model-id")){ |
||||
$(this).addClass("active"); |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
}); |
||||
|
||||
|
||||
//当关闭最后一个选项卡时,隐藏选项卡页面显示主界面
|
||||
$('.easyui-tabs').tabs({ |
||||
onClose:function(){ |
||||
if($('.easyui-tabs').tabs('tabs').length==0){ |
||||
$(".wellcome").show(); |
||||
$(".easyui-tabs").hide(); |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
$(".ms-menu-list").find("li").removeClass("active") |
||||
} |
||||
|
||||
} |
||||
}) |
||||
}) |
||||
|
||||
//MStore做的计时循环特效
|
||||
window.setInterval(showMstore, 1000);
|
||||
function showMstore(){
|
||||
$(".ms-top-mstore").find(".animated").addClass("rubberBand") |
||||
}
|
||||
window.setInterval(hiddenMstore, 1500);
|
||||
function hiddenMstore(){
|
||||
$(".ms-top-mstore").find(".animated").removeClass("rubberBand") |
||||
}
|
||||
|
||||
var manager = { |
||||
/*头部菜单操作*/ |
||||
topMenu:{ |
||||
initEvent: function() { |
||||
$("*[data-ms-*]").each() |
||||
}, |
||||
/*追加头部菜单*/ |
||||
initMenu: function(json) { |
||||
$("#ms-menu-list-tmpl").tmpl(json).appendTo(".ms-menu-list"); |
||||
if($(".ms-menu-list").children().length>5){ |
||||
$(".openMenu").show(); |
||||
} |
||||
|
||||
|
||||
//将左侧菜单追加,只是隐藏了
|
||||
$("#ms-menu-tmpl").tmpl(json).appendTo(".ms-menu"); |
||||
$(".ms-menu-parent").each(function(n) { |
||||
var arr = new Array; |
||||
for (i = 0; i < json.length; i++) json[i].modelModelId == $(this).data("model-id") && arr.push(json[i]) |
||||
//alert(arr)
|
||||
$("#ms-menu-child-tmpl").tmpl(arr).appendTo($(this).find("ul:first")) |
||||
|
||||
}) |
||||
}, |
||||
|
||||
/*头部菜单点击收缩效果*/ |
||||
topMenuOpen: function(target,menuShow){ |
||||
var _height=$(".ms-menu-list").height(); |
||||
if(target.parent().hasClass(menuShow)){ |
||||
this.initTop(); |
||||
}else{ |
||||
target.parent().addClass(menuShow); |
||||
$('.'+menuShow).height(_height); |
||||
} |
||||
}, |
||||
/*初始化头部菜单*/ |
||||
initTop:function(){ |
||||
$(".menu-default").height("50px"); |
||||
$(".menu-default").removeClass("menu-show"); |
||||
}, |
||||
/*点击头部菜单展示二级菜单*/ |
||||
showChildMenu:function(target,json){ |
||||
var _json = {"modelTitle":target.text(),"modelIcon":target.data("model-icon"),"modelId":target.data("model-id")}; |
||||
var arr = new Array; |
||||
$(".ms-menu-list").find("li").removeClass("active"); |
||||
target.addClass("active"); |
||||
|
||||
//显示左侧菜单
|
||||
if ($(".ms-menu").css("display") == "none") { |
||||
$(".slideMenu").children(".icon-open").hide(); |
||||
$(".slideMenu").children(".icon-close").show(); |
||||
$(".ms-menu,.ms-menu-div").show(); |
||||
//恢复右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
}); |
||||
} |
||||
|
||||
$(".ms-menu-parent").each(function(){ |
||||
if(target.data("model-id")==$(this).data("model-id")){ |
||||
$(this).show(); |
||||
$(".ms-menu-parent").find("ul").slideUp(); |
||||
$(this).find("ul").slideDown(); |
||||
|
||||
//默认打开当前模块的第一个菜单项
|
||||
$(".easyui-tabs").show(); |
||||
$(".wellcome").hide(); |
||||
var title=$(this).find("ul li:eq(0) a").data("title"); |
||||
var content=$(this).find("ul li:eq(0) a").data("url"); |
||||
var id = $(this).find("ul li:eq(0) a").data("id"); |
||||
if (!$('.easyui-tabs').tabs('exists', title)) { |
||||
$('.easyui-tabs').tabs('add', { |
||||
title: title, |
||||
content: '<iframe src='+content+' frameborder="0" height="100%" width="100%" id="mainFrame'+id+'" name="mainFrame'+id+'"></iframe>', |
||||
closable: true, |
||||
tools:[{ |
||||
iconCls:'icon-mini-refresh', |
||||
handler:function(){ |
||||
$('#mainFrame'+id).attr('src', $('#mainFrame'+id).attr('src')); |
||||
} |
||||
}] |
||||
});
|
||||
} else { |
||||
$('.easyui-tabs').tabs('select', title); |
||||
} |
||||
} |
||||
}) |
||||
this.initTop(); |
||||
}, |
||||
|
||||
}, |
||||
|
||||
/*左侧菜单操作*/ |
||||
leftMenu:{ |
||||
/*左侧菜单点击收缩效果*/ |
||||
leftMenuOpen:function(target,menu){ |
||||
menu.slideToggle(); |
||||
|
||||
}, |
||||
|
||||
}, |
||||
|
||||
|
||||
} |
||||
|
||||
$(function(){ |
||||
|
||||
//当头部菜单超过5个时,点击展开头部菜单
|
||||
$(".openMenu").click(function(){ |
||||
manager.topMenu.topMenuOpen($(this),"menu-show"); |
||||
}) |
||||
|
||||
//点击展开左侧菜单子菜单
|
||||
$(".ms-menu").delegate(".ms-menu-parent-title","click",function(){ |
||||
var menu = $(this).parent().siblings(".ms-menu-child"); |
||||
manager.leftMenu.leftMenuOpen($(this),menu); |
||||
}) |
||||
|
||||
//移除左侧菜单
|
||||
$(".ms-menu").delegate(".ms-menu-parent","mouseover",function(){ |
||||
$(".closeMenu").hide(); |
||||
$(this).find(".closeMenu").show(); |
||||
}) |
||||
$(document).bind("mouseover",function(e){ |
||||
var target = $(e.target); |
||||
if(target.closest(".ms-menu-parent").length == 0){ |
||||
$(".closeMenu").hide(); |
||||
} |
||||
}) |
||||
//关闭左侧菜单
|
||||
$(".ms-menu").delegate(".closeMenu","click",function(){ |
||||
$(this).parent().parent().hide(); |
||||
var menu = $(this).parent().siblings(".ms-menu-child"); |
||||
manager.leftMenu.leftMenuOpen($(this),menu); |
||||
var index=0; |
||||
$(".ms-menu-parent").each(function(){ |
||||
var target = $(this) |
||||
$(".ms-menu-list li").each(function(){ |
||||
if(target.data("model-id")==$(this).data("model-id")){ |
||||
$(this).removeClass("active"); |
||||
} |
||||
}) |
||||
|
||||
if($(this).css("display") == "none"){ |
||||
index++; |
||||
if(index == $(".ms-menu-parent").length){ |
||||
$(".ms-menu-list li").removeClass("active"); |
||||
$(".ms-menu-none").show(); |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
}) |
||||
@ -1,333 +0,0 @@ |
||||
// JavaScript Document
|
||||
(function($) { |
||||
|
||||
/** |
||||
* ajax提交表单 |
||||
*
|
||||
* @form 表单 格式:#表单id |
||||
* @config 配置扩展用,可包含参数:func,回调方法 |
||||
*/ |
||||
$.fn.postForm = function(form, config) { |
||||
var target = $(this); |
||||
if (isEmpty($(form).attr("action")) && isEmpty(config.action)) { |
||||
alert("配置错误:from表单不存在action属性"); |
||||
return; |
||||
} |
||||
var func; |
||||
var action = $(form).attr("action"); |
||||
var data_type = "json"; |
||||
if (config != undefined) { |
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
if (config.action != undefined) { |
||||
action = config.action; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : "POST", |
||||
url : action, |
||||
dataType : data_type, |
||||
data : $(form).serialize(), |
||||
beforeSend : function() { |
||||
target.attr("disabled", true); |
||||
}, |
||||
success : function(data) { |
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
target.removeAttr("disabled"); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 发起ajax连接请求 |
||||
*
|
||||
* @config(优先) 配置扩展用,可包含参数:func,回调方法 |
||||
* config格式:{url:请求地址,data:请求参数,loadingText:加载时文字} |
||||
* 调用该方法的元素必须存在data-ajax-url参数; 参数:data-ajax-url必须 |
||||
* data-ajax-data 可选 |
||||
*/ |
||||
$.fn.request = function(config) { |
||||
var target = $(this); |
||||
if (isEmpty(target.attr("data-ajax-url")) |
||||
&& isEmpty(config.url)) { |
||||
alert(target.selector + "配置错误:data-ajax-url属性不存在"); |
||||
return; |
||||
} |
||||
var method = "POST"; |
||||
var data_type = "json"; |
||||
var func = null; |
||||
var _url = isEmpty(target.attr("data-ajax-url")) ? null |
||||
: target.attr("data-ajax-url");// 请求地址
|
||||
var _data = isEmpty(target.attr("data-ajax-data")) ? null |
||||
: target.attr("data-ajax-data");// 请求参数
|
||||
var _loadingText = isEmpty(target |
||||
.attr("data-ajax-loading-text")) ? null : target |
||||
.attr("data-ajax-loading-text");// 加载状态;
|
||||
var data_type = isEmpty(target.attr("data-ajax-type")) ? null |
||||
: target.attr("data-ajax-type");// 返回数据类型
|
||||
var text = target.text(); |
||||
if (config != undefined) { |
||||
// 请求方法
|
||||
if (config.method != undefined) { |
||||
var _method = config.method; |
||||
if (_method.toLowerCase() != "post" |
||||
|| _method.toLowerCase() != "get") { |
||||
method = _method; |
||||
} |
||||
} |
||||
// 回调方法
|
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
// 返回数据类型
|
||||
if (config.type != undefined) { |
||||
var _type = config.type.toLowerCase(); |
||||
if (_type == "xml" || _type == "html" |
||||
|| _type == "script" || _type == "jsonp" |
||||
|| _type == "json" || _type == "text") { |
||||
data_type = _type; |
||||
} |
||||
|
||||
} |
||||
if (config.url != undefined) { |
||||
_url = config.url; |
||||
} |
||||
if (config.data != undefined) { |
||||
_data = config.data; |
||||
} |
||||
if (config.loadingText != undefined) { |
||||
_loadingText = config.loadingText; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : method, |
||||
url : _url, |
||||
dataType : data_type, |
||||
data : _data, |
||||
beforeSend : function() { |
||||
if (target[0].nodeName == "INPUT") { |
||||
if (!isEmpty(_loadingText)) { |
||||
target.text(_loadingText); |
||||
} |
||||
target.attr("disabled", true); |
||||
} |
||||
|
||||
}, |
||||
success : function(data) { |
||||
|
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
if (target[0].nodeName == "INPUT") { |
||||
target.removeAttr("disabled"); |
||||
target.text(text); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
$.fn.noDataMsg = function(config) { |
||||
if (config != undefined) { |
||||
|
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 判断是否为空, target:判断对象 message:提示信息 true:为空 false:不为空 |
||||
*/ |
||||
function isEmpty(target, message) { |
||||
if (target == undefined || target == null || target.trim() == "" |
||||
|| target.trim().length == 0) { |
||||
if (message != undefined) { |
||||
alert(message); |
||||
} |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
})(jQuery); |
||||
|
||||
var Ms = { |
||||
_target : this, |
||||
"msg" : function(str, url) { // 提示消息 Ms.msg()调用
|
||||
var obj = $("<div class='ms-msg'></div>"); |
||||
$("body").append(obj); |
||||
obj.html(str).show(); |
||||
obj.animate({ |
||||
opacity : 1, |
||||
}, 500, 'ease', function() { |
||||
$(this).animate({ |
||||
opacity : 0, |
||||
}, 800, 'ease', function() { |
||||
if (typeof (url) != "undefined") { |
||||
_target.loadUrl(url); |
||||
} |
||||
}); |
||||
}); |
||||
}, |
||||
"loadUrl" : function(url) { |
||||
location.href = url; |
||||
}, |
||||
"post" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "POST", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
try { |
||||
_target.msg("加载中...");
|
||||
} catch (e) { |
||||
|
||||
} |
||||
}, |
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
try { |
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} catch (e) { |
||||
|
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
"get" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "GET", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
try{ |
||||
_target.msg("加载中..."); |
||||
}catch(e){} |
||||
}, |
||||
|
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
try{ |
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
}catch(e){} |
||||
} |
||||
}); |
||||
}, |
||||
"load" : function(url, method, params, func) { // 非会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : method, |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
_target.msg("加载中..."); |
||||
}, |
||||
success : function(json) { |
||||
if (func != null && func != undefined) { |
||||
func(json); |
||||
} |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} |
||||
}); |
||||
}, |
||||
"setCookie" : function(key, value, time) { // 依赖zepto.cookie.min.js
|
||||
// time单位为天数字
|
||||
$.fn.cookie(key, value, { |
||||
path : '/', |
||||
expires : time |
||||
}); |
||||
}, |
||||
"getCookie" : function(key) { // 读取cookie
|
||||
return decodeURIComponent($.fn.cookie(key)); |
||||
}, |
||||
"delCookie" : function(key) { |
||||
$.fn.cookie(key, null); |
||||
}, |
||||
"queryString" : function(param) { |
||||
var svalue = location.search.match(new RegExp("[\?\&]" + param |
||||
+ "=([^\&]*)(\&?)", "i")); |
||||
return svalue ? svalue[1] : svalue; |
||||
}, |
||||
"initModal" : function() { // 初始化模态框
|
||||
// 弹出框处理
|
||||
if ($("*[data-toggle='modal']").size() > 0) { |
||||
$("*[data-toggle='modal']").each( |
||||
function(index) { |
||||
$("body").on( |
||||
"tap", |
||||
"[data-target=\"" + $(this).attr("data-target") |
||||
+ "\"]", |
||||
function() { |
||||
if ($(this).attr("data-target") != "") { |
||||
openModal($(this).attr("data-target"), |
||||
w, h); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
function openModal(modalId, w, h) { |
||||
|
||||
$(modalId).show(); |
||||
Ms.init(w, h); |
||||
|
||||
if (!$(modalId).parent().hasClass("modalMask")) { |
||||
$(modalId) |
||||
.wrap( |
||||
"<div class='modalMask' style='width:" |
||||
+ w |
||||
+ "px;height:" |
||||
+ h |
||||
+ "px;position: absolute;background:rgba(0, 0, 0, 0.6) none repeat scroll 0 0 !important;filter:Alpha(opacity=80); background:#fff;z-index: 9997;top: 0;'>"); |
||||
} else { |
||||
$(modalId).parent().show(); |
||||
} |
||||
$(modalId).find(".ms-modal-button").css("line-height", "200%"); |
||||
$(modalId).css( |
||||
"margin-left", |
||||
($(modalId).parent().width() - $(modalId).width()) / 2 |
||||
+ "px"); |
||||
$(modalId).css("margin-top", "10%"); |
||||
$(modalId).on("tap", ".close", function() { |
||||
// $(modalId).hide();
|
||||
// $(modalId).unwrap().parent();
|
||||
hideModal(modalId); |
||||
}) |
||||
} |
||||
|
||||
function hideModal(modalId) { |
||||
|
||||
$(modalId).parent().hide(); |
||||
$(modalId).hide(); |
||||
} |
||||
}, |
||||
"browser" : { |
||||
versions : function() { |
||||
var u = navigator.userAgent, app = navigator.appVersion; |
||||
return { |
||||
android4 : u.indexOf('Android 4') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
android2 : u.indexOf('Android 2') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
iPhone : u.indexOf('iPhone') > -1, |
||||
iPad : u.indexOf('iPad') > -1, |
||||
iPod : u.indexOf('iPod') > -1, |
||||
}; |
||||
}(), |
||||
language : (navigator.browserLanguage || navigator.language) |
||||
.toLowerCase() |
||||
} |
||||
}; |
||||
var ms = Ms; |
||||
@ -1,31 +0,0 @@ |
||||
|
||||
jQuery(document).ready(function() { |
||||
|
||||
$('.page-container form').submit(function(){ |
||||
var username = $(this).find('.username').val(); |
||||
var password = $(this).find('.password').val(); |
||||
if(username == '') { |
||||
$(this).find('.error').fadeOut('fast', function(){ |
||||
$(this).css('top', '27px'); |
||||
}); |
||||
$(this).find('.error').fadeIn('fast', function(){ |
||||
$(this).parent().find('.username').focus(); |
||||
}); |
||||
return false; |
||||
} |
||||
if(password == '') { |
||||
$(this).find('.error').fadeOut('fast', function(){ |
||||
$(this).css('top', '96px'); |
||||
}); |
||||
$(this).find('.error').fadeIn('fast', function(){ |
||||
$(this).parent().find('.password').focus(); |
||||
}); |
||||
return false; |
||||
} |
||||
}); |
||||
|
||||
$('.page-container form .username, .page-container form .password').keyup(function(){ |
||||
$(this).parent().find('.error').fadeOut('fast'); |
||||
}); |
||||
|
||||
}); |
||||
@ -1,30 +0,0 @@ |
||||
jQuery(function($){ |
||||
|
||||
$.supersized({ |
||||
|
||||
// Functionality
|
||||
slide_interval : 4000, // Length between transitions
|
||||
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
|
||||
transition_speed : 1000, // Speed of transition
|
||||
performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
|
||||
|
||||
// Size & Position
|
||||
min_width : 0, // Min width allowed (in pixels)
|
||||
min_height : 0, // Min height allowed (in pixels)
|
||||
vertical_center : 1, // Vertically center background
|
||||
horizontal_center : 1, // Horizontally center background
|
||||
fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
|
||||
fit_portrait : 1, // Portrait images will not exceed browser height
|
||||
fit_landscape : 0, // Landscape images will not exceed browser width
|
||||
|
||||
// Components
|
||||
slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
|
||||
slides : [ // Slideshow Images
|
||||
{image : 'http://cdn.mingsoft.net/skin/manager/4.5.5/images/1.jpg'}, |
||||
{image : 'http://cdn.mingsoft.net/skin/manager/4.5.5/images/2.jpg'}, |
||||
{image : 'http://cdn.mingsoft.net/skin/manager/4.5.5/images/3.jpg'} |
||||
] |
||||
|
||||
}); |
||||
|
||||
}); |
||||
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 34 KiB |
@ -1,292 +0,0 @@ |
||||
//点击页面其他位置头部菜单收缩
|
||||
$(document).bind("click",function(e){ |
||||
var target = $(e.target); |
||||
if(target.closest(".menu-default").length == 0){ |
||||
manager.topMenu.initTop(); |
||||
} |
||||
}) |
||||
//浏览器窗口调整事件
|
||||
$(window).resize(function () {
|
||||
$(".categoryTree").height($(document).height()); |
||||
$("#listFrame").height($(document).height()); |
||||
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width: $('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
});
|
||||
})
|
||||
$(function(){ |
||||
//左侧菜单滚动条,鼠标上移显示
|
||||
$(".ms-menu,.ms-content-menu").mouseover(function () { |
||||
$(this).css("overflow-y","auto"); |
||||
}); |
||||
$(".ms-menu,.ms-content-menu").mouseleave(function () { |
||||
$(this).css("overflow-y","hidden"); |
||||
}); |
||||
|
||||
//收缩左侧菜单
|
||||
$(".slideMenu").click(function(){ |
||||
var obj = $(this); |
||||
if ($(".ms-menu").css("left") == "0px") { |
||||
//修改图标
|
||||
obj.children(".icon-open").show(); |
||||
obj.children(".icon-close").hide(); |
||||
$(".ms-menu-div").css("position","absolute"); |
||||
$(".ms-menu,.ms-menu-div").animate({left:'-180px'},100) |
||||
//改变右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width() |
||||
}); |
||||
} else { |
||||
//修改图标
|
||||
obj.children(".icon-open").hide(); |
||||
obj.children(".icon-close").show(); |
||||
$(".ms-menu-div").css("position","relative"); |
||||
$(".ms-menu,.ms-menu-div").animate({left:'0px'},50) |
||||
|
||||
//恢复右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
}); |
||||
} |
||||
}) |
||||
|
||||
//点击左侧菜单添加选项卡
|
||||
$(".ms-menu").delegate(".ms-menu-child a","click",function(){ |
||||
$(".easyui-tabs").show(); |
||||
$(".wellcome").hide(); |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
$(this).addClass("active"); |
||||
var title=$(this).data("title"); |
||||
var content=$(this).data("url"); |
||||
var id=$(this).data("id"); |
||||
if (!$('.easyui-tabs').tabs('exists', title)) { |
||||
$('.easyui-tabs').tabs('add', { |
||||
title: title, |
||||
content: '<iframe src='+content+' frameborder="0" height="100%" width="100%" id="mainFrame'+id+'" name="mainFrame'+id+'"></iframe>', |
||||
closable: true, |
||||
tools:[{ |
||||
iconCls:'icon-mini-refresh', |
||||
title:"刷新当前选项卡", |
||||
handler:function(){ |
||||
$('#mainFrame'+id).attr('src', $('#mainFrame'+id).attr('src')); |
||||
} |
||||
}] |
||||
}); |
||||
|
||||
|
||||
} else { |
||||
$('.easyui-tabs').tabs('select', title); |
||||
} |
||||
}) |
||||
|
||||
|
||||
//用户在切换选项卡时,和导航树保持同步
|
||||
$('.easyui-tabs').tabs({ |
||||
onSelect: function(title){ |
||||
var _select = $(".easyui-tabs").tabs("getSelected"); |
||||
var obj = _select.panel("options").tab; |
||||
//循环左侧菜单里每个菜单的text进行选项卡的title进行对比
|
||||
$(".ms-menu").find("li").each(function(){ |
||||
var target = $(this); |
||||
if(target.text() == obj.text()){ |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
//左侧对应菜单展开选中
|
||||
$(".ms-menu-none").hide(); |
||||
target.parent().parent().slideDown(); |
||||
target.parent().slideDown(); |
||||
target.find("a").addClass("active"); |
||||
//头部对应一级菜单进行选中
|
||||
$(".ms-menu-list").find("li").removeClass("active").each(function(){ |
||||
if(target.parent().parent().data("model-id") == $(this).data("model-id")){ |
||||
$(this).addClass("active"); |
||||
} |
||||
}) |
||||
} |
||||
}) |
||||
} |
||||
}); |
||||
|
||||
|
||||
//当关闭最后一个选项卡时,隐藏选项卡页面显示主界面
|
||||
$('.easyui-tabs').tabs({ |
||||
onClose:function(){ |
||||
if($('.easyui-tabs').tabs('tabs').length==0){ |
||||
$(".wellcome").show(); |
||||
$(".easyui-tabs").hide(); |
||||
$(".ms-menu-child a").removeClass("active"); |
||||
$(".ms-menu-list").find("li").removeClass("active") |
||||
} |
||||
|
||||
} |
||||
}) |
||||
}) |
||||
|
||||
//MStore做的计时循环特效
|
||||
window.setInterval(showMstore, 1000);
|
||||
function showMstore(){
|
||||
$(".ms-top-mstore").find(".animated").addClass("rubberBand") |
||||
}
|
||||
window.setInterval(hiddenMstore, 1500);
|
||||
function hiddenMstore(){
|
||||
$(".ms-top-mstore").find(".animated").removeClass("rubberBand") |
||||
}
|
||||
|
||||
var manager = { |
||||
/*头部菜单操作*/ |
||||
topMenu:{ |
||||
initEvent: function() { |
||||
$("*[data-ms-*]").each() |
||||
}, |
||||
/*追加头部菜单*/ |
||||
initMenu: function(json) { |
||||
$("#ms-menu-list-tmpl").tmpl(json).appendTo(".ms-menu-list"); |
||||
if($(".ms-menu-list").children().length>5){ |
||||
$(".openMenu").show(); |
||||
} |
||||
|
||||
|
||||
//将左侧菜单追加,只是隐藏了
|
||||
$("#ms-menu-tmpl").tmpl(json).appendTo(".ms-menu"); |
||||
$(".ms-menu-parent").each(function(n) { |
||||
var arr = new Array; |
||||
for (i = 0; i < json.length; i++) json[i].modelModelId == $(this).data("model-id") && arr.push(json[i]) |
||||
//alert(arr)
|
||||
$("#ms-menu-child-tmpl").tmpl(arr).appendTo($(this).find("ul:first")) |
||||
|
||||
}) |
||||
}, |
||||
|
||||
/*头部菜单点击收缩效果*/ |
||||
topMenuOpen: function(target,menuShow){ |
||||
var _height=$(".ms-menu-list").height(); |
||||
if(target.parent().hasClass(menuShow)){ |
||||
this.initTop(); |
||||
}else{ |
||||
target.parent().addClass(menuShow); |
||||
$('.'+menuShow).height(_height); |
||||
} |
||||
}, |
||||
/*初始化头部菜单*/ |
||||
initTop:function(){ |
||||
$(".menu-default").height("50px"); |
||||
$(".menu-default").removeClass("menu-show"); |
||||
}, |
||||
/*点击头部菜单展示二级菜单*/ |
||||
showChildMenu:function(target,json){ |
||||
var _json = {"modelTitle":target.text(),"modelIcon":target.data("model-icon"),"modelId":target.data("model-id")}; |
||||
var arr = new Array; |
||||
$(".ms-menu-list").find("li").removeClass("active"); |
||||
target.addClass("active"); |
||||
|
||||
//显示左侧菜单
|
||||
if ($(".ms-menu").css("display") == "none") { |
||||
$(".slideMenu").children(".icon-open").hide(); |
||||
$(".slideMenu").children(".icon-close").show(); |
||||
$(".ms-menu,.ms-menu-div").show(); |
||||
//恢复右侧部分宽度
|
||||
$('.easyui-tabs').tabs("resize",{ |
||||
width:$('.easyui-tabs').parent().width(), |
||||
fit:true, |
||||
scrollDuration:1000 |
||||
}); |
||||
} |
||||
|
||||
$(".ms-menu-parent").each(function(){ |
||||
if(target.data("model-id")==$(this).data("model-id")){ |
||||
$(this).show(); |
||||
$(".ms-menu-parent").find("ul").slideUp(); |
||||
$(this).find("ul").slideDown(); |
||||
|
||||
//默认打开当前模块的第一个菜单项
|
||||
$(".easyui-tabs").show(); |
||||
$(".wellcome").hide(); |
||||
var title=$(this).find("ul li:eq(0) a").data("title"); |
||||
var content=$(this).find("ul li:eq(0) a").data("url"); |
||||
var id = $(this).find("ul li:eq(0) a").data("id"); |
||||
if (!$('.easyui-tabs').tabs('exists', title)) { |
||||
$('.easyui-tabs').tabs('add', { |
||||
title: title, |
||||
content: '<iframe src='+content+' frameborder="0" height="100%" width="100%" id="mainFrame'+id+'" name="mainFrame'+id+'"></iframe>', |
||||
closable: true, |
||||
tools:[{ |
||||
iconCls:'icon-mini-refresh', |
||||
handler:function(){ |
||||
$('#mainFrame'+id).attr('src', $('#mainFrame'+id).attr('src')); |
||||
} |
||||
}] |
||||
});
|
||||
} else { |
||||
$('.easyui-tabs').tabs('select', title); |
||||
} |
||||
} |
||||
}) |
||||
this.initTop(); |
||||
}, |
||||
|
||||
}, |
||||
|
||||
/*左侧菜单操作*/ |
||||
leftMenu:{ |
||||
/*左侧菜单点击收缩效果*/ |
||||
leftMenuOpen:function(target,menu){ |
||||
menu.slideToggle(); |
||||
|
||||
}, |
||||
|
||||
}, |
||||
|
||||
|
||||
} |
||||
|
||||
$(function(){ |
||||
|
||||
//当头部菜单超过5个时,点击展开头部菜单
|
||||
$(".openMenu").click(function(){ |
||||
manager.topMenu.topMenuOpen($(this),"menu-show"); |
||||
}) |
||||
|
||||
//点击展开左侧菜单子菜单
|
||||
$(".ms-menu").delegate(".ms-menu-parent-title","click",function(){ |
||||
var menu = $(this).parent().siblings(".ms-menu-child"); |
||||
manager.leftMenu.leftMenuOpen($(this),menu); |
||||
}) |
||||
|
||||
//移除左侧菜单
|
||||
$(".ms-menu").delegate(".ms-menu-parent","mouseover",function(){ |
||||
$(".closeMenu").hide(); |
||||
$(this).find(".closeMenu").show(); |
||||
}) |
||||
$(document).bind("mouseover",function(e){ |
||||
var target = $(e.target); |
||||
if(target.closest(".ms-menu-parent").length == 0){ |
||||
$(".closeMenu").hide(); |
||||
} |
||||
}) |
||||
//关闭左侧菜单
|
||||
$(".ms-menu").delegate(".closeMenu","click",function(){ |
||||
$(this).parent().parent().hide(); |
||||
var menu = $(this).parent().siblings(".ms-menu-child"); |
||||
manager.leftMenu.leftMenuOpen($(this),menu); |
||||
var index=0; |
||||
$(".ms-menu-parent").each(function(){ |
||||
var target = $(this) |
||||
$(".ms-menu-list li").each(function(){ |
||||
if(target.data("model-id")==$(this).data("model-id")){ |
||||
$(this).removeClass("active"); |
||||
} |
||||
}) |
||||
|
||||
if($(this).css("display") == "none"){ |
||||
index++; |
||||
if(index == $(".ms-menu-parent").length){ |
||||
$(".ms-menu-list li").removeClass("active"); |
||||
$(".ms-menu-none").show(); |
||||
} |
||||
} |
||||
}) |
||||
}) |
||||
}) |
||||
@ -1,333 +0,0 @@ |
||||
// JavaScript Document
|
||||
(function($) { |
||||
|
||||
/** |
||||
* ajax提交表单 |
||||
*
|
||||
* @form 表单 格式:#表单id |
||||
* @config 配置扩展用,可包含参数:func,回调方法 |
||||
*/ |
||||
$.fn.postForm = function(form, config) { |
||||
var target = $(this); |
||||
if (isEmpty($(form).attr("action")) && isEmpty(config.action)) { |
||||
alert("配置错误:from表单不存在action属性"); |
||||
return; |
||||
} |
||||
var func; |
||||
var action = $(form).attr("action"); |
||||
var data_type = "json"; |
||||
if (config != undefined) { |
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
if (config.action != undefined) { |
||||
action = config.action; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : "POST", |
||||
url : action, |
||||
dataType : data_type, |
||||
data : $(form).serialize(), |
||||
beforeSend : function() { |
||||
target.attr("disabled", true); |
||||
}, |
||||
success : function(data) { |
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
target.removeAttr("disabled"); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
/** |
||||
* 发起ajax连接请求 |
||||
*
|
||||
* @config(优先) 配置扩展用,可包含参数:func,回调方法 |
||||
* config格式:{url:请求地址,data:请求参数,loadingText:加载时文字} |
||||
* 调用该方法的元素必须存在data-ajax-url参数; 参数:data-ajax-url必须 |
||||
* data-ajax-data 可选 |
||||
*/ |
||||
$.fn.request = function(config) { |
||||
var target = $(this); |
||||
if (isEmpty(target.attr("data-ajax-url")) |
||||
&& isEmpty(config.url)) { |
||||
alert(target.selector + "配置错误:data-ajax-url属性不存在"); |
||||
return; |
||||
} |
||||
var method = "POST"; |
||||
var data_type = "json"; |
||||
var func = null; |
||||
var _url = isEmpty(target.attr("data-ajax-url")) ? null |
||||
: target.attr("data-ajax-url");// 请求地址
|
||||
var _data = isEmpty(target.attr("data-ajax-data")) ? null |
||||
: target.attr("data-ajax-data");// 请求参数
|
||||
var _loadingText = isEmpty(target |
||||
.attr("data-ajax-loading-text")) ? null : target |
||||
.attr("data-ajax-loading-text");// 加载状态;
|
||||
var data_type = isEmpty(target.attr("data-ajax-type")) ? null |
||||
: target.attr("data-ajax-type");// 返回数据类型
|
||||
var text = target.text(); |
||||
if (config != undefined) { |
||||
// 请求方法
|
||||
if (config.method != undefined) { |
||||
var _method = config.method; |
||||
if (_method.toLowerCase() != "post" |
||||
|| _method.toLowerCase() != "get") { |
||||
method = _method; |
||||
} |
||||
} |
||||
// 回调方法
|
||||
if (config.func != undefined) { |
||||
func = config.func; |
||||
} |
||||
// 返回数据类型
|
||||
if (config.type != undefined) { |
||||
var _type = config.type.toLowerCase(); |
||||
if (_type == "xml" || _type == "html" |
||||
|| _type == "script" || _type == "jsonp" |
||||
|| _type == "json" || _type == "text") { |
||||
data_type = _type; |
||||
} |
||||
|
||||
} |
||||
if (config.url != undefined) { |
||||
_url = config.url; |
||||
} |
||||
if (config.data != undefined) { |
||||
_data = config.data; |
||||
} |
||||
if (config.loadingText != undefined) { |
||||
_loadingText = config.loadingText; |
||||
} |
||||
} |
||||
$.ajax({ |
||||
type : method, |
||||
url : _url, |
||||
dataType : data_type, |
||||
data : _data, |
||||
beforeSend : function() { |
||||
if (target[0].nodeName == "INPUT") { |
||||
if (!isEmpty(_loadingText)) { |
||||
target.text(_loadingText); |
||||
} |
||||
target.attr("disabled", true); |
||||
} |
||||
|
||||
}, |
||||
success : function(data) { |
||||
|
||||
if (typeof (func) == "string") { |
||||
eval(func + "(data)"); |
||||
} else if (typeof (func) == "function") { |
||||
func.call(this, data); |
||||
} |
||||
if (target[0].nodeName == "INPUT") { |
||||
target.removeAttr("disabled"); |
||||
target.text(text); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
$.fn.noDataMsg = function(config) { |
||||
if (config != undefined) { |
||||
|
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 判断是否为空, target:判断对象 message:提示信息 true:为空 false:不为空 |
||||
*/ |
||||
function isEmpty(target, message) { |
||||
if (target == undefined || target == null || target.trim() == "" |
||||
|| target.trim().length == 0) { |
||||
if (message != undefined) { |
||||
alert(message); |
||||
} |
||||
return true; |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
})(jQuery); |
||||
|
||||
var Ms = { |
||||
_target : this, |
||||
"msg" : function(str, url) { // 提示消息 Ms.msg()调用
|
||||
var obj = $("<div class='ms-msg'></div>"); |
||||
$("body").append(obj); |
||||
obj.html(str).show(); |
||||
obj.animate({ |
||||
opacity : 1, |
||||
}, 500, 'ease', function() { |
||||
$(this).animate({ |
||||
opacity : 0, |
||||
}, 800, 'ease', function() { |
||||
if (typeof (url) != "undefined") { |
||||
_target.loadUrl(url); |
||||
} |
||||
}); |
||||
}); |
||||
}, |
||||
"loadUrl" : function(url) { |
||||
location.href = url; |
||||
}, |
||||
"post" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "POST", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
try { |
||||
_target.msg("加载中...");
|
||||
} catch (e) { |
||||
|
||||
} |
||||
}, |
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
try { |
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} catch (e) { |
||||
|
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
"get" : function(url, params, func) { // 会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : "GET", |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
try{ |
||||
_target.msg("加载中..."); |
||||
}catch(e){} |
||||
}, |
||||
|
||||
success : function(json) { |
||||
func(json); |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
try{ |
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
}catch(e){} |
||||
} |
||||
}); |
||||
}, |
||||
"load" : function(url, method, params, func) { // 非会员中心ajax请求类
|
||||
$.ajax({ |
||||
type : method, |
||||
url : url, |
||||
dataType : 'json', |
||||
data : params, |
||||
beforeSend : function() { |
||||
_target.msg("加载中..."); |
||||
}, |
||||
success : function(json) { |
||||
if (func != null && func != undefined) { |
||||
func(json); |
||||
} |
||||
}, |
||||
error : function(xhr, type) { // 服务器异常提示
|
||||
_target.msg("服务器繁忙稍后重试!"); |
||||
} |
||||
}); |
||||
}, |
||||
"setCookie" : function(key, value, time) { // 依赖zepto.cookie.min.js
|
||||
// time单位为天数字
|
||||
$.fn.cookie(key, value, { |
||||
path : '/', |
||||
expires : time |
||||
}); |
||||
}, |
||||
"getCookie" : function(key) { // 读取cookie
|
||||
return decodeURIComponent($.fn.cookie(key)); |
||||
}, |
||||
"delCookie" : function(key) { |
||||
$.fn.cookie(key, null); |
||||
}, |
||||
"queryString" : function(param) { |
||||
var svalue = location.search.match(new RegExp("[\?\&]" + param |
||||
+ "=([^\&]*)(\&?)", "i")); |
||||
return svalue ? svalue[1] : svalue; |
||||
}, |
||||
"initModal" : function() { // 初始化模态框
|
||||
// 弹出框处理
|
||||
if ($("*[data-toggle='modal']").size() > 0) { |
||||
$("*[data-toggle='modal']").each( |
||||
function(index) { |
||||
$("body").on( |
||||
"tap", |
||||
"[data-target=\"" + $(this).attr("data-target") |
||||
+ "\"]", |
||||
function() { |
||||
if ($(this).attr("data-target") != "") { |
||||
openModal($(this).attr("data-target"), |
||||
w, h); |
||||
} |
||||
}) |
||||
}); |
||||
} |
||||
|
||||
function openModal(modalId, w, h) { |
||||
|
||||
$(modalId).show(); |
||||
Ms.init(w, h); |
||||
|
||||
if (!$(modalId).parent().hasClass("modalMask")) { |
||||
$(modalId) |
||||
.wrap( |
||||
"<div class='modalMask' style='width:" |
||||
+ w |
||||
+ "px;height:" |
||||
+ h |
||||
+ "px;position: absolute;background:rgba(0, 0, 0, 0.6) none repeat scroll 0 0 !important;filter:Alpha(opacity=80); background:#fff;z-index: 9997;top: 0;'>"); |
||||
} else { |
||||
$(modalId).parent().show(); |
||||
} |
||||
$(modalId).find(".ms-modal-button").css("line-height", "200%"); |
||||
$(modalId).css( |
||||
"margin-left", |
||||
($(modalId).parent().width() - $(modalId).width()) / 2 |
||||
+ "px"); |
||||
$(modalId).css("margin-top", "10%"); |
||||
$(modalId).on("tap", ".close", function() { |
||||
// $(modalId).hide();
|
||||
// $(modalId).unwrap().parent();
|
||||
hideModal(modalId); |
||||
}) |
||||
} |
||||
|
||||
function hideModal(modalId) { |
||||
|
||||
$(modalId).parent().hide(); |
||||
$(modalId).hide(); |
||||
} |
||||
}, |
||||
"browser" : { |
||||
versions : function() { |
||||
var u = navigator.userAgent, app = navigator.appVersion; |
||||
return { |
||||
android4 : u.indexOf('Android 4') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
android2 : u.indexOf('Android 2') > -1 |
||||
&& u.indexOf('Linux') > -1, |
||||
iPhone : u.indexOf('iPhone') > -1, |
||||
iPad : u.indexOf('iPad') > -1, |
||||
iPod : u.indexOf('iPod') > -1, |
||||
}; |
||||
}(), |
||||
language : (navigator.browserLanguage || navigator.language) |
||||
.toLowerCase() |
||||
} |
||||
}; |
||||
var ms = Ms; |
||||
@ -1,159 +0,0 @@ |
||||
html,body{ |
||||
width:100%; |
||||
height:100%; |
||||
margin: 0; |
||||
min-width: 1200px; |
||||
} |
||||
p{ |
||||
margin: 0; |
||||
} |
||||
#errorDisplay{ |
||||
background-color: #fff; |
||||
border-radius: 4px; |
||||
width: 680px; |
||||
height: 88px; |
||||
margin: auto; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
right: 0; |
||||
bottom: 0; |
||||
.errorData{ |
||||
overflow: hidden; |
||||
margin-top: 18px; |
||||
width: 88%; |
||||
p{ |
||||
line-height: 24px; |
||||
font-size: 16px; |
||||
color: #999; |
||||
} |
||||
} |
||||
img{ |
||||
float: left; |
||||
padding-top: 20px; |
||||
padding-right: 15px; |
||||
padding-left: 25px; |
||||
} |
||||
} |
||||
body{ |
||||
font-family: "微软雅黑"; |
||||
background:url("../images/background.png") no-repeat; |
||||
background-size: 100% 100%; |
||||
} |
||||
#mcms-login{ |
||||
width: 100%; |
||||
height: 100%; |
||||
display: flex; |
||||
align-items: center; |
||||
justify-content: center; |
||||
.login-float{ |
||||
float: left; |
||||
} |
||||
.login-form-container{ |
||||
width: 340px; |
||||
height: 320px; |
||||
background-color: #ffffff; |
||||
// padding: 39px 54px; |
||||
.login-title{ |
||||
padding: 39px 54px 0 54px; |
||||
line-height: 13px; |
||||
.login-chinese-title{ |
||||
font-size: 16px; |
||||
} |
||||
} |
||||
.ms-login-error-text{ |
||||
height: 20px; |
||||
font-size: 12px; |
||||
color: #e4393c; |
||||
display: flex; |
||||
align-items: center; |
||||
margin: 5px 54px; |
||||
img{ |
||||
padding-right: 5px; |
||||
} |
||||
} |
||||
form{ |
||||
padding: 0 52px; |
||||
.login-people-name,.login-code input{ |
||||
height: 34px; |
||||
padding:5px 10px; |
||||
} |
||||
.login-people-name,.login-code,.login-remmember-password{ |
||||
margin-bottom: 12px; |
||||
} |
||||
.login-people-name{ |
||||
width: 100%; |
||||
|
||||
} |
||||
input{ |
||||
border: 1px solid #cccccc; |
||||
border-radius: 3px; |
||||
outline: none; |
||||
&::-webkit-input-placeholder { |
||||
color: #999999; |
||||
font-size: 12px; |
||||
} |
||||
&::-moz-placeholder { |
||||
color: #999999; |
||||
font-size: 12px; |
||||
} |
||||
} |
||||
.ms-error{ |
||||
border:1px solid #e4393c; |
||||
} |
||||
.login-code{ |
||||
overflow: hidden; |
||||
.login-code-input{ |
||||
width: 108px; |
||||
} |
||||
.login-code-input,.login-code-img{ |
||||
margin-right: 6px; |
||||
} |
||||
.login-code-img{ |
||||
height: 34px; |
||||
} |
||||
.login-code-text{ |
||||
font-size: 10px; |
||||
line-height: 15px; |
||||
} |
||||
.login-code-change{ |
||||
cursor: pointer; |
||||
} |
||||
} |
||||
.login-remember{ |
||||
margin: 0; |
||||
font-weight: 500; |
||||
} |
||||
.login-remmember-password{ |
||||
display: flex; |
||||
line-height: 13px; |
||||
align-items: center; |
||||
height: 13px; |
||||
} |
||||
.login-remmember-password input[type="checkbox"]{ |
||||
margin-right: 6px; |
||||
} |
||||
.login-button{ |
||||
width: 100%; |
||||
cursor: pointer; |
||||
height: 34px; |
||||
line-height: 34px; |
||||
font-size: 14px; |
||||
color: #ffffff; |
||||
text-align: center; |
||||
background-color:#eeeeee; |
||||
border-radius:4px; |
||||
background-size: 100% 100%; |
||||
} |
||||
} |
||||
.login-chinese-title,.login-code-change{ |
||||
color: #0099ff; |
||||
} |
||||
.login-english-title,.login-remmember-password,.login-code-text{ |
||||
color: #999999; |
||||
} |
||||
.login-english-title,.login-remmember-password{ |
||||
font-size: 12px; |
||||
} |
||||
} |
||||
} |
||||