This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into development
- Loading branch information
Showing
3 changed files
with
65 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
/* | ||
swissbib_fnel.js | ||
swissbib-fnel.js | ||
JavaScript fuer Neuerwerbungslistenabfrage aus einer Webseite auf swissbib Basel Bern | ||
05.05.2014 / [email protected] | ||
23.03.2017 / [email protected] / Anpassung für DDC | ||
Die Funktion fnel erwartet mindestens einen Bibliothekscode (vierstellig) | ||
und keinen oder beliebig viele Fachcodes (zweistellig) | ||
und keinen oder beliebig viele Fachcodes (zweistellig) oder keinen oder | ||
beliebig viele DDC-Notationen (drei- oder fünfstellig) | ||
Diese werden beim Aufruf hintereinandergeschrieben (Reihenfolge beliebig) und mit + getrennt. | ||
z.B. javascript:fnel('A138') oder javascript:fnel('A100+is+or+tu') | ||
z.B. javascript:fnel('A138') oder javascript:fnel('A100+is+or+tu+300+310.5') | ||
Wichtig: Der Bibliothekscode muss demjenigen entsprechen, der in der Exemplarnotiz als NELA1001405 vorkommt! | ||
Der effektive Bibliothekscode im Exemplarsatz wird von der Suche ignoriert. | ||
|
@@ -17,37 +19,46 @@ function fnel( arg ) { | |
var baseurl ="http://baselbern.swissbib.ch/Search/Results?"; | ||
var fachcodes = new Array(); | ||
var libraries = new Array(); | ||
var ddc = new Array(); | ||
var ccl = ""; | ||
|
||
// Aufsplitten der Argumente aufgrund ihrer Laenge | ||
|
||
var argsplit = arg.split("+"); | ||
for (var i = 0; i < argsplit.length; i++) { | ||
if ( argsplit[i].length == 4 ) { | ||
libraries.push(argsplit[i]); | ||
continue; | ||
} else if ( argsplit[i].length == 2 ) { | ||
fachcodes.push(argsplit[i]); | ||
continue; | ||
} else if ( argsplit[i].length == 3 ) { | ||
ddc.push(argsplit[i]); | ||
continue; | ||
} else if ( argsplit[i].length == 5 ) { | ||
ddc.push(argsplit[i]); | ||
continue; | ||
} else { | ||
alert("Vermutlich falscher Parameter:\n" + argsplit[i]); | ||
return; | ||
} | ||
else { | ||
if ( argsplit[i].length == 2 ) { | ||
fachcodes.push(argsplit[i]); | ||
continue; | ||
} | ||
else { | ||
alert("Vermutlich falscher Parameter:\n" + argsplit[i]); | ||
return; | ||
} | ||
} | ||
|
||
} | ||
|
||
if ( libraries.length == 0 ) { | ||
alert("Kein Bibliothekscode angegeben!"); | ||
return; | ||
} | ||
|
||
if ( libraries.length == 1 && fachcodes.length == 0 ) { | ||
// Aufrufen einer Funktion je nach Art der mitglieferten Argumente | ||
|
||
if ( libraries.length == 1 && fachcodes.length == 0 && ddc.length == 0) { | ||
ccl = "type=wnel&lookfor=nel" + libraries[0] + make_date(); | ||
} | ||
else { | ||
ccl = "join=AND" + make_nel(libraries) + make_wfc(fachcodes); | ||
} else if (ddc.length == 0) { | ||
ccl = "join=AND" + make_nel(libraries) + make_wfc(fachcodes) ; | ||
} else if (fachcodes.length == 0) { | ||
ccl = "join=AND" + make_nel(libraries) + make_ddc(ddc) ; | ||
} else { | ||
ccl = "join=AND" + make_nel(libraries) + make_wfc(fachcodes) + make_ddc_2(ddc) ; | ||
} | ||
|
||
myurl = baseurl + ccl; | ||
|
@@ -88,6 +99,8 @@ function make_date() { | |
|
||
// Hilfsfunktionen fuer komplexe Anbfragen | ||
|
||
// Abfragen nach Fachcode (wfc) | ||
|
||
function make_wfc(searcharray) { | ||
var cclterm = ""; | ||
|
||
|
@@ -98,6 +111,32 @@ function make_wfc(searcharray) { | |
return cclterm; | ||
} | ||
|
||
// Abfragen nach DDC (an zweiter Position) | ||
|
||
function make_ddc(searcharray) { | ||
var cclterm = ""; | ||
|
||
for (var i = 0; i < searcharray.length; i++) { | ||
cclterm += "&bool1[]=OR&lookfor1[]=" + encodeURI(searcharray[i]) + "*&type1[]=ddc"; | ||
} | ||
|
||
return cclterm; | ||
} | ||
|
||
// Abfragen nach DDC (an dritter Position) | ||
|
||
function make_ddc_2(searcharray) { | ||
var cclterm = ""; | ||
|
||
for (var i = 0; i < searcharray.length; i++) { | ||
cclterm += "&lookfor1[]=" + encodeURI(searcharray[i]) + "*&type1[]=ddc"; | ||
} | ||
|
||
return cclterm; | ||
} | ||
|
||
// Abfragen nach NELA-Codes | ||
|
||
function make_nel(searcharray) { | ||
var cclterm = ""; | ||
|
||
|
@@ -106,4 +145,4 @@ function make_nel(searcharray) { | |
} | ||
|
||
return cclterm; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.facet .jstree-default { | ||
& .jstree-open > .jstree-ocl:before {content: "\f068";} | ||
& .jstree-closed > .jstree-ocl:before {content: "\f067";} | ||
& .jstree-leaf > .jstree-ocl:before {content: " ";} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters