FANDOM


  • Hello, I would like some help making a calculator for the Age of Ishtaria Wikia ( https://ishtaria.fandom.com/wiki/Age_of_Ishtaria_Wiki ). I want to allow the users to give some input value and then use those values to give several final damage outputs.
    This calculator from the Runescape Wikia ( https://runescape.fandom.com/wiki/Calculator:Agility ) looks like what I am looking for, but it seems to use Javascript and I don't know how to utilize that and I don't know who or where to ask for who made that calculator.

      Loading editor
    • I believe this .js and .css page below are imported in the wiki's Common.js:

      calc: {
         conditional: $('.jcConfig').length,
         scripts: 'MediaWiki:Common.js/calc.js',
         styles: 'MediaWiki:Common.css/calc.css'
      },
        Loading editor
    • What do I do with it? Do I copypaste it somewhere?

        Loading editor
    • You could probably copy and paste the entire common.js to your common.js, but you would have to change the links like 'MediaWiki:Common.css/calc.css' to 'u:runescape:Common.css/calc.css'. To do that, you can press Ctrl + H in the code editor to find and replace iterations of 'MediaWiki' to 'u:runescape'.

        Loading editor
    • The RuneScape Wiki appears to use a custom script to import all of their other scripts. Even if you did copy the entire Common.js, I don't think it would work as they are directly using AJAX requests which do not recognize the the "u:domain" format for interwiki imports. Plus, you would be importing way more than just the calculator. I suggest the following.

      if ($(".jcConfig").length) {
          importArticles({
              type: "script",
              articles: [
                  "u:runescape:Common.js/calc.js"
              ]
          }, {
              type: "style",
              articles: [
                  "u:runescape:Common.css/calc.css"
              ]
          });
      }

      Edit:

      Although, generally, the best solution is to just copy the JS/CSS to your wiki. Then you are just dealing with local scripts instead of scripts hosted by another wiki.

        Loading editor
    • I had a friend make a Calculator for me. They told me to make the calculator.js read-only to prevent people from editing it, but I don't see a read-only option on the .js page. Is the .js page automatically protected?

        Loading editor
    • If it's a MediaWiki page, it should be automatically protected. You can't even make MediaWiki pages without admin rights if I recall correctly.

        Loading editor
    • OK, thanks very much for the help.

        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.