Merge pull request #1 from sentsin/master

拉取
pull/1/head
魏安国 8 years ago committed by GitHub
commit c4b5d37979

@ -1 +1,19 @@
# 1.0.1
# v1.0.2 2016-10-18
* 修复layui.data('table', null); 无法删除本地表的bug
* 修改自定义事件监听机制
* 新增“引用”的区块多套显示风格
* 新增“字段集”多套显示风格
* 新增“纯圆角”公共CSS类
* 新增hr全局初始化CSS类
* 富文本编辑器增加用于同步编辑器内容到textarea的sync方法一般用于异步提交
* 修复富文本编辑器点击编辑区域无法关闭表情的bug
* 修复富文本编辑器未正确把内容同步到textarea的较严重bug
* 修复富文本编辑器中的一个css语法错误
* 修复表单input框ie8下某些小兼容问题
* 将复选框风格瘦身(因为群众普遍认为之前的“复选框”实在太胖了)
* 将表单下边距由20px调整为15px
* 完善表单响应式
* 处理layPage分页可能被第三方框架如Bootstrap引发的样式冲突

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架@LGPL www.layui.com By 贤心 */
/** layui-v1.0.2 经典模块化前端框架@LGPL www.layui.com By 贤心 */
html #layuicss-layui-mobilecss{display:none;position:absolute;width:1989px}blockquote,body,button,dd,div,dl,dt,form,h1,h2,h3,h4,h5,h6,input,legend,li,ol,p,td,textarea,th,ul{margin:0;padding:0;-webkit-tap-highlight-color:rgba(0,0,0,0)}html{font:12px 'Helvetica Neue','PingFang SC',STHeitiSC-Light,Helvetica,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a,button,input{-webkit-tap-highlight-color:rgba(255,0,0,0)}a{text-decoration:none;background:0 0}a:active,a:hover{outline:0}table{border-collapse:collapse;border-spacing:0}li{list-style:none}b,strong{font-weight:700}h1,h2,h3,h4,h5,h6{font-weight:500}address,cite,dfn,em,var{font-style:normal}dfn{font-style:italic}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}img{border:0;vertical-align:bottom}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0;outline:0}button,select{text-transform:none}select{-webkit-appearance:none;border:none}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,label{vertical-align:middle}

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架@LGPL www.layui.com By 贤心 */
/** layui-v1.0.2 经典模块化前端框架@LGPL www.layui.com By 贤心 */
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #ddd;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:30px;line-height:30px;border-bottom:1px solid #ddd}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #ddd;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
/** layui-v1.0.1 经典模块化前端框架@LGPL www.layui.com By 贤心 */
/** layui-v1.0.2 经典模块化前端框架@LGPL www.layui.com By 贤心 */
/*!
@Name: layer's style

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("jquery",function(e){"use strict";var a=layui.jquery,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("jquery",function(i){"use strict";var t=layui.jquery,a=(layui.hint(),layui.device()),e="element",n="layui-this",l="layui-show",o=function(){this.config={}};o.prototype.set=function(i){var a=this;return t.extend(!0,a.config,i),a},o.prototype.on=function(i,t){return layui.onevent(e,i,t)},o.prototype.init=function(i){var o={tabClick:function(i,a){var o=t(this),a=a||o.index(),s=o.parents(".layui-tab"),u=s.find(".layui-tab-content .layui-tab-item"),c=s.attr("lay-filter");o.addClass(n).siblings().removeClass(n),u.eq(a).addClass(l).siblings().removeClass(l),layui.event.call(this,e,"tab("+c+")",{elem:s,index:a})},tabAuto:function(){var i="layui-tab-more",e="layui-tab-bar",l="layui-tab-close",s=this;t(".layui-tab").each(function(){var u=t(this),c=u.find(".layui-tab-title"),r=(u.find(".layui-tab-item"),'lay-stope="tabmore"'),f=t('<span class="layui-unselect layui-tab-bar" '+r+"><i "+r+' class="layui-icon">&#xe61a;</i></span>');if(s===window&&8!=a.ie&&o.hideTabMore(!0),u.attr("lay-allowClose")&&!c.find("li").find("."+l)[0]){var y=t('<i class="layui-icon layui-unselect '+l+'">&#x1006;</i>');y.on("click",function(){var i=t(this).parent(),a=i.index(),e=i.parents(".layui-tab"),l=e.find(".layui-tab-content .layui-tab-item");i.hasClass(n)&&(i.next()[0]?o.tabClick.call(i.next()[0],{},a+1):i.prev()[0]&&o.tabClick.call(i.prev()[0],{},a-1)),i.remove(),l.eq(a).remove()}),c.find("li").append(y)}if(c.prop("scrollWidth")>c.outerWidth()+1){if(c.find("."+e)[0])return;c.append(f),f.on("click",function(t){c[this.title?"removeClass":"addClass"](i),this.title=this.title?"":"收缩"})}else c.find("."+e).remove()})},hideTabMore:function(i){var a=t(".layui-tab-title");i!==!0&&"tabmore"===i.target.getAttribute("lay-stope")||(a.removeClass("layui-tab-more"),a.find(".layui-tab-bar").attr("title",""))}},s={tab:function(){var i=".layui-tab-title li";o.tabAuto.call({}),u.off("click",i,o.tabClick).on("click",i,o.tabClick),t(window).off("resize",o.tabAuto).on("resize",o.tabAuto),t(document).off("click",o.hideTabMore).on("click",o.hideTabMore)},nav:function(){var i,e=".layui-nav",n="layui-nav-item",l="layui-nav-bar",o="layui-nav-tree",s=200,u=function(a,e){var n=t(this);e.hasClass(o)?a.css({top:n.position().top,height:n.height(),opacity:1}):(a.css({left:n.position().left+parseFloat(n.css("marginLeft")),top:n.position().top+n.height()-5}),i=setTimeout(function(){a.css({width:n.width(),opacity:1})},s))};t(e).each(function(){var e=t(this),c=t('<span class="'+l+'"></span>');e.find("."+l)[0]||a.ie&&a.ie<10||(e.append(c),e.find("."+n).on("mouseenter",function(){u.call(this,c,e)}),e.on("mouseleave",function(){clearTimeout(i),setTimeout(function(){e.hasClass(o)?c.css({height:0,top:c.position().top+c.height()/2,opacity:0}):c.css({width:0,left:c.position().left+c.width()/2,opacity:0})},s)}))})},breadcrumb:function(){var i=".layui-breadcrumb";t(i).each(function(){var i=t(this),a=i.attr("lay-separator")||">",e=i.find("a");e.each(function(i){i!==e.length-1&&t(this).append("<span>"+a+"</span>")}),i.css("visibility","visible")})}};return layui.each(s,function(i,t){t()})};var s=new o,u=t("body");s.init(),i(e,function(i){return s.set(i)})});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("jquery",function(o){"use strict";var e=layui.jquery,i=function(o){},t='<i class="layui-anim layui-anim-rotate layui-anim-loop layui-icon ">&#xe63e;</i>';i.prototype.load=function(o){var i,l,n,r,a=this,c=1;o=o||{};var u=e(o.elem);if(u[0]){var f=e(o.scrollElem||document),m=o.mb||50,s=!("isAuto"in o)||o.isAuto,y=!("isShowEnd"in o)||o.isShowEnd,h=o.scrollElem&&o.scrollElem!==document,v="<cite>加载更多</cite>",d=e('<div class="layui-flow-more"><a href="javascript:;">'+v+"</a></div>");u.find(".layui-flow-more")[0]||u.append(d);var p=function(o,t){o=e(o),d.before(o),t=0==t||null,t?d.html(y?"没有更多了":""):d.find("a").html(v),l=t,i=null,n&&n()},g=function(){i=!0,d.find("a").html(t),"function"==typeof o.done&&o.done(++c,p)};if(d.find("a").on("click",function(){e(this);l||i||g()}),o.isLazyimg)var n=a.lazyimg({elem:o.elem+" img",scrollElem:f});return s?(f.on("scroll",function(){var o=e(this),t=o.scrollTop();r&&clearTimeout(r),l||(r=setTimeout(function(){var l=h?o.height():e(window).height(),n=h?o.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-l<=m&&(i||g())},100))}),a):a}},i.prototype.lazyimg=function(o){var i,t=this,l=0;o=o||{};var n=e(o.scrollElem||document),r=o.elem||"img",a=o.scrollElem&&o.scrollElem!==document,c=function(o,e){var i=n.scrollTop(),r=i+e,c=a?function(){return o.offset().top-n.offset().top+i}():o.offset().top;if(c>=i&&c<=r&&!o.attr("src")){var f=o.attr("lay-src");layui.img(f,function(){var e=t.lazyimg.elem.eq(l);o.attr("src",f).removeAttr("lay-src"),e[0]&&u(e),l++})}},u=function(o,i){var u=a?(i||n).height():e(window).height(),f=n.scrollTop(),m=f+u;if(t.lazyimg.elem=e(r),o)c(o,u);else for(var s=0;s<t.lazyimg.elem.length;s++){var y=t.lazyimg.elem.eq(s),h=a?function(){return y.offset().top-n.offset().top+f}():y.offset().top;if(c(y,u),l=s,h>m)break}};if(u(),!i){var f;n.on("scroll",function(){var o=e(this);f&&clearTimeout(f),f=setTimeout(function(){u(null,o)},100)}),i=!0}return u},o("flow",new i)});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("layer",function(e){"use strict";var i=layui.jquery,a=layui.layer,t=layui.hint(),n=layui.device(),l="form",c=".layui-form",s="layui-this",r=function(){this.config={verify:{required:[/[\S]+/,"必填项不能为空"],phone:[/^1\d{10}$/,"请输入正确的手机号"],email:[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"邮箱格式不正确"],url:[/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/,"链接格式不正确"],number:[/^\d+$/,"只能填写数字"],date:[/^(\d{4})[-\/](\d{1}|0\d{1}|1[0-2])([-\/](\d{1}|0\d{1}|[1-2][0-9]|3[0-1]))*$/,"日期格式不正确"],identity:[/(^\d{15}$)|(^\d{17}(x|X|\d)$)/,"请输入正确的身份证号"]}}};r.prototype.set=function(e){var a=this;return i.extend(!0,a.config,e),a},r.prototype.verify=function(e){var a=this;return i.extend(!0,a.config.verify,e),a},r.prototype.on=function(e,i){return layui.onevent(l,e,i)},r.prototype.render=function(e){var a=this,n={select:function(){var e="请选择",a="layui-form-select",t="layui-select-title",n=i(c).find("select"),r=function(e,n){i(e.target).parent().hasClass(t)&&!n||i("."+a).removeClass(a+"ed")},u=function(e){var n=i(this),c=e.find("."+t);c.on("click",function(i){e.hasClass(a+"ed")?e.removeClass(a+"ed"):(r(i,!0),e.addClass(a+"ed"))}),e.find("ul>li").on("click",function(){var e=i(this),a=e.attr("lay-value"),t=n.attr("lay-filter");n.val(a).removeClass("layui-form-danger"),c.find("input").val(e.text()),e.addClass(s).siblings().removeClass(s),layui.event(l,"select("+t+")",{elem:n[0],value:a})}),i(document).off("click",r).on("click",r)};n.each(function(n,l){var c=i(this),r=c.next("."+a),o=l.value,d=i(l.options[l.selectedIndex]),f=i(['<div class="layui-unselect '+a+'">','<div class="'+t+'"><input type="text" placeholder="'+(l.options[0].innerHTML?l.options[0].innerHTML:e)+'" value="'+(o?d.html():"")+'" readonly class="layui-input layui-unselect">','<i class="layui-edge"></i></div>','<ul class="layui-anim layui-anim-upbit">'+function(e){var i=[];return layui.each(e,function(e,a){(0!==e||a.value)&&i.push('<li lay-value="'+a.value+'" '+(o===a.value?'class="'+s+'"':"")+">"+a.innerHTML+"</li>")}),i.join("")}(this.options)+"</ul>","</div>"].join(""));r[0]&&r.remove(),c.after(f),u.call(this,f)})},checkbox:function(){var e={checkbox:["layui-form-checkbox","layui-form-checked","checkbox"],_switch:["layui-form-switch","layui-form-onswitch","switch"]},a=i(c).find("input[type=checkbox]"),t=function(e,a){var t=i(this);e.on("click",function(){var i=t.attr("lay-filter");t[0].checked?(t[0].checked=!1,e.removeClass(a[1])):(t[0].checked=!0,e.addClass(a[1])),layui.event(l,a[2]+"("+i+")",{elem:t[0],value:t[0].value})})};a.each(function(a,n){var l=i(this),c=l.attr("lay-skin");"switch"===c&&(c="_"+c);var s=e[c]||e.checkbox,r=l.next("."+s[0]),u=i(['<div class="layui-unselect '+s[0]+(n.checked?" "+s[1]:"")+'">',{_switch:"<i></i>"}[c]||"<span>"+(n.title||"勾选")+'</span><i class="layui-icon">&#xe618;</i>',"</div>"].join(""));r[0]&&r.remove(),l.after(u),t.call(this,u,s)})},radio:function(){var e="layui-form-radio",a=["&#xe643;","&#xe63f;"],t=i(c).find("input[type=radio]"),n=function(t){var n=i(this),s="layui-anim-scaleSpring";t.on("click",function(){var r=n[0].name,u=n.parents(c),o=n.attr("lay-filter"),d=u.find("input[name="+r+"]");layui.each(d,function(){var t=i(this).next("."+e);this.checked=!1,t.removeClass(e+"ed"),t.find(".layui-icon").removeClass(s).html(a[1])}),n[0].checked=!0,t.addClass(e+"ed"),t.find(".layui-icon").addClass(s).html(a[0]),layui.event(l,"radio("+o+")",{elem:n[0],value:n[0].value})})};t.each(function(t,l){var c=i(this),s=c.next("."+e),r=i(['<div class="layui-unselect '+e+(l.checked?" "+e+"ed":"")+'">','<i class="layui-anim layui-icon">'+a[l.checked?0:1]+"</i>","<span>"+(l.title||"未命名")+"</span>","</div>"].join(""));s[0]&&s.remove(),c.after(r),n.call(this,r)})}};return e?n[e]?n[e]():t.error("不支持的"+e+"表单渲染"):layui.each(n,function(e,i){i()}),a};var u=function(){var e=i(this),t=o.config.verify,s=null,r="layui-form-danger",u={},d=e.parents(c),f=d.find("*[lay-verify]"),y=e.parents("form")[0],v=d.find("input,select,textarea"),h=e.attr("lay-filter");return layui.each(f,function(e,l){var c=i(this),u=c.attr("lay-verify"),o="",d=c.val(),f="function"==typeof t[u];if(c.removeClass(r),t[u]&&(f?o=t[u](d,l):!t[u][0].test(d)))return a.msg(o||t[u][1],{icon:5,shift:6}),n.android||n.ios||l.focus(),c.addClass(r),s=!0}),!s&&(layui.each(v,function(e,i){i.name&&(/^checkbox|radio$/.test(i.type)&&!i.checked||(u[i.name]=i.value))}),layui.event.call(this,l,"submit("+h+")",{elem:this,form:y,field:u}))},o=new r,d=i("body");o.render(),d.on("reset",c,function(){setTimeout(function(){o.render()},50)}),d.on("submit",c,u).on("click","*[lay-submit]",u),e(l,function(e){return o.set(e)})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define(function(a){"use strict";function t(a){new p(a)}var e=document,r="getElementById",n="getElementsByTagName",s=0,p=function(a){var t=this,e=t.config=a||{};e.item=s++,t.render(!0)};p.on=function(a,t,e){return a.attachEvent?a.attachEvent("on"+t,function(){e.call(a,window.even)}):a.addEventListener(t,e,!1),p},p.prototype.type=function(){var a=this.config;if("object"==typeof a.cont)return void 0===a.cont.length?2:3},p.prototype.view=function(){var a=this,t=a.config,e=[],r={};if(t.pages=0|t.pages,t.curr=0|t.curr||1,t.groups="groups"in t?0|t.groups:5,t.first="first"in t?t.first:"&#x9996;&#x9875;",t.last="last"in t?t.last:"&#x672B;&#x9875;",t.prev="prev"in t?t.prev:"&#x4E0A;&#x4E00;&#x9875;",t.next="next"in t?t.next:"&#x4E0B;&#x4E00;&#x9875;",t.pages<=1)return"";for(t.groups>t.pages&&(t.groups=t.pages),r.index=Math.ceil((t.curr+(t.groups>1&&t.groups!==t.pages?1:0))/(0===t.groups?1:t.groups)),t.curr>1&&t.prev&&e.push('<a href="javascript:;" class="layui-laypage-prev" data-page="'+(t.curr-1)+'">'+t.prev+"</a>"),r.index>1&&t.first&&0!==t.groups&&e.push('<a href="javascript:;" class="laypage_first" data-page="1" title="&#x9996;&#x9875;">'+t.first+"</a><span>&#x2026;</span>"),r.poor=Math.floor((t.groups-1)/2),r.start=r.index>1?t.curr-r.poor:1,r.end=r.index>1?function(){var a=t.curr+(t.groups-r.poor-1);return a>t.pages?t.pages:a}():t.groups,r.end-r.start<t.groups-1&&(r.start=r.end-t.groups+1);r.start<=r.end;r.start++)r.start===t.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(t.skin)?'style="background-color:'+t.skin+";":"")+'"></em><em>'+r.start+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r.start+'">'+r.start+"</a>");return t.pages>t.groups&&r.end<t.pages&&t.last&&0!==t.groups&&e.push('<span>&#x2026;</span><a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+t.pages+'">'+t.last+"</a>"),r.flow=!t.prev&&0===t.groups,(t.curr!==t.pages&&t.next||r.flow)&&e.push(function(){return r.flow&&t.curr===t.pages?'<span class="layui-laypage-nomore" title="&#x5DF2;&#x6CA1;&#x6709;&#x66F4;&#x591A;">'+t.next+"</span>":'<a href="javascript:;" class="layui-laypage-next" data-page="'+(t.curr+1)+'">'+t.next+"</a>"}()),'<div class="layui-laypage layui-laypage-'+(t.skin?function(a){return/^#/.test(a)?"molv":a}(t.skin):"default")+'" id="layui-laypage-'+a.config.item+'">'+e.join("")+function(){return t.skip?'<span class="layui-laypage-total">&#x5230;&#x7B2C; <input type="number" min="1" onkeyup="this.value=this.value.replace(/\\D/, \'\');" value="'+t.curr+'" class="layui-laypage-skip"> &#x9875; <button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button></span>':""}()+"</div>"},p.prototype.jump=function(a){if(a){for(var t=this,e=t.config,r=a.children,s=a[n]("button")[0],i=a[n]("input")[0],u=0,o=r.length;u<o;u++)"a"===r[u].nodeName.toLowerCase()&&p.on(r[u],"click",function(){var a=0|this.getAttribute("data-page");e.curr=a,t.render()});s&&p.on(s,"click",function(){var a=0|i.value.replace(/\s|\D/g,"");a&&a<=e.pages&&(e.curr=a,t.render())})}},p.prototype.render=function(a){var t=this,n=t.config,s=t.type(),p=t.view();2===s?n.cont.innerHTML=p:3===s?n.cont.html(p):e[r](n.cont).innerHTML=p,n.jump&&n.jump(n,a),t.jump(e[r]("layui-laypage-"+n.item)),n.hash&&!a&&(location.hash="!"+n.hash+"="+n.curr)},a("laypage",t)});
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define(function(a){"use strict";function t(a){new p(a)}var e=document,r="getElementById",n="getElementsByTagName",s=0,p=function(a){var t=this,e=t.config=a||{};e.item=s++,t.render(!0)};p.on=function(a,t,e){return a.attachEvent?a.attachEvent("on"+t,function(){e.call(a,window.even)}):a.addEventListener(t,e,!1),p},p.prototype.type=function(){var a=this.config;if("object"==typeof a.cont)return void 0===a.cont.length?2:3},p.prototype.view=function(){var a=this,t=a.config,e=[],r={};if(t.pages=0|t.pages,t.curr=0|t.curr||1,t.groups="groups"in t?0|t.groups:5,t.first="first"in t?t.first:"&#x9996;&#x9875;",t.last="last"in t?t.last:"&#x672B;&#x9875;",t.prev="prev"in t?t.prev:"&#x4E0A;&#x4E00;&#x9875;",t.next="next"in t?t.next:"&#x4E0B;&#x4E00;&#x9875;",t.pages<=1)return"";for(t.groups>t.pages&&(t.groups=t.pages),r.index=Math.ceil((t.curr+(t.groups>1&&t.groups!==t.pages?1:0))/(0===t.groups?1:t.groups)),t.curr>1&&t.prev&&e.push('<a href="javascript:;" class="layui-laypage-prev" data-page="'+(t.curr-1)+'">'+t.prev+"</a>"),r.index>1&&t.first&&0!==t.groups&&e.push('<a href="javascript:;" class="laypage_first" data-page="1" title="&#x9996;&#x9875;">'+t.first+"</a><span>&#x2026;</span>"),r.poor=Math.floor((t.groups-1)/2),r.start=r.index>1?t.curr-r.poor:1,r.end=r.index>1?function(){var a=t.curr+(t.groups-r.poor-1);return a>t.pages?t.pages:a}():t.groups,r.end-r.start<t.groups-1&&(r.start=r.end-t.groups+1);r.start<=r.end;r.start++)r.start===t.curr?e.push('<span class="layui-laypage-curr"><em class="layui-laypage-em" '+(/^#/.test(t.skin)?'style="background-color:'+t.skin+";":"")+'"></em><em>'+r.start+"</em></span>"):e.push('<a href="javascript:;" data-page="'+r.start+'">'+r.start+"</a>");return t.pages>t.groups&&r.end<t.pages&&t.last&&0!==t.groups&&e.push('<span>&#x2026;</span><a href="javascript:;" class="layui-laypage-last" title="&#x5C3E;&#x9875;" data-page="'+t.pages+'">'+t.last+"</a>"),r.flow=!t.prev&&0===t.groups,(t.curr!==t.pages&&t.next||r.flow)&&e.push(function(){return r.flow&&t.curr===t.pages?'<span class="layui-laypage-nomore" title="&#x5DF2;&#x6CA1;&#x6709;&#x66F4;&#x591A;">'+t.next+"</span>":'<a href="javascript:;" class="layui-laypage-next" data-page="'+(t.curr+1)+'">'+t.next+"</a>"}()),'<div class="layui-box layui-laypage layui-laypage-'+(t.skin?function(a){return/^#/.test(a)?"molv":a}(t.skin):"default")+'" id="layui-laypage-'+a.config.item+'">'+e.join("")+function(){return t.skip?'<span class="layui-laypage-total">&#x5230;&#x7B2C; <input type="number" min="1" onkeyup="this.value=this.value.replace(/\\D/, \'\');" value="'+t.curr+'" class="layui-laypage-skip"> &#x9875; <button type="button" class="layui-laypage-btn">&#x786e;&#x5b9a;</button></span>':""}()+"</div>"},p.prototype.jump=function(a){if(a){for(var t=this,e=t.config,r=a.children,s=a[n]("button")[0],i=a[n]("input")[0],u=0,o=r.length;u<o;u++)"a"===r[u].nodeName.toLowerCase()&&p.on(r[u],"click",function(){var a=0|this.getAttribute("data-page");e.curr=a,t.render()});s&&p.on(s,"click",function(){var a=0|i.value.replace(/\s|\D/g,"");a&&a<=e.pages&&(e.curr=a,t.render())})}},p.prototype.render=function(a){var t=this,n=t.config,s=t.type(),p=t.view();2===s?n.cont.innerHTML=p:3===s?n.cont.html(p):e[r](n.cont).innerHTML=p,n.jump&&n.jump(n,a),t.jump(e[r]("layui-laypage-"+n.item)),n.hash&&!a&&(location.hash="!"+n.hash+"="+n.curr)},a("laypage",t)});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},n={exp:function(e){return new RegExp(e,"g")},query:function(e,n,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return c((n||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")},error:function(e,r){var n="Laytpl Error";return"object"==typeof console&&console.error(n+e+"\n"+(r||"")),n+e}},c=n.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=c("^"+r.open+"#",""),l=c(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(c(r.open+"#"),r.open+"# ").replace(c(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(/(?="|')/g,"\\").replace(n.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(n.query(1),function(e){var n='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(c(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),n='"+_escape_('),n+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,n.escape)}catch(u){return delete o.cache,n.error(u,p)}},t.pt.render=function(e,r){var c,t=this;return e?(c=t.cache?t.cache(e,n.escape):t.parse(t.tpl,e),r?void r(c):c):n.error("no data")};var o=function(e){return"string"!=typeof e?n.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var n in e)r[n]=e[n]},o.v="1.2.0",e("laytpl",o)});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("jquery",function(e){"use strict";var o=layui.jquery,a=layui.hint(),r="layui-tree-enter",i=function(e){this.options=e},t={arrow:["&#xe623;","&#xe625;"],checkbox:["&#xe626;","&#xe627;"],radio:["&#xe62b;","&#xe62a;"],branch:["&#xe622;","&#xe624;"],leaf:"&#xe621;"};i.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},i.prototype.tree=function(e,a){var r=this,i=r.options,n=a||i.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('<ul class="'+(n.spread?"layui-show":"")+'"></ul>'),s=o(["<li "+(n.spread?'data-spread="'+n.spread+'"':"")+">",function(){return l?'<i class="layui-icon layui-tree-spread">'+(n.spread?t.arrow[1]:t.arrow[0])+"</i>":""}(),function(){return i.check?'<i class="layui-icon layui-tree-check">'+("checkbox"===i.check?t.checkbox[0]:"radio"===i.check?t.radio[0]:"")+"</i>":""}(),function(){return'<a href="'+(n.href||"javascript:;")+'" '+(i.target&&n.href?'target="'+i.target+'"':"")+">"+('<i class="layui-icon layui-tree-'+(l?"branch":"leaf")+'">'+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"</i>")+("<cite>"+(n.name||"未命名")+"</cite></a>")}(),"</li>"].join(""));l&&(s.append(c),r.tree(c,n.children)),e.append(s),"function"==typeof i.click&&r.click(s,n),r.spread(s,n),i.drag&&r.drag(s,n)})},i.prototype.click=function(e,o){var a=this,r=a.options;e.children("a").on("click",function(e){layui.stope(e),r.click(o)})},i.prototype.spread=function(e,o){var a=this,r=(a.options,e.children(".layui-tree-spread")),i=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),i.removeClass("layui-show"),r.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),i.addClass("layui-show"),r.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};i[0]&&(r.on("click",l),n.on("dblclick",l))},i.prototype.on=function(e){var a=this,i=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),i.drag&&o(document).on("mousemove",function(e){var r=a.move;if(r.from){var i=(r.to,o('<div class="layui-box '+t+'"></div>'));e.preventDefault(),o("."+t)[0]||o("body").append(i);var n=o("."+t)[0]?o("."+t):i;n.addClass("layui-show").html(r.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(r),e.to&&e.to.elem.children("a").removeClass(r),a.move={},o("."+t).remove())})},i.prototype.move={},i.prototype.drag=function(e,a){var i=this,t=(i.options,e.children("a")),n=function(){var t=o(this),n=i.move;n.from&&(n.to={item:a,elem:e},t.addClass(r))};t.on("mousedown",function(){var o=i.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=i.move;a.from&&(delete a.to,e.removeClass(r))})},e("tree",function(e){var r=new i(e=e||{}),t=o(e.elem);return t[0]?void r.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("layer",function(e){"use strict";var a=layui.jquery,t=layui.layer,i=(layui.device(),"layui-upload-enter"),n="layui-upload-iframe",r={icon:2,shift:6},o={file:"文件",video:"视频",audio:"音频"},s=function(e){this.options=e};s.prototype.init=function(){var e=this,t=e.options,r=a("body"),s=a(t.elem||".layui-upload-file"),u=a('<iframe id="'+n+'" class="'+n+'" name="'+n+'"></iframe>');return a("#"+n)[0]||r.append(u),s.each(function(r,s){s=a(s);var u='<form target="'+n+'" method="'+(t.method||"post")+'" key="set-mine" enctype="multipart/form-data" action="'+(t.url||"")+'"></form>',l=s.attr("lay-type")||t.type;t.unwrap||(u='<div class="layui-box layui-upload-button">'+u+'<span class="layui-upload-icon"><i class="layui-icon">&#xe608;</i>'+(s.attr("lay-title")||t.title||"上传"+(o[l]||"图片"))+"</span></div>"),u=a(u),t.unwrap||u.on("dragover",function(e){e.preventDefault(),a(this).addClass(i)}).on("dragleave",function(){a(this).removeClass(i)}).on("drop",function(){a(this).removeClass(i)}),s.parent("form").attr("target")===n&&(t.unwrap?s.unwrap():(s.parent().next().remove(),s.unwrap().unwrap())),s.wrap(u),s.off("change").on("change",function(){e.action(this,l)})})},s.prototype.action=function(e,i){var o=this,s=o.options,u=e.value,l=a(e),p=l.attr("lay-ext")||s.ext||"";if(u){switch(i){case"file":if(p&&!RegExp("\\w\\.("+p+")$","i").test(escape(u)))return t.msg("不支持该文件格式",r),e.value="";break;case"video":if(!RegExp("\\w\\.("+(p||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(u)))return t.msg("不支持该视频格式",r),e.value="";break;case"audio":if(!RegExp("\\w\\.("+(p||"mp3|wav|mid")+")$","i").test(escape(u)))return t.msg("不支持该音频格式",r),e.value="";break;default:if(!RegExp("\\w\\.("+(p||"jpg|png|gif|bmp|jpeg")+")$","i").test(escape(u)))return t.msg("不支持该图片格式",r),e.value=""}s.before&&s.before(e),l.parent().submit();var c=a("#"+n),f=setInterval(function(){var a;try{a=c.contents().find("body").text()}catch(i){t.msg("上传接口存在跨域",r),clearInterval(f)}if(a){clearInterval(f),c.contents().find("body").html("");try{a=JSON.parse(a)}catch(i){return a={},t.msg("请对上传接口返回JSON字符",r)}"function"==typeof s.success&&s.success(a,e)}},30);e.value=""}},e("upload",function(e){var a=new s(e=e||{});a.init()})});

@ -1,2 +1,2 @@
/** layui-v1.0.1 经典模块化前端框架 LGPL license By www.layui.com */
/** layui-v1.0.2 经典模块化前端框架 LGPL license By www.layui.com */
;layui.define("jquery",function(l){"use strict";var o=layui.jquery,i={fixbar:function(l){l=l||{},l.bgcolor=l.bgcolor?"background-color:"+l.bgcolor:"";var i,a,c="layui-fixbar-top",t=[l.bar1===!0?"&#xe606;":l.bar1,l.bar2===!0?"&#xe607;":l.bar2,"&#xe604;"],r=o(['<ul class="layui-fixbar">',l.bar1?'<li class="layui-icon" lay-type="bar1" style="'+l.bgcolor+'">'+t[0]+"</li>":"",l.bar2?'<li class="layui-icon" lay-type="bar2" style="'+l.bgcolor+'">'+t[1]+"</li>":"",'<li class="layui-icon '+c+'" lay-type="top" style="'+l.bgcolor+'">'+t[2]+"</li>","</ul>"].join("")),e=r.find("."+c),s=function(){var i=o(document).scrollTop();i>=(l.showHeight||200)?a||(e.show(),a=1):a&&(e.hide(),a=0)};o(".layui-fixbar")[0]||("object"==typeof l.css&&r.css(l.css),o("body").append(r),s(),r.find("li").on("click",function(){var i=o(this),a=i.attr("lay-type");"top"===a&&o("html,body").animate({scrollTop:0},200),l.click&&l.click.call(this,a)}),o(document).on("scroll",function(){i&&clearTimeout(i),i=setTimeout(function(){s()},100)}))}};l("util",i)});

