| | |
| | | this.ksearch_display_results = function (a_results) |
| | | { |
| | | // display search results |
| | | if (a_results.length && this.ksearch_input) { |
| | | var p, ul, li; |
| | | if (a_results.length && this.ksearch_input && this.ksearch_value) { |
| | | var p, ul, li, s_val = this.ksearch_value; |
| | | |
| | | // create results pane if not present |
| | | if (!this.ksearch_pane) { |
| | |
| | | // remove all search results |
| | | ul = this.ksearch_pane.__ul; |
| | | ul.innerHTML = ''; |
| | | |
| | | |
| | | // add each result line to list |
| | | for (i=0; i<a_results.length; i++) { |
| | | li = document.createElement('LI'); |
| | | li.innerHTML = a_results[i].replace(new RegExp('('+this.ksearch_value+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>'); |
| | | li.innerHTML = a_results[i].replace(new RegExp('('+s_val+')', 'ig'), '##$1%%').replace(/</g, '<').replace(/>/g, '>').replace(/##([^%]+)%%/g, '<b>$1</b>'); |
| | | li.onmouseover = function(){ ref.ksearch_select(this); }; |
| | | li.onmouseup = function(){ ref.ksearch_click(this) }; |
| | | li._rcm_id = i; |
| | |
| | | if (!this.gui_objects.subscriptionlist) |
| | | return false; |
| | | |
| | | // find not protected folder |
| | | for (var refid in this.env.subscriptionrows) |
| | | if (this.env.subscriptionrows[refid]!=null && !this.env.subscriptionrows[refid][2]) |
| | | // find not protected folder |
| | | var refid; |
| | | for (var rid in this.env.subscriptionrows) |
| | | if (this.env.subscriptionrows[rid]!=null && !this.env.subscriptionrows[rid][2]) { |
| | | refid = rid; |
| | | break; |
| | | } |
| | | |
| | | var refrow, form; |
| | | var tbody = this.gui_objects.subscriptionlist.tBodies[0]; |
| | |
| | | refid = replace.id; |
| | | } |
| | | |
| | | if (!id || !(refrow = document.getElementById(refid))) |
| | | if (!id || !refid || !(refrow = document.getElementById(refid))) |
| | | { |
| | | // Refresh page if we don't have a table row to clone |
| | | this.goto_url('folders'); |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | |
| | | // set messages count to zero |
| | | if (!replace) |
| | | row.cells[1].innerHTML = '*'; |
| | | |
| | | |
| | | if (!replace && row.cells[2] && row.cells[2].firstChild.tagName.toLowerCase()=='input') |
| | | { |
| | | row.cells[2].firstChild.value = name; |
| | |
| | | |
| | | if (this.env.framed && window.parent) |
| | | parent.location.href = url; |
| | | else |
| | | else |
| | | location.href = url; |
| | | }; |
| | | |