diff --git a/UPDATELOG.md b/UPDATELOG.md index 21544d9..cf48692 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -2,7 +2,7 @@ * [功能] 现在项目创建者和项目成员都可以管理项目成员列表和编辑项目。现在没有管理权限的项目文档将不能进行任何查看外的操作。2014-06-18 * [功能] 增加项目路由的设置功能,工作区『插件代码』按钮变更为『FE工具集』,除获取代码外也负责路由设置,后续还会增加更多配置。完善项目路由设置文档。2014-06-18 * [BUG] 修复工作区mock=true时console报错的问题。2014-06-18 -* [体验] 本次存储记录Mock视图状态。 2014-06-18 +* [体验] 本地存储记录Mock视图状态。 2014-06-18 * [功能] 增加对请求参数列表的JSON导入功能 2014-06-18 * [功能] 增加管理员万用密码,修改PRIVATE_CONFIG.adminPassword不为空即可使用万用密码登录,方便调试问题。注意不要上传带有内容的PRIVATE_CONFIG.java 2014-06-17 * [体验] 修复用户名密码自动完成位置错误的问题, 2014-06-17 diff --git a/WebContent/stat/js/core/mock-min.js b/WebContent/stat/js/core/mock-min.js deleted file mode 100644 index 733169f..0000000 --- a/WebContent/stat/js/core/mock-min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! mockjs 30-12-2013 */ -(function(a){var b={version:"0.1.1",_mocked:{}},c=function(){var b={};return b.extend=function(){var c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length;for(1===j&&(h=this,i=0);j>i;i++)if(c=arguments[i])for(d in c)e=h[d],f=c[d],h!==f&&f!==a&&(b.isArray(f)||b.isObject(f)?(b.isArray(f)&&(g=e&&b.isArray(e)?e:[]),b.isObject(f)&&(g=e&&b.isObject(e)?e:{}),h[d]=b.extend(g,f)):h[d]=f);return h},b.each=function(a,b,c){var d,e;if("number"===this.type(a))for(d=0;a>d;d++)b(d,d);else if(a.length===+a.length)for(d=0;d1/(b+c)*b?!d:d):Math.random()>=.5},bool:function(a,b,c){return this.boolean(a,b,c)},natural:function(a,b){return a="undefined"!=typeof a?parseInt(a,10):0,b="undefined"!=typeof b?parseInt(b,10):9007199254740992,Math.round(Math.random()*(b-a))+a},integer:function(a,b){return a="undefined"!=typeof a?parseInt(a,10):-9007199254740992,b="undefined"!=typeof b?parseInt(b,10):9007199254740992,Math.round(Math.random()*(b-a))+a},"int":function(a,b){return this.integer(a,b)},"float":function(b,c,d,e){d=d===a?0:d,d=Math.max(Math.min(d,17),0),e=e===a?17:e,e=Math.max(Math.min(e,17),0);for(var f=this.integer(b,c)+".",g=0,h=this.natural(d,e);h>g;g++)f+=this.character("number");return parseFloat(f,10)},character:function(a){var c={lower:"abcdefghijklmnopqrstuvwxyz",upper:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",number:"0123456789",symbol:"!@#$%^&*()[]"};return c.alpha=c.lower+c.upper,c.undefined=c.lower+c.upper+c.number+c.symbol,a=c[(""+a).toLowerCase()]||a,a.charAt(b.natural(0,a.length-1))},"char":function(a){return this.character(a)},string:function(c,d,e){var f;3===arguments.length&&(f=b.natural(d,e)),2===arguments.length&&("string"==typeof arguments[0]?f=d:(f=b.natural(c,d),c=a)),1===arguments.length&&(f=c,c=a),0===arguments.length&&(f=b.natural(3,7));for(var g="",h=0;f>h;h++)g+=b.character(c);return g},str:function(a,b,c){return this.string(a,b,c)},range:function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f}}),b.extend({patternLetters:{yyyy:"getFullYear",yy:function(a){return(""+a.getFullYear()).slice(2)},y:"yy",MM:function(a){var b=a.getMonth()+1;return 10>b?"0"+b:b},M:function(a){return a.getMonth()+1},dd:function(a){var b=a.getDate();return 10>b?"0"+b:b},d:"getDate",HH:function(a){var b=a.getHours();return 10>b?"0"+b:b},H:"getHours",hh:function(a){var b=a.getHours()%12;return 10>b?"0"+b:b},h:function(a){return a.getHours()%12},mm:function(a){var b=a.getMinutes();return 10>b?"0"+b:b},m:"getMinutes",ss:function(a){var b=a.getSeconds();return 10>b?"0"+b:b},s:"getSeconds",SS:function(a){var b=a.getMilliseconds();return 10>b&&"00"+b||100>b&&"0"+b||b},S:"getMilliseconds",A:function(a){return a.getHours()<12?"AM":"PM"},a:function(a){return a.getHours()<12?"am":"pm"}}}),b.extend({rformat:new RegExp(function(){var a=[];for(var c in b.patternLetters)a.push(c);return"("+a.join("|")+")"}(),"g"),format:function(a,c){var d=b.patternLetters,e=b.rformat;return c.replace(e,function(b,c){return"function"==typeof d[c]?d[c](a):d[c]in d?arguments.callee(b,d[c]):a[d[c]]()})},randomDate:function(b,c){return b=b===a?new Date(0):b,c=c===a?new Date:c,new Date(Math.random()*(c.getTime()-b.getTime()))},date:function(a){return a=a||"yyyy-MM-dd",this.format(this.randomDate(),a)},time:function(a){return a=a||"HH:mm:ss",this.format(this.randomDate(),a)},datetime:function(a){return a=a||"yyyy-MM-dd HH:mm:ss",this.format(this.randomDate(),a)}}),b.extend({ad_size:["300x250","250x250","240x400","336x280","180x150","720x300","468x60","234x60","88x31","120x90","120x60","120x240","125x125","728x90","160x600","120x600","300x600"],screen_size:["320x200","320x240","640x480","800x480","800x480","1024x600","1024x768","1280x800","1440x900","1920x1200","2560x1600"],video_size:["720x480","768x576","1280x720","1920x1080"],image:function(b,c,d,e,f){return 4===arguments.length&&(f=e,e=a),3===arguments.length&&(f=d,d=a),b||(b=this.pick(this.ad_size)),c&&~c.indexOf("#")&&(c=c.slice(1)),d&&~d.indexOf("#")&&(d=d.slice(1)),"http://dummyimage.com/"+b+(c?"/"+c:"")+(d?"/"+d:"")+(e?"."+e:"")+(f?"&text="+f:"")},img:function(){return this.image.apply(this,arguments)}}),b.extend({brandColors:{"4ormat":"#fb0a2a","500px":"#02adea","About.me (blue)":"#00405d","About.me (yellow)":"#ffcc33",Addvocate:"#ff6138",Adobe:"#ff0000",Aim:"#fcd20b",Amazon:"#e47911",Android:"#a4c639","Angie's List":"#7fbb00",AOL:"#0060a3",Atlassian:"#003366",Behance:"#053eff","Big Cartel":"#97b538",bitly:"#ee6123",Blogger:"#fc4f08",Boeing:"#0039a6","Booking.com":"#003580",Carbonmade:"#613854",Cheddar:"#ff7243","Code School":"#3d4944",Delicious:"#205cc0",Dell:"#3287c1",Designmoo:"#e54a4f",Deviantart:"#4e6252","Designer News":"#2d72da",Devour:"#fd0001",DEWALT:"#febd17","Disqus (blue)":"#59a3fc","Disqus (orange)":"#db7132",Dribbble:"#ea4c89",Dropbox:"#3d9ae8",Drupal:"#0c76ab",Dunked:"#2a323a",eBay:"#89c507",Ember:"#f05e1b",Engadget:"#00bdf6",Envato:"#528036",Etsy:"#eb6d20",Evernote:"#5ba525","Fab.com":"#dd0017",Facebook:"#3b5998",Firefox:"#e66000","Flickr (blue)":"#0063dc","Flickr (pink)":"#ff0084",Forrst:"#5b9a68",Foursquare:"#25a0ca",Garmin:"#007cc3",GetGlue:"#2d75a2",Gimmebar:"#f70078",GitHub:"#171515","Google Blue":"#0140ca","Google Green":"#16a61e","Google Red":"#dd1812","Google Yellow":"#fcca03","Google+":"#dd4b39",Grooveshark:"#f77f00",Groupon:"#82b548","Hacker News":"#ff6600",HelloWallet:"#0085ca","Heroku (light)":"#c7c5e6","Heroku (dark)":"#6567a5",HootSuite:"#003366",Houzz:"#73ba37",HTML5:"#ec6231",IKEA:"#ffcc33",IMDb:"#f3ce13",Instagram:"#3f729b",Intel:"#0071c5",Intuit:"#365ebf",Kickstarter:"#76cc1e",kippt:"#e03500",Kodery:"#00af81",LastFM:"#c3000d",LinkedIn:"#0e76a8",Livestream:"#cf0005",Lumo:"#576396",Mixpanel:"#a086d3",Meetup:"#e51937",Nokia:"#183693",NVIDIA:"#76b900",Opera:"#cc0f16",Path:"#e41f11","PayPal (dark)":"#1e477a","PayPal (light)":"#3b7bbf",Pinboard:"#0000e6",Pinterest:"#c8232c",PlayStation:"#665cbe",Pocket:"#ee4056",Prezi:"#318bff",Pusha:"#0f71b4",Quora:"#a82400","QUOTE.fm":"#66ceff",Rdio:"#008fd5",Readability:"#9c0000","Red Hat":"#cc0000",Resource:"#7eb400",Rockpack:"#0ba6ab",Roon:"#62b0d9",RSS:"#ee802f",Salesforce:"#1798c1",Samsung:"#0c4da2",Shopify:"#96bf48",Skype:"#00aff0",Snagajob:"#f47a20",Softonic:"#008ace",SoundCloud:"#ff7700","Space Box":"#f86960",Spotify:"#81b71a",Sprint:"#fee100",Squarespace:"#121212",StackOverflow:"#ef8236",Staples:"#cc0000","Status Chart":"#d7584f",Stripe:"#008cdd",StudyBlue:"#00afe1",StumbleUpon:"#f74425","T-Mobile":"#ea0a8e",Technorati:"#40a800","The Next Web":"#ef4423",Treehouse:"#5cb868",Trulia:"#5eab1f",Tumblr:"#34526f","Twitch.tv":"#6441a5",Twitter:"#00acee",TYPO3:"#ff8700",Ubuntu:"#dd4814",Ustream:"#3388ff",Verizon:"#ef1d1d",Vimeo:"#86c9ef",Vine:"#00a478",Virb:"#06afd8","Virgin Media":"#cc0000",Wooga:"#5b009c","WordPress (blue)":"#21759b","WordPress (orange)":"#d54e21","WordPress (grey)":"#464646",Wunderlist:"#2b88d9",XBOX:"#9bc848",XING:"#126567","Yahoo!":"#720e9e",Yandex:"#ffcc00",Yelp:"#c41200",YouTube:"#c4302b",Zalongo:"#5498dc",Zendesk:"#78a300",Zerply:"#9dcc7a",Zootool:"#5e8b1d"},brands:function(){var a=[];for(var b in this.brandColors)a.push(b);return a},dataImageHolder:function(a){return"holder.js/"+a},dataImage:function(b,c){var d="undefined"!=typeof document&&document.createElement("canvas"),e=d&&d.getContext&&d.getContext("2d");if(!d||!e)return"";b||(b=this.pick(this.ad_size)),c=c!==a?c:b,b=b.split("x");var f=parseInt(b[0],10),g=parseInt(b[1],10),h=this.brandColors[this.pick(this.brands())],i="#FFF",j=14,k="sans-serif";return d.width=f,d.height=g,e.textAlign="center",e.textBaseline="middle",e.fillStyle=h,e.fillRect(0,0,f,g),e.fillStyle=i,e.font="bold "+j+"px "+k,e.fillText(c,f/2,g/2,f),d.toDataURL("image/png")}}),b.extend({color:function(){var a=Math.floor(16777215*Math.random()).toString(16);return a="#"+("000000"+a).slice(-6)}}),b.extend({capitalize:function(a){return a.charAt(0).toUpperCase()+a.substr(1)},upper:function(a){return a.toUpperCase()},lower:function(a){return a.toLowerCase()},pick:function(a){return a[this.natural(0,a.length-1)]},shuffle:function(a){for(var b=a.slice(0),c=[],d=0,e=b.length,f=0;e>f;f++)d=this.natural(0,b.length-1),c.push(b[d]),b.splice(d,1);return c}}),b.extend({paragraph:function(a,c){var d;0===arguments.length&&(d=b.natural(3,7)),1===arguments.length&&(d=c=a),2===arguments.length&&(a=parseInt(a,10),c=parseInt(c,10),d=b.natural(a,c));for(var e=[],f=0;d>f;f++)e.push(b.sentence());return e.join(" ")},sentence:function(a,c){var d;0===arguments.length&&(d=b.natural(12,18)),1===arguments.length&&(d=c=a),2===arguments.length&&(a=parseInt(a,10),c=parseInt(c,10),d=b.natural(a,c));for(var e=[],f=0;d>f;f++)e.push(b.word());return b.capitalize(e.join(" "))+"."},word:function(a,c){var d;0===arguments.length&&(d=b.natural(3,10)),1===arguments.length&&(d=c=a),2===arguments.length&&(a=parseInt(a,10),c=parseInt(c,10),d=b.natural(a,c));for(var e="",f=0;d>f;f++)e+=b.character("lower");return e},title:function(a,c){var d,e=[];0===arguments.length&&(d=b.natural(3,7)),1===arguments.length&&(d=c=a),2===arguments.length&&(a=parseInt(a,10),c=parseInt(c,10),d=b.natural(a,c));for(var f=0;d>f;f++)e.push(this.capitalize(this.word()));return e.join(" ")}}),b.extend({first:function(){var a=["James","John","Robert","Michael","William","David","Richard","Charles","Joseph","Thomas","Christopher","Daniel","Paul","Mark","Donald","George","Kenneth","Steven","Edward","Brian","Ronald","Anthony","Kevin","Jason","Matthew","Gary","Timothy","Jose","Larry","Jeffrey","Frank","Scott","Eric"].concat(["Mary","Patricia","Linda","Barbara","Elizabeth","Jennifer","Maria","Susan","Margaret","Dorothy","Lisa","Nancy","Karen","Betty","Helen","Sandra","Donna","Carol","Ruth","Sharon","Michelle","Laura","Sarah","Kimberly","Deborah","Jessica","Shirley","Cynthia","Angela","Melissa","Brenda","Amy","Anna"]);return this.pick(a)},last:function(){var a=["Smith","Johnson","Williams","Brown","Jones","Miller","Davis","Garcia","Rodriguez","Wilson","Martinez","Anderson","Taylor","Thomas","Hernandez","Moore","Martin","Jackson","Thompson","White","Lopez","Lee","Gonzalez","Harris","Clark","Lewis","Robinson","Walker","Perez","Hall","Young","Allen"];return this.pick(a)},name:function(a){return this.first()+" "+(a?this.first()+" ":"")+this.last()}}),b.extend({url:function(){return"http://"+this.domain()+"/"+this.word()},domain:function(a){return this.word()+"."+(a||this.tld())},email:function(a){return this.character("lower")+"."+this.last().toLowerCase()+"@"+this.last().toLowerCase()+"."+this.tld()},ip:function(){return this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)+"."+this.natural(0,255)},tlds:["com","org","edu","gov","co.uk","net","io"],tld:function(){return this.pick(this.tlds)}}),b.extend({areas:["东北","华北","华东","华中","华南","西南","西北"],area:function(){return this.pick(this.areas)},regions:["110000 北京市","120000 天津市","130000 河北省","140000 山西省","150000 内蒙古自治区","210000 辽宁省","220000 吉林省","230000 黑龙江省","310000 上海市","320000 江苏省","330000 浙江省","340000 安徽省","350000 福建省","360000 江西省","370000 山东省","410000 河南省","420000 湖北省","430000 湖南省","440000 广东省","450000 广西壮族自治区","460000 海南省","500000 重庆市","510000 四川省","520000 贵州省","530000 云南省","540000 西藏自治区","610000 陕西省","620000 甘肃省","630000 青海省","640000 宁夏回族自治区","650000 新疆维吾尔自治区","650000 新疆维吾尔自治区","710000 台湾省","810000 香港特别行政区","820000 澳门特别行政区"],region:function(){return this.pick(this.regions).split(" ")[1]},address:function(){},city:function(){},phone:function(){},areacode:function(){},street:function(){},street_suffixes:function(){},street_suffix:function(){},states:function(){},state:function(){},zip:function(a){for(var b="",c=0;(a||6)>c;c++)b+=this.natural(0,9);return b}}),b.extend({todo:function(){return"todo"}}),b.extend({d4:function(){return this.natural(1,4)},d6:function(){return this.natural(1,6)},d8:function(){return this.natural(1,8)},d12:function(){return this.natural(1,12)},d20:function(){return this.natural(1,20)},d100:function(){return this.natural(1,100)},guid:function(){var a="ABCDEF1234567890",b=this.string(a,8)+"-"+this.string(a,4)+"-"+this.string(a,4)+"-"+this.string(a,4)+"-"+this.string(a,12);return b},id:function(){var a,b=0,c=["7","9","10","5","8","4","2","1","6","3","7","9","10","5","8","4","2"],d=["1","0","X","9","8","7","6","5","4","3","2"];a=this.pick(this.regions).split(" ")[0]+this.date("yyyyMMdd")+this.string("number",3);for(var e=0;e1)e=d.pick(h.gen(a.template));else for(b=0;b",g.rurl);var h=b.mock(g.template);return console.log("[mock]",h),e.success&&e.success(h,"success",d),e.complete&&e.complete(h,"success",d),a}}return c.apply(this,arguments)}}),b.Util=c,b.Random=d,b.heredoc=c.heredoc,"object"==typeof module&&module.exports?module.exports=b:"function"==typeof define&&define.amd?define(function(){return b}):"function"==typeof define&&define.cmd&&define(function(){return b}),this.Mock=b,this.Random=d,"undefined"!=typeof KISSY&&c.each(["mock","components/mock/index","mock/dist/mock","gallery/Mock/0.1.1/index","gallery/Mock/0.1.2/index"],function(a){KISSY.add(a,function(a){return b.mockjax(a),b},{requires:["ajax"]})}),function(a){var e={version:"0.0.1"};this.Mock||(module.exports=e),b.tpl=function(a,b,c,d){return e.mock(a,b,c,d)},b.parse=function(a){return Handlebars.parse(a)},e.mock=function(a,b,d,e){return d=d?c.extend({},d,Handlebars.helpers):Handlebars.helpers,e=e?c.extend({},e,Handlebars.partials):Handlebars.partials,f.gen(a,null,b,d,e)};var f={debug:e.debug||!1,extend:c.extend};f.gen=function(a,b,d,g,h){if(c.isString(a)){var i=Handlebars.parse(a);d=f.parseOptions(a,d);var j=f.gen(i,b,d,g,h);return j}if(b=b||[{}],d=d||{},this[a.type]!==c.noop){d.__path=d.__path||[],(e.debug||f.debug)&&(console.log(),console.group("["+a.type+"]",JSON.stringify(a)),console.log("[options]",d.__path.length,JSON.stringify(d)));var k=d.__path.length;return this[a.type](a,b,d,g,h),d.__path.splice(k),(e.debug||f.debug)&&console.groupEnd(),b[b.length-1]}},f.parseOptions=function(a,b){var d,e,f,g=//g,h=a.match(g),i={};for(d=0;h&&di&&b.splice(0,b.length-i)},f.block=function(a,b,e,f,h){var i,j,k,l,m,n=a.mustache.id.parts,o=b[0],p=b.length;if(a.inverse,a.mustache.isHelper||f&&f[a.mustache.id.string])m=n[0],l=(g[m]||g.custom).apply(this,arguments),o=b[0];else for(i=0;ii;i++)o.push("undefined"!=typeof l[i]?l[i]:{}),e.__path.push("[]"),b.unshift(o[o.length-1]),this.gen(a.program,b,e,f,h),e.__path.pop(),b.shift();else this.gen(a.program,b,e,f,h);b.length>p&&b.splice(0,b.length-p)},f.hash=function(a,b,c,d,e){var f,g,h,i=a.pairs;for(g=0;ge;e++)d.__path.push(n[e]),g=n[e],h=n[e-1],m=d[h],i=e===f-1?o[g]:{},j=this.val(g,d,b,i),k=c.type(o[g]),l=c.type(j),"undefined"===k?o[g]=f-1>e&&"object"!==l&&"array"!==l?{}:c.isArray(j)&&[]||j:f-1>e&&"object"!==k&&"array"!==k&&(o[g]=c.isArray(j)&&[]||{}),k=c.type(o[g]),("object"===k||"array"===k)&&(o=o[g],b.unshift(o));else;b.length>p&&b.splice(0,b.length-p)},f.partial=function(a,b,c,d,e){var g=a.partialName.name,h=e&&e[g],i=b.length;h&&f.gen(h,b,c,d,e),b.length>i&&b.splice(0,b.length-i)},f.content=c.noop,f.PARTIAL_NAME=c.noop,f.DATA=c.noop,f.STRING=c.noop,f.INTEGER=c.noop,f.BOOLEAN=c.noop,f.comment=c.noop;var g={};g.each=function(a,b,d){var e,f,g,h,i,j,k,l=b[0];for(i=a.mustache.params[0].parts,e=0,f=i.length;f>e;e++)d.__path.push(i[e]),g=i[e],j=e===f-1?[]:{},h=this.val(g,d,b,j),l[g]=c.isArray(h)&&[]||h,k=c.type(l[g]),("object"===k||"array"===k)&&(l=l[g],b.unshift(l));return h},g["if"]=g.unless=function(a,b,d){var e,f,g,h,i,j,k,l=a.mustache.params,m=b[0];for(e=0;ee;e++)d.__path.push(i[e]),g=i[e],j=e===f-1?[]:{},h=this.val(g,d,b,j),l[g]=c.isArray(h)&&[]||h,k=c.type(l[g]),("object"===k||"array"===k)&&(l=l[g],b.unshift(l));return h}}}.call(this),function(a){if("undefined"!=typeof KISSY){var e,f={debug:!1};KISSY.use("xtemplate",function(a,b){e=b}),this.Mock||(module.exports=f),b.xtpl=function(a,b,c,d){return f.mock(a,b,c,d)},b.xparse=function(a){return e.compiler.parse(a)},f.mock=function(a,b,d,f){return d=d?c.extend({},d,e.RunTime.commands):e.RunTime.commands,f=f?c.extend({},f,e.RunTime.subTpls):e.RunTime.subTpls,this.gen(a,null,b,d,f,{})},f.parse=function(a){return e.compiler.parse(a)},f.gen=function(a,b,d,e,g,h){if("string"==typeof a){f.debug&&console.log("[tpl ]\n",a);var i=this.parse(a);d=this.parseOptions(a,d);var j=this.gen(i,b,d,e,g,h);return j}if(b=b||[{}],d=d||{},a.type=a.type,this[a.type]!==c.noop){d.__path=d.__path||[],f.debug&&(console.log(),console.group("["+a.type+"]",JSON.stringify(a)),console.log("[context]","[before]",b.length,JSON.stringify(b)),console.log("[options]","[before]",d.__path.length,JSON.stringify(d)),console.log("[other ]","[before]",JSON.stringify(h)));var k=d.__path.length;return this[a.type](a,b,d,e,g,h),f.debug&&console.log("[__path ]","[after ]",d.__path),(!h.hold||"function"==typeof h.hold&&!h.hold(a,d,b))&&d.__path.splice(k),f.debug&&(console.log("[context]","[after ]",b.length,JSON.stringify(b)),console.groupEnd()),b[b.length-1]}},f.parseOptions=function(a,b){var d,e,f,g=//g,h=a.match(g),i={};for(d=0;h&&d0)return j[0];if(d in i)return i[d]}return c.isArray(g[0])?{}:h!==a?h:d},f.program=function(a,b,c,d,e,f){for(var g=0;gl;l++)n.push(k&&k[l]!==a?k[l]:{}),f.__path.push(l),e.unshift(n[n.length-1]),this.gen(b.program,e,f,g,h,i),f.__path.pop(),e.shift();else this.gen(b.program,e,f,g,h,i);(!i.hold||"function"==typeof i.hold&&!i.hold(b,f,e))&&e.splice(0,e.length-j)},f.tpl=function(a,b,d,e,f,g){if(a.params&&a.params.length){g=c.extend({},g,{def:{each:[],"if":"@BOOL(2,1,true)",unless:"@BOOL(2,1,false)","with":{}}[a.path.string],hold:{each:!0,"if":function(a,b,c,d,e){return"object"==typeof e},unless:function(a,b,c,d,e){return"object"==typeof e},"with":!0,include:!1}[a.path.string]});for(var h,i=0;i-1?d.float(-Math.pow(10,10),Math.pow(10,10),1,Math.pow(10,6)):d.integer():a}()})),this.gen(b.op2,e,f,g,h,c.extend({},i,{def:function(){return"number"===b.op1.type?b.op1.value.indexOf(".")>-1?d.float(-Math.pow(10,10),Math.pow(10,10),1,Math.pow(10,6)):d.integer():a}()}))},f.relationalExpression=function(a,b,c,d,e,f){this.gen(a.op1,b,c,d,e,f),this.gen(a.op2,b,c,d,e,f)},f.equalityExpression=c.noop,f.conditionalAndExpression=c.noop,f.conditionalOrExpression=c.noop,f.string=c.noop,f.number=c.noop,f.boolean=c.noop,f.hash=function(a,b,c,d,e,f){var g,h=a.value;for(g in h)this.gen(h[g],b,c,d,e,f)},f.id=function(b,d,e,g,h,i){function j(a,b,d,e,f){var g=c.type(a[e]),h=c.type(f);return f="true"===f?!0:"false"===f?!1:f,"undefined"===g?a[e]=d-1>b&&!c.isObjectOrArray(f)?{}:c.isArray(f)&&[]||f:d-1>b&&"object"!==g&&"array"!==g?a[e]=c.isArray(f)&&[]||{}:"object"!==g&&"array"!==g&&"object"!==h&&"array"!==h&&(a[e]=f),a[e]}var k,l,m,n,o,p=d.length,q=b.parts,r=d[b.depth];for(c.isArray(r)&&(r=d[b.depth+1]),k=0,l=q.length;l>k;k++)(0!==k||"this"!==q[k])&&(/^(xindex|xcount|xkey)$/.test(q[k])||0===k&&1===l&&q[k]in g||(e.__path.push(q[k]),m=q[k],n=k===l-1?i.def!==a?i.def:d[0][m]:{},o=this.val(m,e,d,n),f.debug&&(console.log("[def ]",JSON.stringify(n)),console.log("[val ]",JSON.stringify(o))),o=j(r,k,l,m,o),c.isObjectOrArray(r[m])&&d.unshift(r=r[m])));(!i.hold||"function"==typeof i.hold&&!i.hold(b,e,d,m,o))&&d.splice(0,d.length-p)}}}.call(this)}).call(this); -//# sourceMappingURL=dist/mock-min.map diff --git a/WebContent/stat/js/core/rap.min.js b/WebContent/stat/js/core/rap.min.js deleted file mode 100644 index 6fae864..0000000 --- a/WebContent/stat/js/core/rap.min.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var rap=rap||{};(function(){rap.util=rap.util||{};var e=rap.util,t=baidu;e.escaper=e.escaper||{};e.escaper.escapeInHJ=function(e){e.replace(/\&/g,"&");e=e.replace(/\/g,">");e=e.replace(/\\/g,"\\\\");e=e.replace(/\//g,"\\/");e=e.replace(/\'/g,"\\'");e=e.replace(/\"/g,"\\"");e=e.replace(/\r/g,"\\r");e=e.replace(/\n/g,"\\n");return e};e.escaper.escapeInJ=function(e){e=e.replace(/\\/g,"\\\\");e=e.replace(/\//g,"\\/");e=e.replace(/\'/g,"\\'");e=e.replace(/\"/g,"\\"");return e};e.escaper.escapeInH=t.encodeHTML;e.escaper.escapeInU=encodeURIComponent;e.hint=function(){function s(){i=t.g("DIV_NAME");if(!i){i=document.createElement("div");i.id="tipDiv"}document.body.appendChild(i);return i}var e="tipDiv",n={},r=true,i=null;n.init=function(){var e=t.g("checkboxHintEnabled");if(e){r=e.checked}};n.bind=function(e,n){e=typeof e=="string"?t.g(e):e;if(e&&n){t.event.on(e,"mouseover",function(){rap.util.hint.show(this,n)});t.event.on(e,"mouseout",function(){rap.util.hint.hide()})}};n.show=function(t,n){if(!r)return;var o=baidu.dom.getPosition(t);var u=i?i:s();u.innerHTML=n;baidu.show(e);if(o.top+u.offsetHeight>baidu.page.getViewHeight()+baidu.page.getScrollTop()){baidu.setStyle(e,"top",baidu.page.getViewHeight()+baidu.page.getScrollTop()-u.offsetHeight)}else{baidu.setStyle(e,"top",o.top)}if(o.left+t.offsetWidth+u.offsetWidth>baidu.page.getViewWidth()){baidu.setStyle(e,"left",o.left-u.offsetWidth)}else{baidu.setStyle(e,"left",o.left+t.offsetWidth)}};n.hide=function(){if(!r)return;t.hide(i)};n.enable=function(){r=true};n.disable=function(){r=false};return n}();e.validator=function(){function e(t){if(t._sValue!==undefined){return false}t=baidu.G(t);var n=e;var r=t.getAttribute("validate")||t.name;var i=t.getAttribute("trim")!="no"?baidu.trim(t.value):t.value;var s=n._pattern(i,r,t.getAttribute("pattern"))||n._number(i,r,t.getAttribute("maxValue"),t.getAttribute("minValue"))||n._length(i,r,t.getAttribute("maxLen"),t.getAttribute("minLen"),t.getAttribute("character")!==false)||n._custom(i,r,t.getAttribute("custom"));if(s){s=t.getAttribute("message")||s;if(!t.onInvalid){var o=t.getAttribute("invalid");if(o){n=baidu.G(o);if(n){t._eMsg=n;t.onInvalid=function(e){this._eMsg.innerHTML=e};t.onValid=function(){this._eMsg.innerHTML=""}}else{t.onInvalid=window[o];t.onValid=t.onInvalid.valid}}else{t.onInvalid=function(){this._sValue=this.value;baidu.addClass(this,"invalid");this.value=s;this.onfocus=function(){baidu.removeClass(this,"invalid");var e=this._sValue;if(e!==undefined){this.value=e;this._sValue=undefined}}}}}try{t.onInvalid(s)}catch(u){}return false}t.value=i;t.onValid&&t.onValid();return true}e.ERR_SUBMIT="数据无法向服务器提交";e.AFFIRM_REMOVE="真的要删除它吗?";e.ERR_REQUIRED="#{0}不能为空";e.ERR_LEAST_LETTER="#{0}至少需要包含#{1}字节";e.ERR_MOST_LETTER="#{0}最多只能包含#{1}字节";e.ERR_LEAST_CHAR="#{0}至少需要包含#{1}字符";e.ERR_MOST_CHAR="#{0}最多只能包含#{1}字符";e.ERR_MINIMUL="#{0}必须大于#{1}";e.ERR_MAXIMUL="#{0}必须小于#{1}";e.ERR_INVAILD="#{0}无效";e.validElement=function(t){var n=t.getElementsByTagName("*");var r=true;for(var i=0,s;s=n[i];i++){var o=s.tagName.toLowerCase();if((o=="input"||o=="select"||o=="textarea")&&(s.offsetWidth||s.type=="hidden")&&!e(s)){r=false}}return r};e.validForm=function(t){var n=t.elements;var r=true;for(var i=0,s;s=n[i];i++){if((s.offsetWidth||s.type=="hidden")&&!e(s)){r=false}}return r};e._pattern=function(t,n,r){if(r&&!t.match(new RegExp("^"+r+"$"))){return baidu.format(e.ERR_INVAILD,[n])}};e._number=function(t,n,r,i){if(r||i){if(!t.match(/^[0-9]+(\.[0-9]+)?$/)){return baidu.format(e.ERR_INVAILD,[n])}else{t=parseInt(t,10);if(r!==null&&t>parseInt(r,10)){return baidu.format(e.ERR_MAXIMUL,[n,r])}if(i!==null&&tparseInt(r,10)){return s?baidu.format(e.ERR_MOST_CHAR,[n,r]):baidu.format(e.ERR_MOST_LETTER,[n,r])}if(i&&o-1;s--){var o=r[s],u=o.pageList,a=u.length;for(var f=a-1;f>-1;f--){var l=u[f],c=l.actionList,h=c.length;for(var p=h-1;p>-1;p--){var d=c[p],v=d.requestParameterList,m=v.length,g=d.responseParameterList,y=g.length;for(var b=m-1;b>-1;b--){var w=v[b];if(this.parameterAutoCompleteRecursively(w,t)){return true}}for(var b=y-1;b>-1;b--){var w=g[b];if(this.parameterAutoCompleteRecursively(w,t)){return true}}}}}};e.parameterAutoCompleteRecursively=function(n,r){if(!n||!r)return;if((n.name==r.name&&n.name!=""||n.identifier==r.identifier&&r.identifier!="")&&n.id!=r.id){var i=t.object.clone(n);e.resetAllChildParameterId(i);this.setParameterObj(r,i);return true}var s=n.parameterList;if(!s)return;var o=s.length;for(var u=o-1;u>-1;u--){if(this.parameterAutoCompleteRecursively(s[u],r))return true}};e.isActionInModule=function(t,n){var r=e.getModule(n);if(!r)return false;var i=r.pageList,s=i.length;for(var o=0;o0&&_curModuleId>0){var e=getDiv(_curModuleId,"a");if(e){_viewState.actionScrollTop=e.scrollTop;_viewState.actionScrollLeft=e.scrollLeft}var t=getDiv(_curModuleId,"tree");if(t){_viewState.moduleTreeScrollTop=t.scrollTop;_viewState.moduleTreeScrollLeft=t.scrollLeft}}}function recoverViewState(){if(_viewState.moduleId>0){if(p.getModuleList().length>1){ws.switchM(_viewState.moduleId)}if(_viewState.actionId>0&&p.isActionInModule(_viewState.actionId,_viewState.moduleId)){ws.switchA(_viewState.actionId);var e=getDiv(_curModuleId,"a");if(e){e.scrollTop=_viewState.actionScrollTop+"";e.scrollLeft=_viewState.actionScrollLeft+""}var t=getDiv(_curModuleId,"tree");if(t){t.scrollTop=_viewState.moduleTreeScrollTop;t.scrollLeft=_viewState.moduleTreeScrollLeft}}}}function isRubbishIE(){return-[1]?false:true}function putObjectIntoDeletedPool(e,t){if(!_deletedObjectList){_deletedObjectList=[]}if(e&&t){_deletedObjectList.push({className:e,id:t})}}function switchToViewModeSub(){setButtonsViewState(CONST.NORMAL);_isEditMode=false;initModules();recoverViewState()}function getWorkspaceJsonString(){return b.json.stringify(_data)}function getProjectDataJson(){return b.json.stringify(p.getData())}function getDivId(e,t){return"div-"+t+"-"+e}function getDiv(e,t){return b.g(getDivId(e,t))}function getTdId(e,t){return"td-"+t+"-"+e}function getTd(e,t){return b.g(getTdId(e,t))}function getTrId(e,t){return"tr-"+t+"-"+e}function getTr(e,t){return b.g(getTrId(e,t))}function keypressEventHandler(e){var t=b.event.getKeyCode(e);if(t==13){var n=b.object.clone(_editContext);var r=ws.finishEdit();if(e.ctrlKey&&r){var i=p.parameterAutoComplete(r);if(i){ws.switchA(_curActionId);if(n==null)return;var s=n.id;var o=p.findNextParameter(_curActionId,s);if(o>0){ws.edit(o,"param-name")}else if(p.isRequestParameter(_curActionId,s)){ws.addParam("request")}else if(p.isResponseParameter(_curActionId,s)){ws.addParam("response")}}else{ws.edit(n.id,"param-identifier")}}}else if(t==27){cancelEdit()}else if(t==9){if(e.preventDefault){e.preventDefault()}else{e.returnValue=null}switch(_editContext.key){case"param-identifier":ws.edit(_editContext.id,"param-name");break;case"param-name":var u=b.g("select-dataType-"+_editContext.id);focusElement(u);break;case"param-remark":if(_editContext==null)return;var s=_editContext.id;var o=p.findNextParameter(_curActionId,s);if(o>0){ws.edit(o,"param-name")}else if(p.isRequestParameter(_curActionId,s)){ws.addParam("request")}else if(p.isResponseParameter(_curActionId,s)){ws.addParam("response")}break}}}function renderA(){var e=b.q("js-code-area"),t=e.length,n=0;for(;n "+versionUpgrade(p.getVersion(),4);e.get("saveVSSFloater").setTitle("提交您的修改");ecFloater.show("saveVSSFloater");initRadioList("radioVersion");setSelectedValue("radioVersion",4)}function versionUpgrade(e,t){var n=e.split(".");if(n.length!=4){throw Error("error version format:"+e)}else if(!(t<=4&&t>=1)){throw Error("error version position: "+t)}var r=n[t-1];r=r-0+1;n[t-1]=r;var e="";for(var i=0;i";s.remark="@value="+e}else if(typeof a==="number"){s.dataType="array";s.remark="@value="+e}else if(typeof a==="boolean"){s.dataType="array";s.remark="@value="+e}else if(e!==null&&typeof a==="object"){s.dataType="array";for(u in o){processJSONImport(o[u],u,r?i:null,true)}}}}else if(typeof e==="string"){if(s){s.dataType="string";s.remark="@value="+e}}else if(typeof e==="number"){if(s){s.dataType="number";s.remark="@value="+e}}else if(typeof e==="boolean"){if(s){s.dataType="boolean";s.remark="@value="+e}}else if(typeof e==="undefined"){}else if(e===null){}else if(typeof e==="object"){s&&(s.dataType="object");for(u in e){processJSONImport(e[u],u,r?i:null,true)}}}function getMHtml(e){var t="";t+='
';t+=getMTreeHtml(e);t+=TEMPLATE.SEPERATOR;t+=getMTableHtml(e);t+="
";return t}function getMTreeHtml(e){var t="",n=e.pageList,r=n.length;t+='
';t+='
';t+="";for(var i=0;i';t+='";for(var a=0;a'+''+util.escaper.escapeInH(f.name)+"";if(_isEditMode){t+='    '}t+="
"}if(_isEditMode){t+=''}t+="
"}t+="";return t}function getMTableHtml(e){var t="";t+='
';t+="
";return t}function getMTHtml(e,t){var n="";n+='
'+util.escaper.escapeInH(e.name)+"
";return n}function getAHtml(e){var t="",n=e.requestParameterList,r=e.responseParameterList,i=n.length,s=r.length,o,u;t+=getAInfoHtml(e);if(i>0){t+=_isEditMode?TEMPLATE.REQUEST_BEGIN_EDIT:TEMPLATE.REQUEST_BEGIN;for(u=0;u0){t+=_isEditMode?TEMPLATE.RESPONSE_BEGIN_EDIT:TEMPLATE.RESPONSE_BEGIN;for(u=0;u",n="",r="";if(e.name){n+="
Action Name: "+e.name+"(id:"+e.id+")
"}if(e.requestType){n+="
Request Type: "+getRequestTypeStr(e.requestType)+"
"}if(e.requestUrl){n+="
Request Url: "+e.requestUrl+"
"}if(e.responseTemplate){n+="
Response Template: "+e.responseTemplate+"
"}if(e.description){n+="
Description: "+processTextarea(e.description)+"
"}if(!n){n+="no info"}return t+n+r}function processTextarea(e){var t=[],n=e.indexOf("@code")>-1,r=0;if(e.length>100){var i=n?e.replace(/(@code|@end)/gmi,""):e;var s=/@code([\s\S]*?)@end/gm;t[r++]="展开";t[r++]='
';t[r++]=i.substring(0,100);t[r++]="...
";t[r++]='";t[r++]=""}else{t[r++]=e}return t.join("")}function getRequestTypeStr(e){e=e-0;switch(e){case 1:return"get";case 2:return"post";case 3:return"get(ajax)";case 4:return"post(ajax)";default:return"unknown"}}function getPTRHtml(e,t){var n="",r=e.parameterList,i=e.parameterList&&e.parameterList.length?e.parameterList.length:0;t=t||0;n+="';n+="";if(i>0){n+="
"}n+="";if(_isEditMode){n+=getPTDHtml(e.id,'