diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2008-05-24 11:39:39 +0200 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2008-05-24 11:39:39 +0200 |
commit | f36faab3aed613fc0e1e10a34a88bf1065c80f79 (patch) | |
tree | f847ad2702fa608713dec46cb8702f36baa3ffc8 /phpfspot.js | |
parent | 6da6a0bae7001a35ac6530fbd6ff9aeab140983f (diff) |
issue121, search for a specific rate-limit
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
Diffstat (limited to 'phpfspot.js')
-rw-r--r-- | phpfspot.js | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/phpfspot.js b/phpfspot.js index 2aee155..be62cfb 100644 --- a/phpfspot.js +++ b/phpfspot.js @@ -287,6 +287,10 @@ function startSearch() objTemp['from'] = from; objTemp['to'] = to; } + if(document.getElementsByName('consider_rate')[0].checked == true) { + objTemp['rate_from'] = rate_search['from']; + objTemp['rate_to'] = rate_search['to']; + } var retr = HTML_AJAX.post(web_path + '/rpc.php', objTemp); if(retr == "ok") { @@ -348,7 +352,11 @@ function clearSearch() if(document.getElementsByName('consider_date')[0].checked == true) { document.getElementsByName('consider_date')[0].checked = false; datesearch(); - } + } + if(document.getElementsByName('consider_rate')[0].checked == true) { + document.getElementsByName('consider_rate')[0].checked = false; + datesearch(); + } } // clearSearch() @@ -800,6 +808,64 @@ function update_sort_order(obj) } // update_sort_order() /** + * show rate stars + * + * this function will show the requested amount of + * rate-stars. + * + * @param string mode + * @param int level + */ +function show_rate(mode, level) +{ + var i; + + for(i = 1; i <= 5; i++) { + if(i <= level) { + document.getElementById('rate_' + mode + '_' + i).src = web_path + '/resources/star.png'; + } + else { + document.getElementById('rate_' + mode + '_' + i).src = web_path + '/resources/empty_rate.png'; + } + } + +} // show_rate() + +/** + * set rate stars + * + * + * this function will set the requested rate-stars-amount into a global + * variable (which will then later be used on form-submit) and will also + * update the display. + * + * @param string mode + * @param int level + */ +function set_rate(mode, level) +{ + rate_search[mode] = level; + show_rate(mode, level); + +} // set_rate() + +/** + * reset rate stars + * + * this function will reset the rate-star to their initial value. + * + * @param string mode + */ +function reset_rate(mode) +{ + if(rate_search[mode] == undefined) + rate_search[mode] = 0; + + show_rate(mode, rate_search[mode]); + +} // reset_rate() + +/** * handle key events */ function keyDown(e) { @@ -858,3 +924,4 @@ var origWidth; // position of the last shown photo in photo-index var photo_details_pos; var web_path; +var rate_search = new Array(); |