Disable Control Panel and "Loading" Window

Help
2009-01-21
2013-04-29
  • First of all, this is a great product.  Thanks for all of your hard work.

    Quick couple of questions, both related (and please forgive me if this has a documented answer).  Is there a quick and easy way to disable the control panel button on the bottom right of the page?  And the "Loading jsMath" window in the bottom left?

    Thanks,

    Craig

     
    • Yes, both can be controlled via CSS settings.  The button has ID jsMath_button and the message window has ID jsMath_message, so you can do something like

      <STYLE>
      #jsMath_button {display:none}
      #jsMath_message {display:none}
      </STYLE>

      This can be done through setting the jsMath variable before loading jsMath, e.g.,

      <SCRIPT>
      jsMath = {styles: {
        '#jsMath_button': {display: 'none'},
        '#jsMath_message': {display: 'none'}
      }};
      </SCRIPT>

      If you are using jsMath/easy/load.js to load jsMath, you can add

      jsMath.styles = {
        '#jsMath_button': {display: 'none'},
        '#jsMath_message': {display: 'none'}
      };

      at the bottom of the file, just above the comment about not changing below that.

      These are described in the jsMath author's documentation at:

      http://www.math.union.edu/locate/jsMath/authors/button.html

      Hope that helps.

      Davide

       
    • Hi Davide,

      Thank you very much for your help and pointing me to the appropriate documentation.  The scripted style for the control panel worked like a charm.  However, the loading "Loading jsMath" message didn't work as planned.  Interestingly enough, if I I don't use "autoload", it doesn't display the message, regardless of the style that I apply.  Conversely, if I enable "autoload", the message is displayed regardless of the style that I apply.

      Is this expected?

      Craig

       
      • You are correct that the "Loading jsMath" message only occurs when you use autoload (when jsMath is loaded directly, there is nobody to put up the message, but I suppose such a message could be issued by the easy-load code).

        As for why the CSS didn't properly control the message, that is my fault.  It turns out that the autoload plugin doesn't use the same DOM element as the jsMath message box (the one used for "Processing Math..." messages and other file-loading messages).  I will fix this in the next release of jsMath.

        Unfotrunately, autoload doesn't tag its message box with an ID that can be used to style it using CSS, so until the new release, it is not easy to remove that message.  To do it, you will need to edit the jsMath/plugins/autoload.js file.  After line 436 in that file, add the line

              this.div.id = "jsMath_autoload_message";

        so the code should read:

          setMessage: function (message) {
            if (message) {
              this.div = document.createElement('div');
              if (!document.body.hasChildNodes) {document.body.appendChild(this.div)}
                else {document.body.insertBefore(this.div,document.body.firstChild)}
              var style = {
                position:'fixed', bottom:'1px', left:'2px',
                backgroundColor:'#E6E6E6', border:'solid 1px #959595',
                margin:'0px', padding:'1px 8px', zIndex:102,
                color:'black', fontSize:'75%', width:'auto'
              };
              for (var id in style) {this.div.style[id] = style[id]}
              this.div.id = "jsMath_autoload_message";
              this.div.appendChild(jsMath.document.createTextNode(message));
            } else if (this.div) {
              this.div.firstChild.nodeValue = "";
              this.div.style.visibility = 'hidden';
            }
          },

        That will make it possible to use the jsMath_autoload_message ID to set its display style to none, as you did with jsMath_button and jsMath_message.

        In the next release, jsMath_message will control both of these, and you will be able to replace the edited copy of autoload.js with the new one.

        Davide