Changeset 46196
- Timestamp:
- 06/05/06 11:02:10 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
CPS3/products/CPSPortlets/trunk/CHANGES
r46190 r46196 7 7 Bug fixes: 8 8 ~~~~~~~~~~ 9 - Fixed #1653: Search box always clearing text. 9 10 - Made the search portlet more accessible through the use of a label tag. 10 11 New internal features: CPS3/products/CPSPortlets/trunk/skins/cpsportlets_widgets/widget_portlet_search.pt
r46190 r46196 11 11 folder_prefix request/folder_prefix|nothing; 12 12 cpsmcat nocall:here/translation_service; 13 value_search 14 request/SearchableText|python:cpsmcat('button_search'); 13 search_label python:cpsmcat('button_search'); 14 previous_search_value request/SearchableText|string:; 15 search_value python:previous_search_value or search_label; 15 16 base_url python:request.get('cpsskins_base_url');" 16 17 method="get" action="" … … 43 44 <img tal:attributes=" 44 45 src string:${base_url}cpsskins_images/portlet_search_icon.png; 45 alt value_search" />46 alt search_label" /> 46 47 </label> 47 <input id="searchGadget" type="text" name="SearchableText" size="15" 48 value="" tal:attributes="value value_search" 49 onclick="this.value='';"/> 48 <input id="searchGadget" type="text" name="SearchableText" size="15" value="" 49 tal:attributes="value search_value; 50 onclick python:'blankSearchFormInput(\'%s\', this)' 51 % previous_search_value; 52 "/> 50 53 <input class="context searchButton" type="submit" value="button_ok" 51 54 i18n:attributes="value" /> CPS3/products/CPSPortlets/trunk/skins/cpsportlets_widgets/widget_portlet_search_js.pt
r12658 r46196 1 /** 2 * Blank the search form input only if there isn't any ongoing search. 3 */ 4 function blankSearchFormInput(previousSearchValue, formElem) { 5 if (previousSearchValue == '') { 6 formElem.value = ''; 7 } 8 } 9 10 /** 11 * Return whether the search form is empty or not. 12 * This script is to be used to avoid to request a search for an empty request, 13 * to save the server from useless load. 14 */ 1 15 function checkEmptySearch(formElem) { 2 16 var query = trim(formElem.SearchableText.value); … … 10 24 } 11 25 26 /** 27 * Return a copy of the string with leading and trailing characters removed. 28 */ 12 29 function trim(s) { 13 30 if (s) {
