| @@ -376,7 +376,7 @@ function getTaskDesc(isZh,key){ | |||
| function getActiveItem(sort_type){ | |||
| console.log("currentSearchSortBy=" + currentSearchSortBy + " sort_type=" + sortBy[sort_type]); | |||
| if(currentSearchSortBy == sortBy[sort_type]){ | |||
| if(currentSearchSortBy == sortBy[sort_type] && currentSearchAscending == sortAscending[sort_type]){ | |||
| return "active "; | |||
| }else{ | |||
| return ""; | |||
| @@ -554,23 +554,23 @@ func truncLongText(text string, isNeedToDealText bool) string { | |||
| if end >= stringlen { | |||
| end = stringlen | |||
| } | |||
| return string(trimFontHtml(textRune[start:end])) + "..." | |||
| return trimFontHtml(textRune[start:end]) + "..." | |||
| } else { | |||
| return string(trimFontHtml(textRune[0:200])) + "..." | |||
| return trimFontHtml(textRune[0:200]) + "..." | |||
| } | |||
| } else { | |||
| if stringlen > 200 { | |||
| return string(trimFontHtml(textRune[0:200])) + "..." | |||
| return trimFontHtml(textRune[0:200]) + "..." | |||
| } else { | |||
| return text | |||
| } | |||
| } | |||
| } | |||
| func trimFontHtml(text []rune) []rune { | |||
| func trimFontHtml(text []rune) string { | |||
| startRune := rune('<') | |||
| endRune := rune('>') | |||
| count := 0 | |||
| for i := 0; i < len(text); i++ { | |||
| if text[i] == startRune { //start < | |||
| re := false | |||
| @@ -583,12 +583,18 @@ func trimFontHtml(text []rune) []rune { | |||
| } | |||
| if re { //found > | |||
| i = j | |||
| count++ | |||
| } else { | |||
| return text[0:i] | |||
| if count%2 == 1 { | |||
| return string(text[0:i]) + "</font>" | |||
| } else { | |||
| return string(text[0:i]) | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return text | |||
| return string(text) | |||
| } | |||
| func trimHrefHtml(result string) string { | |||
| @@ -97,7 +97,7 @@ | |||
| <div class="right stackable menu"> | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="hot"> | |||
| @@ -201,7 +201,7 @@ | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="hot"> | |||
| @@ -95,7 +95,7 @@ | |||
| <div class="right stackable menu"> | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="{{$.SortType}}"> | |||
| @@ -198,7 +198,7 @@ | |||
| <div class="right stackable menu"> | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="{{$.SortType}}"> | |||
| @@ -98,7 +98,7 @@ | |||
| <div class="right stackable menu"> | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="{{$.SortType}}"> | |||
| @@ -201,7 +201,7 @@ | |||
| <div class="right stackable menu"> | |||
| <form id="searchForm" class="fourteen wide mobile ten wide tablet ten wide computer column ui form ignore-dirty" style="margin:auto" action="/all/search/" method="post"> | |||
| <div class="ui fluid action input" style="background:#363840 ;border-radius: 5px;width: 200px;height:30px;border: #888888 solid 1px;"> | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search_pro"}}..." | |||
| <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." | |||
| style="transition: background-color 5000s ease-in-out 0s;-webkit-text-fill-color:#888888;background:#363840 ;color:#888888;border: none;outline: none;"> | |||
| <input type="hidden" name="tab" value="{{$.TabName}}"> | |||
| <input type="hidden" name="sort" value="{{$.SortType}}"> | |||