MediaWiki:AboutArticle.js

Вы находитесь на сайте "Архив статей из ЭЕЭ и статей на еврейские темы из Википедии"

Перейти к: навигация, поиск

Замечание: Чтобы после сохранения увидеть сделанные изменения, очистите кеш своего браузера: Mozilla / Firefox: Ctrl+Shift+R, IE: Ctrl+F5, Safari: Cmd+Shift+R, Konqueror: F5, Opera: через меню Tools→Preferences.

//  ____________________________________________________________________________________________
// |                                                                                            |
// |                    Основано на версии 264413579 гаджета refToolbar.js                      |
// | (http://en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-refToolbar.js&oldid=264413579) |
// |____________________________________________________________________________________________|
//
// Imported from revision 264412998 as of 2009-01-16T05:53:39 from [[User:Mr.Z-man/refToolbar.js]]
// For a description, see [[User:Mr.Z-man/refToolbar]]
 
var numforms = 0;
var numforms1 = 0;
 
function Articlebutton() {
  if (mwCustomEditButtons && document.getElementById('toolbar') ) {
    button = document.createElement('a');
    button.href = "javascript:easyArticleMain()";
    button.title = "Добавить шаблон О_статье";
    buttonimage = document.createElement('img');
    buttonimage.src = "http://upload.wikimedia.org/wikipedia/commons/9/9f/Button_defaultsort.png";
    buttonimage.alt = "Вставить описание статьи";
    button.appendChild(buttonimage);
    var toolbar = document.getElementById('toolbar');
    if (navigator.userAgent.indexOf('MSIE') == -1) {
      if (toolbar.style != null) {
        toolbar.style.height = 'auto';
      }
      else {
      	toolbar.setAttribute('style', 'margin-bottom: 6px; height: auto;');
      }
      toolbar.appendChild(button);
      articlemain = document.createElement('div');
      articlemain.style.display = 'none';
      articlemain.style.margin = '0.2em 0 -0.2em 0';
      articlemain.setAttribute('Id', 'articleselect');
      articlemain.appendChild( addOption("aboutArticle()", "О статье") );
      articlemain.appendChild( addOption("aboutTemplate()", "?") );
      articlemain.appendChild( addOption("hideInit()", "Отмена") );
      toolbar.appendChild(articlemain);
    }
    else {
      toolbar.appendChild(button);
      selection = '<div id="articleselect" style="display:none"><input type="button" value="О статье" onclick="aboutArticle()" />'+
      '<input type="button" value="?" onclick="aboutTemplate()" />'+
      '<input type="button" value="Отмена" onclick="hideInit()" /></div>';
      document.getElementById('editform').innerHTML = selection + document.getElementById('editform').innerHTML;
    }
  }
}
 
function addOption(script, text) {
  option = document.createElement('input');
  option.setAttribute('type', 'button');
  option.setAttribute('onclick', script);
  option.setAttribute("value", text);
  return option;
}
 
function hideInit() {
  document.getElementById('articleselect').style.display = 'none';
  oldFormHide1();
}
 
function oldFormHide1() {
  if (numforms != 0) {
    document.getElementById('articlediv'+numforms).style.display = 'none';
  }
  if (numforms1 != 0) {
    document.getElementById('helpdiv'+numforms1).style.display = 'none';
  }
 
}
 
function easyArticleMain() {
  document.getElementById('articleselect').style.display = '';
}
 
function getTime() {
  var time = new Date();
  var nowdate = time.getUTCDate();
  if (nowdate<10) { nowdate = "0"+ nowdate.toString(); }
  var nowmonth = time.getUTCMonth()+1;
  if (nowmonth<10) { nowmonth = "0"+ nowmonth.toString(); }
  var nowyear = time.getUTCFullYear();
  newtime =  nowdate + '/' + nowmonth + '/' + nowyear;
  return (newtime);
}
 
