MediaWiki:Group-user.js

Hayazg-ից
22:10, 10 Մարտի 2017 տարբերակ, Oshlikov (քննարկում | ներդրում)
(տարբ) ←Նախորդ տարբերակ | Ընթացիկ տարբերակ (տարբ) | Հաջորդ տարբերակ→ (տարբ)

Ծանուցում. Հիշելուց հետո կատարված փոփոխությունները տեսնելու համար մաքրեք ձեր զննարկիչի հիշապահեստը. Mozilla / Firefox / Safari՝ Ctrl+Shift+R (Cmd+Shift+R Mac OS X-ում) Konqueror՝ F5 Opera՝ Tools→Preferences ընտրացանկից։ Internet Explorer՝ Ctrl+F5

/* Здесь любой JavaScript будет загружаться только для зарегистрированных пользователей */

jQuery(document).ready(
function() {

  jQuery('<li id="t-commonUpload"><a href="http://commons.hayazg.info/Special:Upload">Загрузить на склад</a></li>').insertAfter("li#t-upload");
  jQuery('<input type="submit" value="Загрузить файл" name="wpUpload" title="Начать загрузку [s]" accesskey="s" class="mw-htmlform-submit" />').insertAfter("table#mw-htmlform-source");



/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
  mw.loader.using( 'user.options' ).then( function () {
    // This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
    if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
      $.when(
        mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
      ).then( customizeToolbar );
    }
  } );
}

}); //Jquery



var customizeToolbar = function () {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
  sections: {
    specialchars: {
      labelMsg: 'wikieditor-toolbar-hayazg-specialchars',
      label: 'Хайазг',
      type: 'booklet',
      pages: {
        specialchars: {
          labelMsg: 'specialchars',
          label: 'Символы',
          layout: 'characters',
          characters: [
            "I", "II", "III", "IV",
            { 'label': "\u00ab\u00bb", 'action': { 'type': 'encapsulate', 'options': { 'pre': "\u00ab", 'post': "\u00bb" } } },
            { 'label': "\u2018\u2019", 'action': { 'type': 'encapsulate', 'options': { 'pre': "\u2018", 'post': "\u2019" } } },
            { 'label': "\u201e\u201c", 'action': { 'type': 'encapsulate', 'options': { 'pre': "\u201e", 'post': "\u201c" } } },
            "~", "#", "@", "\u00a7", "$", "\u00a2", "\u00a9", "\u00ae" ,"\u2122", "|", 
            {
              'label': "[[ссылка|текст]]",
              'action': {
                'type': 'encapsulate', 'options': { 'pre': "[["+"|", 'post': "]]" }
              }
            },          
            {
              'label': "[[/доп.ссылка|текст]]",
              'action': {
                'type': 'encapsulate', 'options': { 'pre': "[[/"+"|", 'post': "]]" }
              }
            },          
            {
              'label': "Цитата",
              'action': {
                'type': 'encapsulate', 'options': { 'pre': "{{Цитата|", 'post': "}}" }
              }
            },
          ], //caracters
        },
      }
    }
  }
} ); // addToToolbar
}; // customizeToolbar