Coder Social home page Coder Social logo

leidenuniversitylibrary / library-search-plugin-public Goto Github PK

View Code? Open in Web Editor NEW
24.0 14.0 12.0 2.53 MB

The Library Search Plugin plugin allows users (students, researchers, etc.) to search your library's catalogue, Google Scholar, WorldCat, or PubMed, without having to navigate to the respective websites first! It also comes with a neat context menu that allows users to select text, right-click, and search!

License: GNU General Public License v3.0

JavaScript 8.88% HTML 5.46% CSS 85.65%
library primo exlibris search plugin chrome-extension code4lib library-catalogue

library-search-plugin-public's Introduction

Library Search Plugin - Public

Library Search Plugin as used by Leiden University Libraries

This plugin, as used by Leiden University Libraries

The Library Search Plugin plugin allows users (students, researchers, etc.) to search your library's catalogue, Google Scholar, WorldCat, or PubMed, without having to navigate to the respective websites first! It also comes with a neat context menu that allows users to select text, right-click, and search!

This is a clean version of the Leiden Search Assistant plugin that can be adapted and used by any library. The plugin is compatible with Google Chrome, Opera, and Firefox.

General information and how-to

"Can my library use it?"

Yes, of course! The code is provided under a GNU General Public License (v3) - Just remember to give credit to Leiden University Libraries somewhere! For the rest, feel free to use, adapt, and distribute your plugin based on the code here.

Awesome! Where do I start?

  1. Start by editing manifest.json - Step by step; the code is heavily commented, that will help you through!
  2. Move to options.js - Here you will mainly have to edit the URL to your catalog and the titles. Again, the code is heavily commented and you should be ok! :)
  3. Edit popup.html - You can modify the way the plugin looks here.
  4. Create your icons - You will have to create some icons in images/icons. Some placeholder images are in place when you download this repository. - more info: https://developer.chrome.com/apps/manifest/icons
  5. (optional) Edit the fonts - At Leiden we use the "Vestula" font, but you can change it to something else. Scroll down for instructions.

Wait, the link is for Primo Old UI, but my library is using Primo New UI! Will it work still? What do I have to change to make it work?

Yes, it will work. Perform a search in your Library's catalogue with the new Primo interface active. Copy the resulting URL and replace the term you have searched with the variable in the code. Don't worry, look at options.js and you will see what I mean.

"I have adapted the code and I am ready to go! How do I test the code on Chrome? How do I publish the plugin on the Chrome Store?"

Congratulations! The next steps will vary from library to library, so here are some links to help you further:

Extras

Google Analytics and Google Tag Manager

You can use Google Analytics (GA) and Google Tag Manager (GTM) with this plugin, but it is in no way obligatory. As a default, the needed parts are commented out in the code. You will need to uncomment those parts and insert your tracking codes.

Caution: working with GTM in a plugin is particularly difficult, and might not lead to the desired results.

Fonts

In the "Fonts" folder you will find the "Vestula" fonts. If you wish to change:

  1. Go to Google Fonts, choose your font and replace the files in the folder.
  2. Replace the references to Vestula in style.css

library-search-plugin-public's People

Contributors

dioscorides avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

library-search-plugin-public's Issues

_config.yml

Thanks for the nice devday presentation today! The plugin was indeed easy to get started with :) Just one issue I encountered when loading the package into Chrome ("Load unpacked"):

screen shot 2018-08-23 at 18 15 55

Removing the file resolved the problem. Is it used for anything?

Update Bootstrap to 5.1.*

The plugin still uses bootstrap version 4.*. While not a problem, we should allocate some resources to pushing the plugin to and updated version.

Remove jquery

For future maintainability we want to stop using jquery in favor of pure Javascript. Translate the scripts present in the js folder.

Select All/Deselect All option for check-form

Thanks so much for making your code available. In the past, we had adapted it to allow a select all/deselect all option with this in the popuphtml

Select / Deselect All

And this in the options.js

$('#selectAll').click(function() {
if(this.checked) {
$(':checkbox').each(function() {
this.checked = true;
});
} else {
$(':checkbox').each(function() {
this.checked = false;
});
}
});

$(document).ready(function () {
//SEARCHBOX STUFF
$('#selectAll').click(function() {
if(this.checked) {
$(':checkbox').each(function() {
this.checked = true;
});
} else {
$(':checkbox').each(function() {
this.checked = false;
});
}
});

before listing all the selection ids.

Now that you are using Bootstrap's form-check, I am not sure how to add in a functioning select all/deselect all. Any help you can provide would be really appreciated.

Katie Utschig
SWITCH Library Consortium

Privacy Permission Justifications in the Google Web Store Developer Dashboard

How did you answer the Google Web Store's required Privacy permission justifications for:

ContextMenu
Tabs
Storage

And, is searching an external website considered using remote code?

I have been trying to update to manifest version 3, but it will not let me publish until I answer these questions.

Thank you!

web store help

Duplicate IDs error

When opening the plugin's popup.html, the console outputs an error mentioning duplicate IDs. This is because options.js repeatedly calls the "context menu" options, every time the popup is opened by the user.

  1. Move the context menu options from options.js to a new file called background.js.
  2. in manifest.json, call background.js instead of popup.html in the "background" section of the json.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.