From: Jakub Skoczen Date: Mon, 2 Apr 2007 08:41:51 +0000 (+0000) Subject: navigation path: removed / and added + X-Git-Tag: PAZPAR2.1.0.0~374 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=f90756452fe633919671e11dbc1b9e21eca0e1e7;p=pazpar2-moved-to-github.git navigation path: removed / and added + --- diff --git a/www/masterkey/css/styles.css b/www/masterkey/css/styles.css index 19391db..ac0612c 100755 --- a/www/masterkey/css/styles.css +++ b/www/masterkey/css/styles.css @@ -322,10 +322,18 @@ line-height: 28px; } div#breadcrumb span{ -margin-right: 2px; +margin-right: 1px; margin-left: 5px; } +div#breadcrumb a:hover { +text-decoration: line-through; +} + +strong#filter{ +margin-right: -5px; +margin-left: 5px; +} table { padding: 0px; diff --git a/www/masterkey/js/client.js b/www/masterkey/js/client.js index daf99cc..94c2193 100644 --- a/www/masterkey/js/client.js +++ b/www/masterkey/js/client.js @@ -1,5 +1,5 @@ /* -** $Id: client.js,v 1.7 2007-03-30 16:22:41 jakub Exp $ +** $Id: client.js,v 1.8 2007-04-02 08:41:51 jakub Exp $ ** MasterKey - pazpar2's javascript client . */ @@ -19,6 +19,7 @@ var currentQuery = null; var currentQueryArr = new Array(); var currentPage = 0; var currentFilter = undefined; +var currentFilterName = null; var currentDetailedId = null; var currentDetailedData = null; @@ -57,6 +58,8 @@ function onFormSubmitEventHandler() { return false; fireSearch(); drawBreadcrumb(); + //hack for now + currentFilter = undefined; $('div.content').show(); $("div.leftbar").show(); return false; @@ -165,7 +168,7 @@ function my_onterm(data) var listItem = $(''+data[key][i].name /*+' ('+data[key][i].freq+')'*/+''); listItem.click(function(){ - refine(this.name, this.attributes[0].nodeValue) }); + refine(this.name, this.attributes[0].nodeValue, this.firstChild.nodeValue) }); listItem.appendTo(listEntries); } else { var listItem = $(''+data[key][i].name @@ -190,7 +193,7 @@ function my_onterm(data) if (key == "xtargets"){ var listItem = $(''+data[key][i].name /*+' ('+data[key][i].freq+')'*/+'').click(function(){ - refine(this.name, this.attributes[0].nodeValue) }); + refine(this.name, this.attributes[0].nodeValue, this.firstChild.nodeValue) }); listItem.appendTo(listEntries); } else { var listItem = $(''+data[key][i].name @@ -226,8 +229,6 @@ function fireSearch() { my_paz.search(currentQuery, currentResultsPerPage, currentSort, currentFilter); $('div.records').empty(); - // hack for the time being - currentFilter = undefined; } function toggleAdvanced() @@ -271,7 +272,7 @@ function drawDetailedRec(detailBox) detailTable.appendTo(detailBox); } -function refine(field, value) +function refine(field, value, opt) { // for the time being //if(!advancedOn) @@ -294,7 +295,8 @@ function refine(field, value) if(document.search.subject.value != '') document.search.subject.value+='; '; document.search.subject.value += value; break; - case "xtarget": currentFilter = 'id='+value; break; + case "xtarget": currentFilter = 'id='+value; + currentFilterName = opt; break; } currentPage = 0; @@ -400,10 +402,14 @@ function drawBreadcrumb() { var bc = $("#breadcrumb"); bc.empty(); + + if(currentFilter) $(''+currentFilterName+': ').click(function(){ + currentFilter = undefined; currentFilterName = null; refine();}).appendTo(bc); + bc.append(''+currentQueryArr[0]+''); for(var i = 1; i < currentQueryArr.length; i++){ - bc.append('/'); + bc.append(' + '); var bcLink = $(''+ currentQueryArr[i].substring(currentQueryArr[i].indexOf('"') + 1, currentQueryArr[i].lastIndexOf('"')) +'').click(function() { currentQueryArr.splice(this.id.split('_')[1], 1);refine(); });