|
@@ -347,22 +347,18 @@ $(function(){
|
|
|
}
|
|
|
var msgset = {{.T.msgset}};
|
|
|
var searchvalueIsExsit = false;
|
|
|
- if(msgset == ""){
|
|
|
- if(typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
|
|
|
+ if(typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
|
|
|
+ searchvalue = searchvalue.replace(/\s+/g,"+");
|
|
|
+ if(msgset == ""){
|
|
|
msgset = {};
|
|
|
msgset[searchtype] = {"a_key":[searchvalue],"s_scope":"A"};
|
|
|
- }
|
|
|
- }else{
|
|
|
- if (typeof(searchvalue) != "undefined" && searchvalue.length > 0 ){
|
|
|
+ }else{
|
|
|
if(typeof(msgset[searchtype]) != "undefined"){
|
|
|
var keywordes = msgset[searchtype].a_key;
|
|
|
if(typeof(keywordes) != "undefined" && keywordes.length > 0){
|
|
|
for(var i=0;i<keywordes.length;i++){
|
|
|
- var keywordesArr = keywordes[i].split("+");
|
|
|
- for(var k=0;k<keywordesArr.length;k++){
|
|
|
- if(keywordesArr[k] == searchvalue){
|
|
|
- searchvalueIsExsit = true;
|
|
|
- }
|
|
|
+ if(keywordes[i] == searchvalue){
|
|
|
+ searchvalueIsExsit = true;
|
|
|
}
|
|
|
}
|
|
|
if(!searchvalueIsExsit){
|
|
@@ -532,14 +528,8 @@ function appendKeyWord(type,value,isFocus){
|
|
|
var html='<div class="swordfish-keyword">'
|
|
|
+'<lable>关键词<font>'+index+'</font>:</lable>'
|
|
|
+'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100">'
|
|
|
- +'<img src="{{Msg "seo" "cdn"}}/images/swordfish/delete.png">'
|
|
|
- +'</div>';
|
|
|
- if (index==1){
|
|
|
- html='<div class="swordfish-keyword">'
|
|
|
- +'<lable>关键词<font>'+index+'</font>:</lable>'
|
|
|
- +'<input type="text" class="form-control" value="'+(value?value:"")+'" placeholder="示例:税务局 软件" maxlength="100">'
|
|
|
- +'</div>';
|
|
|
- }
|
|
|
+ +'<img src="{{Msg "seo" "cdn"}}/images/swordfish/delete.png"'+(index==1?' style="display: none;"':'')+'>'
|
|
|
+ +'</div>';
|
|
|
return html;
|
|
|
}
|
|
|
var obj = $("#"+type+"-keywords");
|
|
@@ -547,6 +537,9 @@ function appendKeyWord(type,value,isFocus){
|
|
|
if(count >= 10){
|
|
|
return;
|
|
|
}
|
|
|
+ if(count > 0){
|
|
|
+ obj.children(".swordfish-keyword:first").children("img").show();
|
|
|
+ }
|
|
|
if(count == 9){
|
|
|
$("#"+type+"-addkeyword").attr("disabled",true);
|
|
|
}
|
|
@@ -558,6 +551,9 @@ function appendKeyWord(type,value,isFocus){
|
|
|
obj.find(".swordfish-keyword").each(function(i){
|
|
|
$(this).children("b").children("font").text(i+1);
|
|
|
});
|
|
|
+ if(obj.children(".swordfish-keyword").length == 1){
|
|
|
+ obj.children(".swordfish-keyword:first").children("img").hide();
|
|
|
+ }
|
|
|
ajaxReq();
|
|
|
});
|
|
|
node.children("[type='text']").blur(function(){
|