MediaWiki:Gadget-button-checked.js

From WikiLectures

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* <pre> */

/* ============== Gadget-check.js =================================
       popis:       gadget adds buttons for checking an article
                        1) check article
                        2) review article
   ================================================================== */

// check WikiEditor and inicialize buttons
if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
    $( function() {

      // nnew section "Check article"
      $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'sections': {
        'checkarticle': {
          'type': 'toolbar',
          'label': 'Check article'
        }
      }
    });

    // Nnew groups: "Check article", "Review article"
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
      'section': 'checkarticle',
      'groups': {
        'checkgroup': {
          'label': 'Check article'
        },
        'reviewgroup': {
          'label': 'Review article'
        }
      }
    });

    // button "Check article"
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
      'section': 'checkarticle',
      'group': 'checkgroup',
      'tools': {
        'checkbutton': {
          label: 'Check article by a teacher',
          type: 'button',
          icon: 'http://www.wikilectures.eu/images/2/2f/Symbol_kept_vote_20px.png',
          action: {
            type: 'encapsulate',
            options: {
              pre: "{{Was checked | {{subst:REVISION" + "TIMESTAMP}} | ~~" + "~}}"
            }
          }
        }
      }
     });

    // new button "Review article"
    $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
      'section': 'checkarticle',
      'group': 'reviewgroup',
      'tools': {
        'reviewbutton': {
          label: 'Review article by a specialist',
          type: 'button',
          icon: 'http://www.wikilectures.eu/images/1/17/Symbol_review_20px.png',
          action: {
            type: 'encapsulate',
            options: {
               pre: "{{Review | {{subst:REVISION" + "TIMESTAMP}} | ~~" + "~}}"
            }
          }
        }
      }
    });

  });
}

/* </pre> */