From db19a1822e49e8d4907525b2302d3d38723276c9 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 18:34:48 +0800 Subject: [PATCH 01/16] add game.addGroup && lib.hook.addGroup. --- game/game.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/game/game.js b/game/game.js index e9a4ce64a..c33d9cbe5 100644 --- a/game/game.js +++ b/game/game.js @@ -154,6 +154,13 @@ extensionPack:{}, cardType:{}, hook:{globaltrigger:{},globalskill:{}}, + //函数钩子 + hooks:{ + // 本体势力的颜色 + addGroup:[(id,short,name,config)=>{ + + }], + }, hookmap:{}, imported:{}, layoutfixed:['chess','tafang','stone'], @@ -32088,6 +32095,28 @@ ], }; const game={ + //addGroup + //基于钩子的添加势力方法 + addGroup:(id,short,name,config)=>{ + if(!id) throw new TypeError(); + if(short!=null&&typeof short=="object"){ + config=short; + short=null; + } + if(name!=null&&typeof name=="object"){ + config=name; + name=null; + } + lib.group.add(id); + if(short)lib.translate[id] = short; + if(name)lib.translate[`${id}2`] = name; + for(const hook of lib.hooks.addGroup){ + if(hook!=null&&typeof hook=="function"){ + hook(id,short,name,config); + } + } + return id; + }, //Yingbian //应变 yingbianEffect:function(event,content){ From a372091dac799e061dc849b2573a7930453bc82e Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 18:54:22 +0800 Subject: [PATCH 02/16] add game.dynamicStyle --- game/game.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/game/game.js b/game/game.js index a6a909e9f..c008bdbfb 100644 --- a/game/game.js +++ b/game/game.js @@ -8245,6 +8245,7 @@ delete _status.htmlbg; window.game=game; + game.dynamicStyle.init(); // node:path library alternative if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ lib.path=window._noname_path; @@ -32157,6 +32158,19 @@ setSimpleYingbianCondition:(yingbianCondition,condition)=>game.broadcastAll((yingbianCondition,condition)=>lib.yingbian.condition.simple.set(yingbianCondition,condition),yingbianCondition,condition), setYingbianEffect:(yingbianEffect,effect)=>game.broadcastAll((yingbianEffect,effect)=>lib.yingbian.effect.set(yingbianEffect,effect),yingbianEffect,effect), setYingbianPrompt:(yingbian,prompt)=>game.broadcastAll((yingbian,prompt)=>lib.yingbian.prompt.set(yingbian,prompt),yingbian,prompt), + //动态CSS from libnodiz + dynamicStyle:{ + init:()=>{ + const that=game.dynamicStyle; + that._cache={}; + that._cache.rules=[]; + that._cache.style=document.createElement("style"); + document.head.append(that._cache.style); + that._cache.sheet = this.#style.sheet; + delete game.dynamicStyle.init; + return true; + } + }, //Add a background music to the config option //在设置选项中添加一首背景音乐 addBackgroundMusic:(link,musicName,aozhan)=>{ From 5e4d32361502ef0e11b33fab922cd360fb1231cd Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 19:00:34 +0800 Subject: [PATCH 03/16] add basic css-string-like methods. --- game/game.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index c008bdbfb..b680bbcaa 100644 --- a/game/game.js +++ b/game/game.js @@ -32166,10 +32166,18 @@ that._cache.rules=[]; that._cache.style=document.createElement("style"); document.head.append(that._cache.style); - that._cache.sheet = this.#style.sheet; + that._cache.sheet = that._cache.style.sheet; delete game.dynamicStyle.init; return true; - } + }, + translate:style=>{ + let result=[]; + for(const name in style){ + result.push(`${name.replace(/([A-Z])/g, match => `-${match.toLowerCase()}`)}: ${style[name]};`); + } + return result.join(" "); + }, + generate:(name, style)=>[`${name} {`, game.dynamicStyle.translate(style), "}"].join(" ") }, //Add a background music to the config option //在设置选项中添加一首背景音乐 From f92614c4946c565887ada3abec32bc9caee3ddc5 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 20:39:35 +0800 Subject: [PATCH 04/16] add linq.css.merge --- game/game.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/game/game.js b/game/game.js index b680bbcaa..ebd043215 100644 --- a/game/game.js +++ b/game/game.js @@ -7175,6 +7175,11 @@ generator:item=>gnc.is.generator(item) } }, + linq:{ + css:{ + merge:function(){return Array.from(arguments).join(",")} + } + }, init:{ init:function(){ if(typeof __dirname==='string'&&__dirname.length){ From d77ca4e98bea6ca6977f2b4007d1d77d7513453f Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 22:13:47 +0800 Subject: [PATCH 05/16] add css selector linq. --- game/game.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/game/game.js b/game/game.js index ebd043215..14260a993 100644 --- a/game/game.js +++ b/game/game.js @@ -7176,8 +7176,19 @@ } }, linq:{ - css:{ - merge:function(){return Array.from(arguments).join(",")} + cselector:{ + hasAttr:name=>`[${name}]`, + isAttr:(name,item)=>`[${name}=${item}]`, + inAttr:(name,item)=>`[${name}~=${item}]`, + conAttr:(name,item)=>`[${name}*=${item}]`, + onAttr:(name,item)=>`[${name}|=${item}]`, + bgnAttr:(name,item)=>`[${name}^=${item}]`, + endAttr:(name,item)=>`[${name}^=${item}]`, + merge:function(){return Array.from(arguments).join(" ");}, + concat:function(){return Array.from(arguments).join("");}, + class:function(){return `.${Array.from(arguments).join(".")}`;}, + group:function(){return Array.from(arguments).join(",");}, + media:type=>`@media ${type}` } }, init:{ @@ -32182,7 +32193,11 @@ } return result.join(" "); }, - generate:(name, style)=>[`${name} {`, game.dynamicStyle.translate(style), "}"].join(" ") + generate:(name, style)=>[`${name} {`, game.dynamicStyle.translate(style), "}"].join(" "), + has:name=>game.dynamicStyle._cache.rules.some(item=>item[0]==name), + get:name=>game.dynamicStyle.find(item=>item[0]==name), + find:fn=>game.dynamicStyle._cache.rules.find(fn), + size:()=>game.dynamicStyle._cache.rules.length }, //Add a background music to the config option //在设置选项中添加一首背景音乐 From 76aa1ae4c0ff7c248f553e06a5b169c11a61ce6a Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 22:31:54 +0800 Subject: [PATCH 06/16] add dynamicStyle.update --- game/game.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 14260a993..423ab5e79 100644 --- a/game/game.js +++ b/game/game.js @@ -32197,7 +32197,33 @@ has:name=>game.dynamicStyle._cache.rules.some(item=>item[0]==name), get:name=>game.dynamicStyle.find(item=>item[0]==name), find:fn=>game.dynamicStyle._cache.rules.find(fn), - size:()=>game.dynamicStyle._cache.rules.length + size:()=>game.dynamicStyle._cache.rules.length, + indexOf:name=>{ + for (let i=0;i{ + const that=game.dynamicStyle; + try{ + if(this.has(name)){ + const index=that.indexOf(name); + that._cache.sheet.deleteRule(index); + that._cache.sheet.insertRule(that.generate(name, style), index); + that._cache.rules[index] = [name, style]; + }else{ + const index=that._cache.rules.length; + that._cache.rules.push([name, style]); + that._cache.sheet.insertRule(that.generate(name, style), index); + } + return true; + } + catch(e){ + console.log(e); + return false; + } + } }, //Add a background music to the config option //在设置选项中添加一首背景音乐 From 41a06fc4a4878532b2dd27d74165755b6a80206c Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 22:35:43 +0800 Subject: [PATCH 07/16] add dynamicStyle id. --- game/game.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/game/game.js b/game/game.js index 423ab5e79..0cf47dcff 100644 --- a/game/game.js +++ b/game/game.js @@ -2277,6 +2277,7 @@ ui.css.border_stylesheet.remove(); } ui.css.border_stylesheet=lib.init.sheet(); + ui.css.border_stylesheet.id="ui.css.border"; ui.css.border_stylesheet.sheet.insertRule('#window .player>.framebg{display:block;background-image:url("'+fileLoadedEvent.target.result+'")}',0); ui.css.border_stylesheet.sheet.insertRule('.player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}',0); }; @@ -32181,6 +32182,7 @@ that._cache={}; that._cache.rules=[]; that._cache.style=document.createElement("style"); + that._cache.style.id="game.dynamicStyle"; document.head.append(that._cache.style); that._cache.sheet = that._cache.style.sheet; delete game.dynamicStyle.init; From 1ff9beb778c5d31c7ece1d0430e6ec57110782d0 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 22:43:15 +0800 Subject: [PATCH 08/16] add modify functions. --- game/game.js | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/game/game.js b/game/game.js index 0cf47dcff..f0abbf755 100644 --- a/game/game.js +++ b/game/game.js @@ -32197,7 +32197,7 @@ }, generate:(name, style)=>[`${name} {`, game.dynamicStyle.translate(style), "}"].join(" "), has:name=>game.dynamicStyle._cache.rules.some(item=>item[0]==name), - get:name=>game.dynamicStyle.find(item=>item[0]==name), + get:name=>game.dynamicStyle.find(item=>item[0]==name)[1], find:fn=>game.dynamicStyle._cache.rules.find(fn), size:()=>game.dynamicStyle._cache.rules.length, indexOf:name=>{ @@ -32206,18 +32206,38 @@ } return -1; }, + add:(name,style)=>{ + const that=game.dynamicStyle; + return that.update(name,that.has(name)?Object.assign({},that.get(name),style):style); + }, + addObject:object=>{ + const that=game.dynamicStyle; + let result=[]; + for(const name in object){ + result.push(that.add(name, object[name])); + } + return result; + }, + remove:name=>{ + const that=game.dynamicStyle; + if(!that.has(name)) return false; + const index=that.indexOf(name); + that._cache.rules.splice(index,1); + that._cache.sheet.deleteRule(index); + return true; + }, update:(name,style)=>{ const that=game.dynamicStyle; try{ - if(this.has(name)){ + if(that.has(name)){ const index=that.indexOf(name); that._cache.sheet.deleteRule(index); - that._cache.sheet.insertRule(that.generate(name, style), index); + that._cache.sheet.insertRule(that.generate(name,style),index); that._cache.rules[index] = [name, style]; }else{ const index=that._cache.rules.length; - that._cache.rules.push([name, style]); - that._cache.sheet.insertRule(that.generate(name, style), index); + that._cache.rules.push([name,style]); + that._cache.sheet.insertRule(that.generate(name,style),index); } return true; } From 8108635342ff7f59992bcdde28d2e4103de2e18b Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 23:00:55 +0800 Subject: [PATCH 09/16] complete dynamicStyle && addGroup. --- game/game.js | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/game/game.js b/game/game.js index f0abbf755..1f31c8a7b 100644 --- a/game/game.js +++ b/game/game.js @@ -157,8 +157,94 @@ //函数钩子 hooks:{ // 本体势力的颜色 - addGroup:[(id,short,name,config)=>{ - + addGroup:[(id,_short,_name,config)=>{ + if("color" in config&&config.color!=null){ + let color1,color2,color3,color4; + if (typeof config.color=="string"&&/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(config.color)){ + let c1=parseInt(`0x${item[1].slice(1, 3)}`); + let c2=parseInt(`0x${item[1].slice(3, 5)}`); + let c3=parseInt(`0x${item[1].slice(5, 7)}`); + color1=color2=color3=color4=[c1,c2,c3,1]; + } + else if(Array.isArray(config.color)&&config.color.length==4){ + if(config.color.every(item=>Array.isArray(item))){ + color1=config.color[0]; + color2=config.color[1]; + color3=config.color[2]; + color4=config.color[3]; + } + else color1=color2=color3=color4=config.color; + } + if(color1&&color2&&color3&&color4){ + const cs=lib.linq.cselector; + const g1=cs.group( + cs.concat( + cs.class("player","identity"), + cs.isAttr("data-color",id) + ), + cs.concat( + "div", + cs.isAttr("data-nature",id) + ), + cs.concat( + "span", + cs.isAttr("data-nature",id) + ) + ); + const g2=cs.group( + cs.concat( + "div", + cs.isAttr("data-nature",`${id}m`) + ), + cs.concat( + "span", + cs.isAttr("data-nature",`${id}m`) + ) + ); + const g3=cs.group( + cs.concat( + "div", + cs.isAttr("data-nature",`${id}mm`) + ), + cs.concat( + "span", + cs.isAttr("data-nature",`${id}mm`) + ) + ); + game.dynamicStyle.addObject({ + g1:{ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 5px`, + `rgba(${color3.join()}) 0 0 10px`, + `rgba(${color4.join()}) 0 0 10px` + ) + }, + g2:{ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 5px`, + `rgba(${color3.join()}) 0 0 5px`, + `rgba(${color4.join()}) 0 0 5px`, + "black 0 0 1px" + ) + }, + g3:{ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 2px`, + `rgba(${color3.join()}) 0 0 2px`, + `rgba(${color4.join()}) 0 0 2px`, + "black 0 0 1px" + ) + } + }); + lib.groupnature[id]=id; + } + } }], }, hookmap:{}, @@ -32145,6 +32231,9 @@ config=short; short=null; } + if(name!=null&&typeof name=="string"&&short){ + name=short; + } if(name!=null&&typeof name=="object"){ config=name; name=null; From 598beb4696abacc940436374919969ad099449b3 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 23:08:37 +0800 Subject: [PATCH 10/16] fix bug. --- game/game.js | 76 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/game/game.js b/game/game.js index 1f31c8a7b..ca7caf84f 100644 --- a/game/game.js +++ b/game/game.js @@ -180,68 +180,68 @@ const g1=cs.group( cs.concat( cs.class("player","identity"), - cs.isAttr("data-color",id) + cs.isAttr("data-color",`"${id}"`) ), cs.concat( "div", - cs.isAttr("data-nature",id) + cs.isAttr("data-nature",`"${id}"`) ), cs.concat( "span", - cs.isAttr("data-nature",id) + cs.isAttr("data-nature",`"${id}"`) ) ); const g2=cs.group( cs.concat( "div", - cs.isAttr("data-nature",`${id}m`) + cs.isAttr("data-nature",`"${id}m"`) ), cs.concat( "span", - cs.isAttr("data-nature",`${id}m`) + cs.isAttr("data-nature",`"${id}m"`) ) ); const g3=cs.group( cs.concat( "div", - cs.isAttr("data-nature",`${id}mm`) + cs.isAttr("data-nature",`"${id}mm"`) ), cs.concat( "span", - cs.isAttr("data-nature",`${id}mm`) + cs.isAttr("data-nature",`"${id}mm"`) ) ); - game.dynamicStyle.addObject({ - g1:{ - textShadow:cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 5px`, - `rgba(${color3.join()}) 0 0 10px`, - `rgba(${color4.join()}) 0 0 10px` - ) - }, - g2:{ - textShadow:cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 5px`, - `rgba(${color3.join()}) 0 0 5px`, - `rgba(${color4.join()}) 0 0 5px`, - "black 0 0 1px" - ) - }, - g3:{ - textShadow:cs.group( - "black 0 0 1px", - `rgba(${color1.join()}) 0 0 2px`, - `rgba(${color2.join()}) 0 0 2px`, - `rgba(${color3.join()}) 0 0 2px`, - `rgba(${color4.join()}) 0 0 2px`, - "black 0 0 1px" - ) - } - }); + let result={}; + result[g1]={ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 5px`, + `rgba(${color3.join()}) 0 0 10px`, + `rgba(${color4.join()}) 0 0 10px` + ) + }; + result[g2]={ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 5px`, + `rgba(${color3.join()}) 0 0 5px`, + `rgba(${color4.join()}) 0 0 5px`, + "black 0 0 1px" + ) + }; + result[g3]={ + textShadow:cs.group( + "black 0 0 1px", + `rgba(${color1.join()}) 0 0 2px`, + `rgba(${color2.join()}) 0 0 2px`, + `rgba(${color3.join()}) 0 0 2px`, + `rgba(${color4.join()}) 0 0 2px`, + "black 0 0 1px" + ) + }; + game.dynamicStyle.addObject(result); lib.groupnature[id]=id; } } From a9d10ba774d0f61f32268c7ee84a5f80b5c7ddd4 Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 23:15:25 +0800 Subject: [PATCH 11/16] fix compatibility. --- game/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index ca7caf84f..b5c8f8d87 100644 --- a/game/game.js +++ b/game/game.js @@ -32272,7 +32272,7 @@ that._cache.rules=[]; that._cache.style=document.createElement("style"); that._cache.style.id="game.dynamicStyle"; - document.head.append(that._cache.style); + document.head.appendChild(that._cache.style); that._cache.sheet = that._cache.style.sheet; delete game.dynamicStyle.init; return true; From 805848568da545e398699b6fae9c0ab3d31b074f Mon Sep 17 00:00:00 2001 From: Rintim Date: Thu, 7 Sep 2023 23:23:54 +0800 Subject: [PATCH 12/16] give time for extension to add hook. --- game/game.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/game/game.js b/game/game.js index b5c8f8d87..eafb3c033 100644 --- a/game/game.js +++ b/game/game.js @@ -32241,11 +32241,13 @@ lib.group.add(id); if(short)lib.translate[id] = short; if(name)lib.translate[`${id}2`] = name; - for(const hook of lib.hooks.addGroup){ - if(hook!=null&&typeof hook=="function"){ - hook(id,short,name,config); + lib.onload.add(()=>{ + for(const hook of lib.hooks.addGroup){ + if(hook!=null&&typeof hook=="function"){ + hook(id,short,name,config); + } } - } + }) return id; }, //Yingbian From c0df93477587fc5673ce3b82255de73ee42ab015 Mon Sep 17 00:00:00 2001 From: Rintim Date: Fri, 8 Sep 2023 01:59:13 +0800 Subject: [PATCH 13/16] add methods. --- game/game.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/game/game.js b/game/game.js index eafb3c033..2a413ec0c 100644 --- a/game/game.js +++ b/game/game.js @@ -7262,6 +7262,29 @@ generator:item=>gnc.is.generator(item) } }, + comparator:{ + e:function(){ + if(arguments.length<=1) return true; + for(let i=1;i`[${name}]`, @@ -8349,6 +8372,26 @@ window.game=game; game.dynamicStyle.init(); + Object.defineProperty(lib.creation,"a",{ + enumerable:true, + get:()=>[], + set:()=>null + }); + Object.defineProperty(lib.creation,"o",{ + enumerable:true, + get:()=>({}), + set:()=>null + }); + Object.defineProperty(lib.creation,"no",{ + enumerable:true, + get:()=>Object.create(null), + set:()=>null + }); + Object.defineProperty(lib.creation,"s",{ + enumerable:true, + get:()=>"", + set:()=>null + }); // node:path library alternative if (typeof module!="object"||typeof module.exports!="object") lib.init.js(`${lib.assetURL}game`,"path.min",()=>{ lib.path=window._noname_path; @@ -32221,6 +32264,10 @@ '哥哥,交个朋友吧', '妹子,交个朋友吧', ], + other:{ + bool:(item)=>Boolean(item), + ignore:()=>{} + } }; const game={ //addGroup From ebb0b1b15dc15430cb0d7e559d58a707710efbcd Mon Sep 17 00:00:00 2001 From: Rintim Date: Fri, 8 Sep 2023 02:00:36 +0800 Subject: [PATCH 14/16] bugfix. --- game/game.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/game.js b/game/game.js index 2a413ec0c..69d35fc3f 100644 --- a/game/game.js +++ b/game/game.js @@ -32278,13 +32278,13 @@ config=short; short=null; } - if(name!=null&&typeof name=="string"&&short){ - name=short; - } if(name!=null&&typeof name=="object"){ config=name; name=null; } + if((name==null&&typeof name!="string")||short){ + name=short; + } lib.group.add(id); if(short)lib.translate[id] = short; if(name)lib.translate[`${id}2`] = name; From e4e31603b5ed930b26f768bcd379a9c58b873698 Mon Sep 17 00:00:00 2001 From: Rintim Date: Fri, 8 Sep 2023 02:01:05 +0800 Subject: [PATCH 15/16] bugfix2 --- game/game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/game.js b/game/game.js index 69d35fc3f..787fee50a 100644 --- a/game/game.js +++ b/game/game.js @@ -32282,7 +32282,7 @@ config=name; name=null; } - if((name==null&&typeof name!="string")||short){ + if((name==null||typeof name!="string")&&short){ name=short; } lib.group.add(id); From ed611433c1b5970840ee479218bb451e49504e94 Mon Sep 17 00:00:00 2001 From: Rintim Date: Fri, 8 Sep 2023 02:08:54 +0800 Subject: [PATCH 16/16] purifid --- game/game.js | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/game/game.js b/game/game.js index 787fee50a..5c8ae758e 100644 --- a/game/game.js +++ b/game/game.js @@ -7264,24 +7264,35 @@ }, comparator:{ e:function(){ - if(arguments.length<=1) return true; + if(arguments.length==0) return false; + if(arguments.length==1) return true; for(let i=1;i{ if(!id) throw new TypeError(); - if(short!=null&&typeof short=="object"){ + if(lib.comparator.te(short,"object")){ config=short; short=null; } - if(name!=null&&typeof name=="object"){ + if(lib.comparator.te(name,"object")){ config=name; name=null; } - if((name==null||typeof name!="string")&&short){ + if(!lib.comparator.te(short,"string")&&short){ name=short; } lib.group.add(id);