function aboutTemplate() {
  oldFormHide1();
  var legend;
 
  legend = "Справка";
  numforms1++;
 
  form = '<div id="helpdiv'+numforms1+'">'+
    '<fieldset><legend>'+legend+'</legend>'+
      '{{О_статье  <br>'+
'| ТИП СТАТЬИ            =  <br>'+
  '&nbsp;&nbsp;&nbsp;1. Регулярная статья<br>'+
  '&nbsp;&nbsp;&nbsp;2. Регулярная исправленная статья<br>'+
  '&nbsp;&nbsp;&nbsp;3. Статья-справка<br>'+
  '&nbsp;&nbsp;&nbsp;4. Текст унаследован из Википедии<br>'+
  '&nbsp;&nbsp;&nbsp;5. Служебная статья<br>'+
'| АВТОР1                =  <br>'+
'| АВТОР2                =  <br>'+
'| АВТОР3                =  <br>'+
'| СУПЕРВАЙЗЕР           =  <br>'+
'| ПРОЕКТ                =  <br>'+
'| ПОДТЕМА               =  <br>'+
'| КАЧЕСТВО              =  <br>'+
'| УРОВЕНЬ               =  <br>'+
'| ДАТА СОЗДАНИЯ         =  <br>'+
'| ВИКИПЕДИЯ             =  <br>'+
'| НЕОДНОЗНАЧНОСТЬ       =  <br>'+
'}} <br> <br>'+
    '</fieldset></div>';
    document.getElementById('articleselect').innerHTML += form;
}
 
function aboutArticle() {
  oldFormHide1();
  var legend;
  template = "О_статье";
 
  legend = "Описание статьи";
  newtime = getTime();
  numforms++;
 
  form = '<div id="articlediv'+numforms+'">'+
    '<fieldset><legend>'+legend+'</legend>'+
    '<table cellspacing="6">'+
    '<input type="hidden" value="'+template+'" id="template">'+
    '<tr><td width="150"><label for="АВТОР1">&nbsp;основной автор: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="АВТОР1"></td>'+
    '<td width="150"><label for="ТИП СТАТЬИ">&nbsp;&nbsp;&nbsp;тип статьи: </label></td>'+
      '<td width="80"><SELECT NAME="ТИП СТАТЬИ" SIZE=0 id="typebox">'+
            '<OPTION VALUE="0"></option>'+
            '<OPTION VALUE="1">1. Регулярная статья</option>'+
            '<OPTION VALUE="2">2. Регулярная исправленная статья</option>'+
            '<OPTION VALUE="3">3. Статья-справка</option>'+
            '<OPTION VALUE="4">4. Текст унаследован из Википедии</option>'+
            '<OPTION VALUE="5">5. Служебная статья</option></SELECT></td></tr>'+
    '<tr><td width="150"><label for="АВТОР2">&nbsp;автор 2: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="АВТОР2"></td>'+
    '<td width="150"><label for="УРОВЕНЬ">&nbsp;&nbsp;&nbsp;энциклопедический &nbsp;&nbsp;&nbsp;уровень: </label></td>'+
      '<td width="80"><SELECT NAME="УРОВЕНЬ" SIZE=0 id="level">'+
            '<OPTION VALUE="0"></option>'+
            '<OPTION VALUE="1">I. Обычная статья</option>'+
            '<OPTION VALUE="2">II. Корневая статья</option>'+
            '<OPTION VALUE="3">III. Краткое общее объяснение</option>'+
            '<OPTION VALUE="4">IV. Детальное и техническое обсуждение</option></SELECT></td></tr>'+
 
    '<tr><td width="150"><label for="АВТОР3">&nbsp;автор 3: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="АВТОР3"></td>'+
    '<td width="150"><label for="КАЧЕСТВО">&nbsp;&nbsp;&nbsp;качество: </label></td>'+
      '<td width="80"><SELECT NAME="КАЧЕСТВО" SIZE=0 id="quality">'+
            '<OPTION VALUE="0"></option>'+
            '<OPTION VALUE="1">25%</option>'+
            '<OPTION VALUE="2">50%</option>'+
            '<OPTION VALUE="3">75%</option>'+
            '<OPTION VALUE="4">100%</option></SELECT></td></tr>'+
 
    '<tr><td width="200"><label for="СУПЕРВАЙЗЕР">&nbsp;академический &nbsp;супервайзер: </label></td>'+
      '<td width="100"><SELECT NAME="СУПЕРВАЙЗЕР" SIZE=0 id="supervisor">'+
            '<OPTION VALUE="0"></option>'+
            '<OPTION VALUE="1">Пинхас Полонский</option>'+
            '<OPTION VALUE="2">Арье Ольман</option>'+
            '<OPTION VALUE="3">Шломо Коль-Яаков</option>'+
            '<OPTION VALUE="4">Александр Черницкий</option>'+
            '<OPTION VALUE="5">Борис Гулько</option>'+
            '<OPTION VALUE="6">Леви Китросский</option>'+
            '<OPTION VALUE="7">Г. Ахиезер</option>'+
            '<OPTION VALUE="8">Анна Гейфман</option>'+
            '<OPTION VALUE="9">Ш. Гендельман</option>'+
            '<OPTION VALUE="10">Илья Дворкин</option>'+
            '<OPTION VALUE="11">Давид Копелиович</option>'+
            '<OPTION VALUE="12">М. Левинов</option>'+
            '<OPTION VALUE="13">Л. Прайсман</option>'+
            '<OPTION VALUE="14">Михаэль Рыжик</option>'+
            '<OPTION VALUE="15">Тали Тамарин</option>'+
            '<OPTION VALUE="16">Яков Файтельсон</option>'+
            '<OPTION VALUE="17">Зеев Ханин</option>'+
            '<OPTION VALUE="18">Велвл Чернин</option>'+
            '<OPTION VALUE="19">М. Шерман</option>'+
            '<OPTION VALUE="20">Михаил Шнейдер</option>'+
            '<OPTION VALUE="21">Ася Энтова</option>'+
            '<OPTION VALUE="22">Моше Гончарок</option></SELECT></td>'+
    '<td width="150"><label for="ВИКИПЕДИЯ">&nbsp;&nbsp;&nbsp;в Википедии: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="ВИКИПЕДИЯ"></td></tr>'+
 
    '<tr><td width="150"><label for="ПРОЕКТ">&nbsp;тематический &nbsp;проект: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="ПРОЕКТ"></td>'+
    '<td width="150"><label for="НЕОДНОЗНАЧНОСТЬ">&nbsp;&nbsp;&nbsp;разрешение &nbsp;&nbsp;&nbsp;неоднозначности: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="НЕОДНОЗНАЧНОСТЬ"></td></tr>'+
 
    '<tr><td width="150"><label for="ПОДТЕМА">&nbsp;подтема: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="ПОДТЕМА"></td>'+
    '<td width="150"><label for="ДАТА СОЗДАНИЯ">&nbsp;&nbsp;&nbsp;дата &nbsp;&nbsp;&nbsp;создания: </label></td>'+
      '<td width="300"><input type="text" tabindex=1 style="width:100%" id="ДАТА СОЗДАНИЯ" value="'+ newtime +'"></td></tr>'+
 
    '</table>'+
    '<input type="button" value="Добавить" onClick="addtemplate()">'+
 '</fieldset></div>';
   document.getElementById('articleselect').innerHTML += form;
}
 
