updated bug修复
This commit is contained in:
parent
8081fc40ee
commit
3ef487c7b0
14
dist/relationship.js
vendored
14
dist/relationship.js
vendored
@ -1990,9 +1990,13 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
var mid_sex = 0;
|
||||
if(to_arr[i-1].match(/([fhs1](&[ol])?|[olx]b)$/)){
|
||||
mid_sex=1;
|
||||
var mid_sex = -1;
|
||||
if(to_arr[i-1]){
|
||||
if(to_arr[i-1].match(/([fhs1](&[ol])?|[olx]b)$/)){
|
||||
mid_sex=1;
|
||||
}else{
|
||||
mid_sex=0;
|
||||
}
|
||||
}
|
||||
var sex = -1;
|
||||
if(to){
|
||||
@ -2005,6 +2009,8 @@
|
||||
if(i){
|
||||
var from_sub = from_arr.slice(i).join(',');
|
||||
var to_sub = to_arr.slice(i).join(',');
|
||||
|
||||
console.log('#from_sub#',mid_sex,from_sub,to_sub,reverseId(to_sub,mid_sex));
|
||||
return {
|
||||
'selector':(to_sub?','+reverseId(to_sub,mid_sex):'')+(from_sub?','+from_sub:''),
|
||||
'sex':sex
|
||||
@ -2033,7 +2039,7 @@
|
||||
from_selectors.forEach(function(from){
|
||||
to_selectors.forEach(function(to){
|
||||
var data = mergeSelector(from,to);
|
||||
// console.log('#data#',data);
|
||||
console.log('#data#',data);
|
||||
sex = data['sex']>-1?data['sex']:options.sex;
|
||||
var ids = selector2id(data['selector'],sex);
|
||||
// console.log('[ids]',ids);
|
||||
|
3
dist/relationship.min.js
vendored
3
dist/relationship.min.js
vendored
File diff suppressed because one or more lines are too long
46
index.html
46
index.html
@ -17,7 +17,7 @@
|
||||
<script type="text/javascript">
|
||||
setTimeout(function(){
|
||||
if(location.hostname.indexOf('passer-by.com')<0){
|
||||
location.href = 'http://passer-by.com/';
|
||||
//location.href = 'http://passer-by.com/';
|
||||
}else if( window.top != window.self ) {
|
||||
window.top.location = self.location.href;
|
||||
}
|
||||
@ -117,6 +117,17 @@
|
||||
<p>计算结果:</p>
|
||||
<p><textarea name="result" readonly></textarea></p>
|
||||
</div>
|
||||
<div class="intro">
|
||||
<h3>使用案例</h3>
|
||||
<p class="q">1. 使用别称查询:</p>
|
||||
<p class="a">姥姥的爸爸的老窦 / 娘子的爹地的母亲 / 岳丈的妈咪</p>
|
||||
<p class="q">2. 使用合称查询:</p>
|
||||
<p class="a">舅舅的孙辈 / 爸爸的祖父母 / 姑妈的兄弟姐妹</p>
|
||||
<p class="q">3. 大小数字混合查询:</p>
|
||||
<p class="a">儿子的大舅的二姑妈的七舅姥爷</p>
|
||||
<p class="q">4. 不限制方向祖辈孙辈跨度,反复查询:</p>
|
||||
<p class="a">舅妈的婆婆的外甥的姨妈的侄子的爷爷</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="c-panel">
|
||||
<div class="row">
|
||||
@ -135,12 +146,19 @@
|
||||
<p>计算结果:</p>
|
||||
<p><textarea name="result" readonly></textarea></p>
|
||||
</div>
|
||||
<div class="intro">
|
||||
<h3>应用场景</h3>
|
||||
<p class="q">“七舅姥爷”和我是什么关系?</p>
|
||||
<p class="q">“姑表舅表哥”和我是什么关系?</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="c-panel">
|
||||
<div class="row">
|
||||
<div class="field">
|
||||
<input class="input-text" type="text" name="person" placeholder="输入称呼"/>
|
||||
<input class="input-text" type="text" name="person" placeholder="输入要查询的称呼"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="field">
|
||||
称呼方式:
|
||||
<label for="field-3-1">
|
||||
@ -152,8 +170,10 @@
|
||||
<span>后者称呼前者</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="field">
|
||||
<input class="input-text" type="text" name="target" placeholder="输入称呼"/>
|
||||
<input class="input-text" type="text" name="target" placeholder="输入要查询的称呼"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation">
|
||||
@ -166,28 +186,20 @@
|
||||
<p>计算结果:</p>
|
||||
<p><textarea name="result" readonly></textarea></p>
|
||||
</div>
|
||||
<div class="intro">
|
||||
<h3>应用场景</h3>
|
||||
<p class="q">外舅公是我妈的谁?</p>
|
||||
<p class="q">我爸应该叫舅老爷什么?</p>
|
||||
<p class="q">我岳父应该叫我弟弟什么?</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="c-ft">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ft">
|
||||
<div class="intro">
|
||||
<p>由于工作生活节奏不同,如今很多关系稍疏远的亲戚之间来往并不多。因此放假回家过年时,往往会搞不清楚哪位亲戚应该喊什么称呼,很是尴尬。然而搞不清亲戚关系和亲戚称谓的不仅是小孩,就连年轻一代的大人也都常常模糊混乱。</p>
|
||||
<p>“中国亲戚关系计算器”为你避免了这种尴尬,只需简单的输入即可算出称谓。输入框兼容了不同的叫法,你可以称呼父亲为:“老爸”、“爹地”、“老爷子”等等,方面不同地域的习惯叫法。</p>
|
||||
</div>
|
||||
<div class="intro">
|
||||
<h3>使用案例</h3>
|
||||
<p class="q">1. 使用别称查询:</p>
|
||||
<p class="a">姥姥的爸爸的老窦 / 娘子的爹地的母亲 / 岳丈的妈咪</p>
|
||||
<p class="q">2. 使用合称查询:</p>
|
||||
<p class="a">舅舅的孙辈 / 爸爸的祖父母 / 姑妈的兄弟姐妹</p>
|
||||
<p class="q">3. 大小数字混合查询:</p>
|
||||
<p class="a">儿子的大舅的二姑妈的七舅姥爷</p>
|
||||
<p class="q">4. 不限制方向祖辈孙辈跨度,反复查询:</p>
|
||||
<p class="a">舅妈的婆婆的外甥的姨妈的侄子的爷爷</p>
|
||||
</div>
|
||||
<div class="copy">
|
||||
<p><a class="github-button" href="https://github.com/mumuy" data-style="mega" data-count-href="/mumuy/followers" data-count-api="/users/mumuy#followers" data-count-aria-label="# followers on GitHub" aria-label="Follow @mumuy on GitHub" rel="nofollow">Follow @mumuy</a>
|
||||
<a class="github-button" href="https://github.com/mumuy/relationship" data-style="mega" data-count-href="/mumuy/relationship/stargazers" data-count-api="/repos/mumuy/relationship#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star mumuy/relationship on GitHub" rel="nofollow">Star</a></p>
|
||||
|
@ -1990,9 +1990,13 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
var mid_sex = 0;
|
||||
if(to_arr[i-1].match(/([fhs1](&[ol])?|[olx]b)$/)){
|
||||
mid_sex=1;
|
||||
var mid_sex = -1;
|
||||
if(to_arr[i-1]){
|
||||
if(to_arr[i-1].match(/([fhs1](&[ol])?|[olx]b)$/)){
|
||||
mid_sex=1;
|
||||
}else{
|
||||
mid_sex=0;
|
||||
}
|
||||
}
|
||||
var sex = -1;
|
||||
if(to){
|
||||
@ -2005,6 +2009,8 @@
|
||||
if(i){
|
||||
var from_sub = from_arr.slice(i).join(',');
|
||||
var to_sub = to_arr.slice(i).join(',');
|
||||
|
||||
console.log('#from_sub#',mid_sex,from_sub,to_sub,reverseId(to_sub,mid_sex));
|
||||
return {
|
||||
'selector':(to_sub?','+reverseId(to_sub,mid_sex):'')+(from_sub?','+from_sub:''),
|
||||
'sex':sex
|
||||
@ -2033,7 +2039,7 @@
|
||||
from_selectors.forEach(function(from){
|
||||
to_selectors.forEach(function(to){
|
||||
var data = mergeSelector(from,to);
|
||||
// console.log('#data#',data);
|
||||
console.log('#data#',data);
|
||||
sex = data['sex']>-1?data['sex']:options.sex;
|
||||
var ids = selector2id(data['selector'],sex);
|
||||
// console.log('[ids]',ids);
|
||||
|
@ -222,7 +222,7 @@ a:hover{
|
||||
margin-right: 10px;
|
||||
}
|
||||
.mod-panel .ft{
|
||||
padding-top: 20px;
|
||||
padding-top: 10px;
|
||||
border-top:1px dotted #e0e0e0;
|
||||
}
|
||||
.mod-panel .about{
|
||||
@ -243,7 +243,7 @@ a:hover{
|
||||
}
|
||||
.mod-panel .intro{
|
||||
padding: 15px 20px;
|
||||
margin-bottom: 15px;
|
||||
margin: 15px 0;
|
||||
background: #f5f5f6;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user