File diff suppressed because one or more lines are too long

@ -1,3 +1,6 @@
注意事项:
1、页面的HTML代码必须是 <!DOCTYPE html> 开头
2、除ie6、7外所有浏览器均支持
# 注意事项:
* 页面的HTML代码必须是 <!DOCTYPE html> 开头
* 除ie6、7外所有浏览器均支持
# 在线文档
[http://www.layui.com/doc/](http://www.layui.com/doc/)

@ -1,6 +1,6 @@
{
"name": "layui",
"version": "1.0.1",
"version": "1.0.2",
"description": "经典模块化前端框架",
"main": "layui.js",
"license": "LGPL",

@ -47,6 +47,7 @@ pre{white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; w
/** 初始化全局标签 **/
body{line-height: 24px; font: 14px Helvetica Neue,Helvetica,PingFang SC,\5FAE\8F6F\96C5\9ED1,Tahoma,Arial,sans-serif;}
hr{height: 1px; margin: 10px 0; border: 0; background-color: #e2e2e2; clear: both;}
a{color: #333; text-decoration:none; }
a:hover{color: #777;}
a cite{font-style: normal; *cursor:pointer;}
@ -60,9 +61,11 @@ a cite{font-style: normal; *cursor:pointer;}
/* 单行溢出省略 */.layui-elip{text-overflow: ellipsis; overflow: hidden; white-space: nowrap;}
/* 屏蔽选中 */.layui-unselect{-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;}
.layui-disabled,.layui-disabled:hover{color: #d2d2d2 !important; cursor: not-allowed !important;}
/* 纯圆角 */.layui-circle{border-radius: 100%;}
.layui-show{display: block !important;}
.layui-hide{display: none !important;}
/* 布局 */
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
.layui-header{position: relative; z-index: 1000; height: 65px;}
@ -81,10 +84,13 @@ a cite{font-style: normal; *cursor:pointer;}
/** 页面元素 **/
.layui-btn, .layui-input, .layui-textarea, .layui-upload-button{outline: none; -webkit-transition: border-color .3s cubic-bezier(.65,.05,.35,.5); transition: border-color .3s cubic-bezier(.65,.05,.35,.5); -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;}
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; border-left: 5px solid #009688; border-radius: 0 2px 2px 0; background-color: #f2f2f2;}
/* 字段集合 */.layui-elem-field{padding: 0; border: 1px solid #e2e2e2;}
/* 引用 */.layui-elem-quote{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #009688; border-radius: 0 2px 2px 0; background-color: #f2f2f2;}
.layui-quote-nm{border-color: #e2e2e2; border-style: solid; border-width: 1px; border-left-width: 5px; background: none;}
/* 字段集合 */.layui-elem-field{margin-bottom: 10px; padding: 0; border: 1px solid #e2e2e2;}
.layui-elem-field legend{margin-left: 20px; padding: 0 10px; font-size: 20px; font-weight: 300;}
.layui-field-title{margin: 10px 0 20px; border: none; border-top: 1px solid #e2e2e2;}
.layui-field-box{padding: 10px 15px;}
.layui-field-title .layui-field-box{padding: 10px 0;}
/* 颜色 */
.layui-bg-black{background-color: #393D49; color: #c2c2c2;}
@ -126,7 +132,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form input[type=checkbox],
.layui-form input[type=radio]{display: none;}
.layui-form-item{margin-bottom: 20px; clear: both; *zoom: 1;}
.layui-form-item{margin-bottom: 15px; clear: both; *zoom: 1;}
.layui-form-item:after{content:'\20'; clear: both; *zoom: 1; display: block; height:0;}
.layui-form-label{position: relative; float: left; display: block; padding: 9px 15px; width: 80px; line-height: 20px; text-align: right;}
.layui-form-item .layui-inline{margin-bottom: 5px; margin-right: 10px;}
@ -153,12 +159,12 @@ a cite{font-style: normal; *cursor:pointer;}
.layui-form-selected .layui-edge{margin-top: -3px\0; }
:root .layui-form-selected .layui-edge{margin-top: -9px\0/IE9;}
/* 复选框 */.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 38px; line-height: 36px; margin: 0 10px 0 0; padding-right: 43px; border: 1px solid #d2d2d2; background-color: #fff; cursor: pointer; font-size: 0; border-radius: 2px; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box !important;}
/* 复选框 */.layui-form-checkbox{position: relative; display: inline-block; vertical-align: middle; height: 30px; line-height: 28px; margin: 4px 10px 0 0; padding-right: 30px; border: 1px solid #d2d2d2; background-color: #fff; cursor: pointer; font-size: 0; border-radius: 2px; -webkit-transition: .1s linear; transition: .1s linear; box-sizing: border-box !important;}
.layui-form-checkbox:hover{border: 1px solid #c2c2c2;}
.layui-form-checkbox *{display: inline-block; vertical-align: middle;}
.layui-form-checkbox span{padding: 0 10px; font-size: 14px; background-color: #d2d2d2; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
.layui-form-checkbox:hover span{background-color: #c2c2c2;}
.layui-form-checkbox i{position: absolute; right: 0; width: 43px; margin-left: -3px; color: #fff; font-size: 20px;}
.layui-form-checkbox i{position: absolute; right: 0; width: 37px; color: #fff; font-size: 20px;}
.layui-form-checkbox:hover i{color: #c2c2c2;}
.layui-form-checked, .layui-form-checked:hover{border: 1px solid #5FB878;}
.layui-form-checked span, .layui-form-checked:hover span{background-color: #5FB878;}
@ -197,7 +203,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layedit-tool-fixed{position: fixed; top: 0; border-top: 1px solid #e2e2e2;}
.layui-layedit-tool .layedit-tool-mid,
.layui-layedit-tool .layui-icon{display: inline-block; vertical-align: middle; text-align: center; font-size: 14px;}
.layui-layedit-tool .layui-icon{position: relative; width: 32px; height: 30px; line-height: 30px; margin: 3px 5px; border-radius: 2px; color: #777; cursor: pointer; -webkit-transition: border-radius: 2px; border-color .3s cubic-bezier(.65,.05,.35,.5); transition: border-color .3s cubic-bezier(.65,.05,.35,.5);}
.layui-layedit-tool .layui-icon{position: relative; width: 32px; height: 30px; line-height: 30px; margin: 3px 5px; border-radius: 2px; color: #777; cursor: pointer; border-radius: 2px;}
.layui-layedit-tool .layui-icon:hover{color: #393D49;}
.layui-layedit-tool .layui-icon:active{color: #000;}
.layui-layedit-tool .layedit-tool-active{background-color: #e2e2e2; color: #000;}
@ -216,6 +222,7 @@ a cite{font-style: normal; *cursor:pointer;}
.layedit-tool-image input{position: absolute; font-size: 0; left: 0; top: 0; width: 100%; height: 100%; opacity: 0.01; filter: Alpha(opacity=1); cursor: pointer;}
.layui-layedit-iframe iframe{display: block; width: 100%;}
#LAY_layedit_code{overflow: hidden;}
/** 表格简单修饰 **/
.layui-table{width: 100%; margin: 10px 0;}
@ -436,8 +443,8 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
.layui-form-item .layui-inline{display: block; margin-right: 0; margin-bottom: 20px; clear: both;}
.layui-form-item .layui-inline:after{content:'\20'; clear:both; display:block; height:0;}
.layui-form-item .layui-input-inline{display: block; float: none; left: -1px; width: auto; margin: 0 0 10px 112px; }
.layui-form-item .layui-input-inline+.layui-form-mid{margin-left: 110px; top: -5px;}
.layui-form-item .layui-form-checkbox{display: block; margin-right: 0; margin-bottom: 10px;}
.layui-form-item .layui-input-inline+.layui-form-mid{margin-left: 110px; top: -5px; padding: 0;}
.layui-form-item .layui-form-checkbox{margin-right: 5px; margin-bottom: 5px;}
}

@ -144,7 +144,7 @@ layui.define(function(exports){
Dates.run = function(options){
var S = Dates.query, elem = options.elem, devt;
if(!options.elem) return;
if(!elem) return;
as.elemv = /textarea|input/.test(elem.tagName.toLocaleLowerCase()) ? 'value' : 'innerHTML';
if (('init' in options ? options.init : config.init) && (!elem[as.elemv])) elem[as.elemv] = laydate.now(null, options.format || config.format);

@ -29,8 +29,7 @@ layui.define(['layer', 'form'], function(exports){
,'|'
,'left', 'center', 'right'
,'|'
, 'link', 'unlink', 'face', 'image'
,'link', 'unlink', 'face', 'image'
]
,hideTool: []
,height: 280 //默认高
@ -78,7 +77,7 @@ layui.define(['layer', 'form'], function(exports){
,editor = $(['<div class="'+ ELEM +'">'
,'<div class="layui-unselect layui-layedit-tool">'+ tool +'</div>'
,'<div class="layui-layedit-iframe">'
,'<iframe id="'+ name +'" name="'+ name +'" frameborder="0"></iframe>'
,'<iframe id="'+ name +'" name="'+ name +'" textarea="'+ id +'" frameborder="0"></iframe>'
,'</div>'
,'</div>'].join(''))
@ -97,16 +96,24 @@ layui.define(['layer', 'form'], function(exports){
//获得编辑器中内容
Edit.prototype.getContent = function(index){
var iframeWin = $('#LAY_layedit_'+ index).prop('contentWindow');
if(!iframeWin) return;
return iframeWin.document.body.innerHTML;
var iframeWin = getWin(index);
if(!iframeWin[0]) return;
return toLower(iframeWin[0].document.body.innerHTML);
};
//获得编辑器中纯文本内容
Edit.prototype.getText = function(index){
var iframeWin = $('#LAY_layedit_'+ index).prop('contentWindow');
if(!iframeWin) return;
return $(iframeWin.document.body).text();
var iframeWin = getWin(index);
if(!iframeWin[0]) return;
return $(iframeWin[0].document.body).text();
};
//将编辑器内容同步到textarea一般用于异步提交时
Edit.prototype.sync = function(index){
var iframeWin = getWin(index);
if(!iframeWin[0]) return;
var textarea = $('#'+iframeWin[1].attr('textarea'));
textarea.val(toLower(iframeWin[0].document.body.innerHTML));
};
//iframe初始化
@ -125,6 +132,7 @@ layui.define(['layer', 'form'], function(exports){
,'a{color:#01AAED; text-decoration:none;}a:hover{color:#c00}'
,'p{margin-bottom: 10px;}'
,'img{display: inline-block; border: none; vertical-align: middle;}'
,'pre{margin: 10px 0; padding: 10px; line-height: 20px; border: 1px solid #ddd; border-left-width: 6px; background-color: #F2F2F2; color: #333; font-family: Courier New; font-size: 12px;}'
,'</style>'].join(''))
,body = conts.find('body');
@ -139,6 +147,23 @@ layui.define(['layer', 'form'], function(exports){
});
}
//获得iframe窗口对象
,getWin = function(index){
var iframe = $('#LAY_layedit_'+ index)
,iframeWin = iframe.prop('contentWindow');
return [iframeWin, iframe];
}
//IE8下将标签处理成小写
,toLower = function(html){
if(device.ie == 8){
html = html.replace(/<.+>/g, function(str){
return str.toLowerCase();
});
}
return html;
}
//快捷键处理
,hotkey = function(iframeWin, iframe, textArea, set){
var iframeDOM = iframeWin.document, body = $(iframeDOM.body);
@ -146,11 +171,29 @@ layui.define(['layer', 'form'], function(exports){
var keycode = e.keyCode;
//处理回车
if(keycode === 13){
//此处后续还要处理列表等情况
var range = Range(iframeDOM);
var container = getContainer(range)
,parentNode = container.parentNode;
if(parentNode.tagName.toLowerCase() === 'pre'){
if(e.shiftKey) return
layer.msg('请暂时用shift+enter');
return false;
}
iframeDOM.execCommand('formatBlock', false, '<p>');
}
//给textarea同步内容
textArea.value = body.html();
});
//给textarea同步内容
$(textArea).parents('form').on('submit', function(){
var html = body.html();
//IE8下将标签处理成小写
if(device.ie == 8){
html = html.replace(/<.+>/g, function(str){
return str.toLowerCase();
});
}
textArea.value = html;
});
//处理粘贴
@ -342,7 +385,12 @@ layui.define(['layer', 'form'], function(exports){
}
//插入代码
,code: function(range){
layer.msg('Next Version');
code.call(body, function(pre){
insertInline.call(iframeWin, 'pre', {
text: pre.code
,'lay-lang': pre.lang
}, range);
});
}
//帮助
,help: function(){
@ -431,7 +479,7 @@ layui.define(['layer', 'form'], function(exports){
+ ((options.target==='_self' || !options.target) ? 'checked' : '') +'>'
,'<input type="radio" name="target" value="_blank" class="layui-input" title="新窗口" '
+ (options.target==='_blank' ? 'checked' : '') +'>'
,'</div>'
,'</div>'
,'</li>'
,'<li class="layui-form-item" style="text-align: center;">'
,'<button type="button" lay-submit lay-filter="layedit-link-yes" class="layui-btn"> 确定 </button>'
@ -445,7 +493,6 @@ layui.define(['layer', 'form'], function(exports){
layer.close(index);
body.focus();
});
delete layui.cache.event['form.'+eventFilter];
form.on(eventFilter, function(data){
layer.close(link.index);
callback && callback(data.field);
@ -497,6 +544,61 @@ layui.define(['layer', 'form'], function(exports){
});
}
//插入代码面板
,code = function(callback){
var body = this, index = layer.open({
type: 1
,id: 'LAY_layedit_code'
,area: '550px'
,shade: 0.05
,shadeClose: true
,moveType: 1
,title: '插入代码'
,skin: 'layui-layer-msg'
,content: ['<ul class="layui-form layui-form-pane" style="margin: 15px;">'
,'<li class="layui-form-item">'
,'<label class="layui-form-label">请选择语言</label>'
,'<div class="layui-input-block">'
,'<select name="lang">'
,'<option value="JavaScript">JavaScript</option>'
,'<option value="HTML">HTML</option>'
,'<option value="CSS">CSS</option>'
,'<option value="Java">Java</option>'
,'<option value="PHP">PHP</option>'
,'<option value="C#">C#</option>'
,'<option value="Python">Python</option>'
,'<option value="Ruby">Ruby</option>'
,'<option value="Go">Go</option>'
,'</select>'
,'</div>'
,'</li>'
,'<li class="layui-form-item layui-form-text">'
,'<label class="layui-form-label">代码</label>'
,'<div class="layui-input-block">'
,'<textarea name="code" lay-verify="required" autofocus="true" class="layui-textarea" style="height: 200px;"></textarea>'
,'</div>'
,'</li>'
,'<li class="layui-form-item" style="text-align: center;">'
,'<button type="button" lay-submit lay-filter="layedit-code-yes" class="layui-btn"> 确定 </button>'
,'<button style="margin-left: 20px;" type="button" class="layui-btn layui-btn-primary"> 取消 </button>'
,'</li>'
,'</ul>'].join('')
,success: function(layero, index){
var eventFilter = 'submit(layedit-code-yes)';
form.render('select');
layero.find('.layui-btn-primary').on('click', function(){
layer.close(index);
body.focus();
});
form.on(eventFilter, function(data){
layer.close(code.index);
callback && callback(data.field);
});
}
});
code.index = index;
}
//全部工具
,tools = {
html: '<i class="layui-icon layedit-tool-html" title="HTML源代码" lay-command="html" layedit-event="html"">&#xe64b;</i><span class="layedit-tool-mid"></span>'

@ -102,7 +102,7 @@ layui.define(function(exports){
}()));
}
return '<div class="layui-laypage layui-laypage-'+ (conf.skin ? (function(skin){
return '<div class="layui-box layui-laypage layui-laypage-'+ (conf.skin ? (function(skin){
return /^#/.test(skin) ? 'molv' : skin;
}(conf.skin)) : 'default') +'" id="layui-laypage-'+ that.config.item +'">'+ view.join('') + function(){
return conf.skip

@ -13,7 +13,7 @@
"use strict";
var Lay = function(){
this.v = '1.0.1'; //版本号
this.v = '1.0.2'; //版本号
};
Lay.fn = Lay.prototype;
@ -396,9 +396,15 @@ Lay.fn.stope = function(e){
Lay.fn.onevent = function(modName, events, callback){
if(typeof modName !== 'string'
|| typeof callback !== 'function') return this;
config.event[modName + '.' + events] = [callback];
//不再对多次事件监听做支持
/*
config.event[modName + '.' + events]
? config.event[modName + '.' + events].push(callback)
: config.event[modName + '.' + events] = [callback];
*/
return this;
};

@ -13,6 +13,24 @@ body{padding: 10px;}
</head>
<body>
<blockquote class="layui-elem-quote">Layui正是你苦苦寻找的前端UI框架</blockquote>
<blockquote class="layui-elem-quote layui-quote-nm">Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架Layui正是你苦苦寻找的前端UI框架</blockquote>
<fieldset class="layui-elem-field">
<legend>字段集区块 - 默认风格</legend>
<div class="layui-field-box">
内容区域
</div>
</fieldset>
<fieldset class="layui-elem-field layui-field-title">
<legend>字段集区块 - 横线风格</legend>
</fieldset>
我们都是
<hr>
好孩子
<ul class="layui-nav">
<li class="layui-nav-item"><a href="">最新活动</a></li>

@ -17,7 +17,7 @@ body{padding: 50px 100px;}
<li class="layui-form-item">
<label class="layui-form-label">日期</label>
<div class="layui-input-inline">
<input required type="text" id="layui-laydate-input" class="layui-input">
<input required type="text" id="layui-laydate-input" onclick="layui.laydate({elem: this})" class="layui-input">
</div>
</li>
</ul>
@ -26,10 +26,6 @@ body{padding: 50px 100px;}
<script>
layui.use('laydate', function(){
var laydate = layui.laydate
laydate({
elem: '#layui-laydate-input'
});
});
</script>
</body>

@ -14,9 +14,14 @@ body{padding: 10px;}
<body>
<div style="width: 800px;">
<textarea id="demo" class="layui-hide">
<p><span>一个范围具有两个边界点,即一个开始点和一个结束点。每个边界点由一个节点和那个节点的偏移量指定。该节点通常是&nbsp;</span><a href="http://www.w3school.com.cn/xmldom/dom_element.asp" title="XML DOM - Element 对象">Element 节点</a><span></span><a href="http://www.w3school.com.cn/xmldom/dom_document.asp" title="XML DOM - Document 对象">Document 节点</a><span>&nbsp;</span><a href="http://www.w3school.com.cn/xmldom/dom_text.asp" title="XML DOM - Text 对象">Text 节点</a><span>。对于 Element 节点和 Document 节点,偏移量指该节点的子节点。偏移量为 0说明边界点位于该节点的第一个子节点之前。偏移量为 1说明边界点位于该节点的第一个子节点之后第二个子节点之前。但如果边界节点是 Text 节点,偏移量则指的是文本中两个字符之间的位置。</span></p>
</textarea>
<form class="layui-form">
<div class="layui-form-item">
<textarea name="demo" id="demo" class="layui-hide">
<p><span>一个范围具有两个边界点,即一个开始点和一个结束点。每个边界点由一个节点和那个节点的偏移量指定。该节点通常是&nbsp;</span><a href="http://www.w3school.com.cn/xmldom/dom_element.asp" title="XML DOM - Element 对象">Element 节点</a><span></span><a href="http://www.w3school.com.cn/xmldom/dom_document.asp" title="XML DOM - Document 对象">Document 节点</a><span>&nbsp;</span><a href="http://www.w3school.com.cn/xmldom/dom_text.asp" title="XML DOM - Text 对象">Text 节点</a><span>。对于 Element 节点和 Document 节点,偏移量指该节点的子节点。偏移量为 0说明边界点位于该节点的第一个子节点之前。偏移量为 1说明边界点位于该节点的第一个子节点之后第二个子节点之前。但如果边界节点是 Text 节点,偏移量则指的是文本中两个字符之间的位置。</span></p>
</textarea>
</div>
<button class="layui-btn">提交</button>
</form>
</div>

Loading…
Cancel
Save