function addtemplate() {
  cites = document.getElementById('articlediv'+numforms).getElementsByTagName('input');
  var citebegin = '';
  var citeinner = '';
 
if (document.getElementById ('typebox').selectedIndex !="0") {
      citeinner += "\n|" + document.getElementById ('typebox').name + "=" + document.getElementById ('typebox').selectedIndex;
  }
else {
  citeinner += "\n|" + document.getElementById ('typebox').name + "="
  }
if (document.getElementById ('supervisor').selectedIndex !="0") {
      citeinner += "\n|" + document.getElementById ('supervisor').name + "=" + document.getElementById ('supervisor').selectedIndex;
  }
else {
  citeinner += "\n|" + document.getElementById ('supervisor').name + "="
  }
if (document.getElementById ('level').selectedIndex !="0") {
      citeinner += "\n|" + document.getElementById ('level').name + "=" + document.getElementById ('level').selectedIndex;
  }
else {
  citeinner += "\n|" + document.getElementById ('level').name + "="
  }
if (document.getElementById ('quality').selectedIndex !="0") {
      citeinner += "\n|" + document.getElementById ('quality').name + "=" + document.getElementById ('quality').selectedIndex;
  }
else {
  citeinner += "\n|" + document.getElementById ('quality').name + "="
  }
 
  for (var i=0; i<cites.length-1; i++) {
    if (cites[i].id != "template") {
      citeinner += "\n|" + cites[i].id + "=" + cites[i].value;
    }
    else if (cites[i].id == "template") {
      citebegin = '{{' + cites[i].value;
    }
  }
 
  cite = citebegin + citeinner + "\n}}\n";
  insertTags(cite, '', '');
  document.getElementById('articlediv'+numforms).style.display = 'none';
}
 
//hookEvent("load", Articlebutton);
addOnloadHook(Articlebutton);
Личные инструменты
 

Шаблон:Ежевика:Рубрики

Навигация