mardi 22 septembre 2015

Aide with reftagger; using javascript to append it before the end body tag

I am Superdadsuper an Administrator and Bureaucrat on Biblicalapedia a wiki-based website about the Bible. I am not very keen in JavaScript and so am looking for some help in adding a feature.

Being a website about the Bible and a wiki, it's extremely important to attribute all of our content to the ultimate source the Bible. Over the years we have tried different systems in order to cite these, but none of them have matched with our needs. Rather then containing inline Bible verses (Gen 1:1) we have all verses footnoted in the bottom using our CMS'S (MediaWiki) reference system. I have finally found a feature that is highly customizable and automatically links all Bible verse cites and allows you to preview the verse with a hover (this is called reftagger).

As I mentioned we are hosted on MediaWiki. Reftagger does provide some documentation on adding it to MediaWiki but does not apply because of the type of hosting we use and we have not been given that level of access to the system. Out of the system settings we do have access to, I have attempted adding it to [cite references link one][3], the file that allows customizing of the reference feature. This did not work (as it just repost the code for every reference) and I tried adding to the common.js file (the file that allows you to custom the site with JavaScript- I would link these files but cannot due to my amount of reputation points), but this still didn't work. I have tried many on-wikia resources and recieved no help (even consulted logos and received no aide). I also saw something that it needs to be added right before the end body tag for it to work. Common.js embeds before that. I am wondering if that is the issue and if so could someone provide a code that appends my script (following below) to directly before the end tag. If not those who are familiar with MediaWiki or able able to do research if they had any idea of how I could get this to work? My script as follows (generated from reftagger's website):

<script>
    var refTagger = {
            settings: {
                  bibleVersion: "NIV"   ,                  
                    roundCorners: true,
                    socialSharing: ["twitter","facebook","google"],
                    tooltipStyle: "dark",
                    customStyle : {
                            heading: {
                                    backgroundColor : "#611e03",
                                    fontFamily : "Verdana, Geneva, sans-serif"
                            },
                            body   : {
                                    color : "#f5f5f5",
                                    fontFamily : "TimesNewRoman, 'Times New Roman', Times, Baskerville, Georgia, serif",
                                    moreLink : {
                                            color: "#006cb0"
                                    }
                            }
                    }
            }
    };
    (function(d, t) {
            var g = d.createElement(t), s = d.getElementsByTagName(t)[0];
            g.src = "//api.reftagger.com/v2/RefTagger.js";
            s.parentNode.insertBefore(g, s);
    }(document, "script"));

Please note the script tags will probably need to be taken out for it to work on a js file. The source is located at the g.src url that is provided. Another cause for the issue may be that the script wasn't designed to be done in the ol tag or more specifically with the class references. If this is the issue again please provide a fix. I am a little but frustrated with my lack of aide and would really like to get this rolling out on my site. By adding this feature you are helping Biblicalapedia take the next step and further centering our focus of the source of the content on the Bible itself. Whether you are Christian or not I would extremely appreciate anyone who helps me and would like them to be aware that they are aiding in our essential part of our ministry

Thanks, Superdadsuper, Biblicalapedia Administrator and Bureaucrat




Aucun commentaire:

Enregistrer un commentaire