|
@@ -106,121 +106,124 @@ $(function(){
|
|
|
for(var i in keys){
|
|
|
var append = keys[i].appended;
|
|
|
var exclude = keys[i].exclude;
|
|
|
- keys[i].keyWord = keyWord;
|
|
|
- // if(keys[i].keyWord === keyWord){
|
|
|
- keyWordArr.push(keys[i]);
|
|
|
- localStorage.setItem("keyWord", JSON.stringify(keyWordArr));
|
|
|
- //
|
|
|
- if(append !== undefined && exclude === undefined){
|
|
|
- keyWordHtml += `
|
|
|
- <li>
|
|
|
- <div class="one">
|
|
|
- <div>
|
|
|
- <span>
|
|
|
- <strong> 关键词:</strong>
|
|
|
- <p class="key">${ keys[i].keyWord }</p>
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- <strong> 附加词:</strong>
|
|
|
- <p class="addition">${ append }</p>
|
|
|
- </span>
|
|
|
+ // keys[i].keyWord = keyWord;
|
|
|
+ if(keys[i].keyWord === turn){
|
|
|
+ if(keyWord !== turn){
|
|
|
+ keys[i].keyWord = keyWord
|
|
|
+ }
|
|
|
+ keyWordArr.push(keys[i]);
|
|
|
+ localStorage.setItem("keyWord", JSON.stringify(keyWordArr));
|
|
|
+ //
|
|
|
+ if(append !== undefined && exclude === undefined){
|
|
|
+ keyWordHtml += `
|
|
|
+ <li>
|
|
|
+ <div class="one">
|
|
|
+ <div>
|
|
|
+ <span>
|
|
|
+ <strong> 关键词:</strong>
|
|
|
+ <p class="key">${ keys[i].keyWord }</p>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <strong> 附加词:</strong>
|
|
|
+ <p class="addition">${ append }</p>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
</div>
|
|
|
- <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
- </div>
|
|
|
- <div class="modify">
|
|
|
- <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
- <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
- <button class="addExclusion">添加 排除词</button>
|
|
|
- <button class="deleteKey">删除</button>
|
|
|
- <button class="ascertainKey">确定</button>
|
|
|
- </div>
|
|
|
- </li>`;
|
|
|
- }else if(append === undefined && exclude !== undefined){
|
|
|
- keyWordHtml += `
|
|
|
- <li>
|
|
|
- <div class="one">
|
|
|
- <div>
|
|
|
- <span>
|
|
|
- <strong> 关键词:</strong>
|
|
|
- <p class="key">${ keys[i].keyWord }</p>
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- <strong> 排除词:</strong>
|
|
|
- <p class="exclusion">${ exclude }</p>
|
|
|
- </span>
|
|
|
+ <div class="modify">
|
|
|
+ <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
+ <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
+ <button class="addExclusion">添加 排除词</button>
|
|
|
+ <button class="deleteKey">删除</button>
|
|
|
+ <button class="ascertainKey">确定</button>
|
|
|
</div>
|
|
|
- <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
- </div>
|
|
|
- <div class="modify">
|
|
|
- <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
- <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
- <button class="addExclusion">添加 排除词</button>
|
|
|
- <button class="deleteKey">删除</button>
|
|
|
- <button class="ascertainKey">确定</button>
|
|
|
- </div>
|
|
|
- </li>`;
|
|
|
- }else if(append !== undefined && exclude !== undefined){
|
|
|
- keyWordHtml += `
|
|
|
- <li>
|
|
|
- <div class="one">
|
|
|
- <div>
|
|
|
- <span>
|
|
|
- <strong> 关键词:</strong>
|
|
|
- <p class="key">${ keys[i].keyWord }</p>
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- <strong> 附加词:</strong>
|
|
|
- <p class="addition">${ append }</p>
|
|
|
- </span>
|
|
|
- <span>
|
|
|
- <strong> 排除词:</strong>
|
|
|
- <p class="exclusion">${ exclude }</p>
|
|
|
- </span>
|
|
|
+ </li>`;
|
|
|
+ }else if(append === undefined && exclude !== undefined){
|
|
|
+ keyWordHtml += `
|
|
|
+ <li>
|
|
|
+ <div class="one">
|
|
|
+ <div>
|
|
|
+ <span>
|
|
|
+ <strong> 关键词:</strong>
|
|
|
+ <p class="key">${ keys[i].keyWord }</p>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <strong> 排除词:</strong>
|
|
|
+ <p class="exclusion">${ exclude }</p>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
</div>
|
|
|
- <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
- </div>
|
|
|
- <div class="modify">
|
|
|
- <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
- <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
- <button class="addExclusion">添加 排除词</button>
|
|
|
- <button class="deleteKey">删除</button>
|
|
|
- <button class="ascertainKey">确定</button>
|
|
|
- </div>
|
|
|
- </li>`;
|
|
|
- }else if(append === undefined && exclude === undefined){
|
|
|
- keyWordHtml += `
|
|
|
- <li>
|
|
|
- <div class="one">
|
|
|
- <div>
|
|
|
- <span>
|
|
|
- <strong> 关键词:</strong>
|
|
|
- <p class="key">${ keys[i].keyWord }</p>
|
|
|
- </span>
|
|
|
+ <div class="modify">
|
|
|
+ <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
+ <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
+ <button class="addExclusion">添加 排除词</button>
|
|
|
+ <button class="deleteKey">删除</button>
|
|
|
+ <button class="ascertainKey">确定</button>
|
|
|
</div>
|
|
|
- <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
- </div>
|
|
|
- <div class="modify">
|
|
|
- <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
- <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
- <button class="addExclusion">添加 排除词</button>
|
|
|
- <button class="deleteKey">删除</button>
|
|
|
- <button class="ascertainKey">确定</button>
|
|
|
- </div>
|
|
|
- </li>`;
|
|
|
+ </li>`;
|
|
|
+ }else if(append !== undefined && exclude !== undefined){
|
|
|
+ keyWordHtml += `
|
|
|
+ <li>
|
|
|
+ <div class="one">
|
|
|
+ <div>
|
|
|
+ <span>
|
|
|
+ <strong> 关键词:</strong>
|
|
|
+ <p class="key">${ keys[i].keyWord }</p>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <strong> 附加词:</strong>
|
|
|
+ <p class="addition">${ append }</p>
|
|
|
+ </span>
|
|
|
+ <span>
|
|
|
+ <strong> 排除词:</strong>
|
|
|
+ <p class="exclusion">${ exclude }</p>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
+ </div>
|
|
|
+ <div class="modify">
|
|
|
+ <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
+ <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
+ <button class="addExclusion">添加 排除词</button>
|
|
|
+ <button class="deleteKey">删除</button>
|
|
|
+ <button class="ascertainKey">确定</button>
|
|
|
+ </div>
|
|
|
+ </li>`;
|
|
|
+ }else if(append === undefined && exclude === undefined){
|
|
|
+ keyWordHtml += `
|
|
|
+ <li>
|
|
|
+ <div class="one">
|
|
|
+ <div>
|
|
|
+ <span>
|
|
|
+ <strong> 关键词:</strong>
|
|
|
+ <p class="key">${ keys[i].keyWord }</p>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <button class="editKeyWord"><i class="iconfont icon-xiugai"></i> 修改</button>
|
|
|
+ </div>
|
|
|
+ <div class="modify">
|
|
|
+ <textarea name="" rows="1" placeholder="" maxlength="">${ keys[i].keyWord}</textarea>
|
|
|
+ <button class="addAdjunctWord">编辑 附加词</button>
|
|
|
+ <button class="addExclusion">添加 排除词</button>
|
|
|
+ <button class="deleteKey">删除</button>
|
|
|
+ <button class="ascertainKey">确定</button>
|
|
|
+ </div>
|
|
|
+ </li>`;
|
|
|
+ }
|
|
|
+ keyWordHtml = keyWordHtml.replace(/,/g, " ");
|
|
|
+ //
|
|
|
+ $('.showKeyWord > ul').prepend(keyWordHtml);
|
|
|
+ // 隐藏
|
|
|
+ $(".enter.addkeyWord").hide();
|
|
|
+ $(".showKeyWord").show();
|
|
|
+ $(".addKeyWord").show();
|
|
|
+ $('.enter.addkeyWord > input').val('');
|
|
|
+ var buttonDOM = $('.enter.addkeyWord .btn button')[0];
|
|
|
+ buttonDOM.style.opacity = .5;
|
|
|
+ buttonDOM.setAttribute("disabled", true);
|
|
|
+ return
|
|
|
}
|
|
|
- keyWordHtml = keyWordHtml.replace(/,/g, " ");
|
|
|
- //
|
|
|
- $('.showKeyWord > ul').prepend(keyWordHtml);
|
|
|
- // 隐藏
|
|
|
- $(".enter.addkeyWord").hide();
|
|
|
- $(".showKeyWord").show();
|
|
|
- $(".addKeyWord").show();
|
|
|
- $('.enter.addkeyWord > input').val('');
|
|
|
- var buttonDOM = $('.enter.addkeyWord .btn button')[0];
|
|
|
- buttonDOM.style.opacity = .5;
|
|
|
- buttonDOM.setAttribute("disabled", true);
|
|
|
- return
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
var Obj = {"keyWord": keyWord};
|