AddingNDS Plugin To Other Sites
Including Neahttadigisánit in a website
At minimum, two or three files need to be included on any page of content that
-
neahttadigisanit.css - the stylesheet that provides styling for the
-
neahttadigisanit.jquery.min.js - the main Neahttadigisanit (compressed) JS
- Optionally, you may include a third file that contains the options and
NB: if you prefer to use a version of jQuery that is already in use on your
Including the files
You can either download and rehost these files, or use our copies directly.
There are a few strategies for including these: first, the stylesheet must be
<link rel="stylesheet" href="https://PROJNAME.oahpa.no/static/css/neahttadigisanit.css"></link>
Here you will need to replace PROJNAME with the project you are using, i.e.,
Second: the JS file must be included toward the end, so that it does not delay
<script type="text/javascript" src="https://PROJNAME.oahpa.no/static/js/neahttadigisanit.jquery.min.js"></script>
You may add the JS file in the footer.
Initializing the plugin
The final step is to call the plugin. Typically, you will want to do this
// Wait for the document to load... $(document).ready(function (){ // Initialize and configure NDS $(document).selectToLookup({ // This specifies the dictionary set to api_host: 'https://PROJNAME.oahpa.no/', }); });
For most purposes you should be able to just copy and paste this JS snippet
- South Saami / Norwegian - https: //baakoeh.oahpa.no/
- More coming soon...
Mind the trailing slash.
Custome language pair
If you want to use the plugin with a custom language pair, you can specify it in the script tag as follows:
<script type="text/javascript" id='nds_script' data-lang='iso_source,iso_target' src="https://PROJNAME.oahpa.no/static/js/neahttadigisanit.jquery.min.js"></script>
Where you need to replace iso_source with the iso for the source language, and iso_target with the iso for the target language.
For example, if you use sanit.oahpa.no and you want to customize the plugin so that it shows North-Sámi to Norwegian as your custom default, add the following:
<script type="text/javascript" id='nds_script' data-lang='sme,nob' src="https://sanit.oahpa.no/static/js/neahttadigisanit.jquery.min.js"></script>
Contact
If you encounter problems, please contact us!