Skip to content

dainst/special-character-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

special-character-input

Plain javascript for adding a minimalistic UTF-8 character selection.

Ugly Demo: https://dainst.github.io/special-character-input

General

Setup in Koha

We added the following function to our IntranetUserJS:

function loadSpecialCharacterSelection(){
  var fileRef = document.createElement('script')
  fileRef.setAttribute("type","text/javascript")
  fileRef.setAttribute("src", "/intranet-tmpl/prog/js/specialCharacters.js")
  
  document.querySelector("head").appendChild(fileRef);
}

As you can see, the javascript (and implicitely JSON) file is expected to be found at /intranet-tmpl/prog/js by default. If you want to change the paths, you have to either edit the snippet above AND the javascript file for the new JSON path, or you can do something like this:

var specialCharactersJsonPath = "/path/to/json/specialCharacters.json"

function loadSpecialCharacterSelection(){
  var fileRef = document.createElement('script')
  fileRef.setAttribute("type","text/javascript")
  fileRef.setAttribute("src", "/path/to/javascript/specialCharacters.js")
  
  document.querySelector("head").appendChild(fileRef);
}

About

Plain javascript for adding a minimalistic UTF-8 character selection.

Topics

Resources

License

Stars

Watchers

Forks