MediaWiki:RefToolbarConfig.js

Vikisöz, özgür söz dizini

Not: Yayımladıktan sonra değişiklikleri görmek için tarayıcınızın önbelleğini temizlemeniz gerekebilir.

  • Firefox / Safari: Shift tuşuna basılıyken Yeniden Yükle'ye tıklayın ya da Ctrl-F5 ya da Ctrl-R tıklayın (Mac için ⌘-R).
  • Google Chrome: Ctrl-Shift-R'ye basın. (Mac için ⌘-Shift-R)
  • Internet Explorer / Edge: Ctrl basılıyken Yenile'ye tıklayın ya da Ctrl-F5 yapın.
  • Opera: Ctrl-F5 tıklayın.
/* Sitewide options for the the Cite toolbar button:
* All options should be specified
*
* "date format" sets the date format used for the function to insert the current date
* Current available options:
* date - the day of the month
* zdate - day of the month, zero padded to 2 digits
* monthname - The month name
* month - The numberic month (1-12)
* zmonth - numeric month, zero padded to 2 digits
* year - The full year (4 digits)
*
* "autodate fields" is a list of template fields that should have a button to insert the current date
* 
* "months" is a list of localized month names
*
* "modal" - if true, the dialogs will be modal windows, blocking access to the rest of the window.
* See http://en.wikipedia.org/wiki/Modal_window
* All dialogs in the toolbar are modal by default
*
* "autoparse" - if true, previewing a ref will automatically trigger a preview of the parsed wikitext.
* It is not recommended to set this to true as a global setting as it may slow the script down for
* people with slow connections.
*
* "expandtemplates" - if true, templates and parser functions will be expanded when getting page text
* (templates inside of ref tags will not be expanded). This will allow references inside of templates or
* references using {{#tag:ref}} to be listed in the named refs dialog and searched by error checks.
* This may slow loading the named refs and error check dialogs.
*/

CiteTB.Options = {
"date format" : "<date> <monthname> <year>",
"autodate fields" : ['accessdate'],
"months" : ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'],
"modal" : true,
"autoparse" : false,
"expandtemplates" : false
};

// Cite template definitions
new citeTemplate('web kaynağı', 'web',
[ // Basic fields
{"field": "soyadı<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "ad<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "başlık", "autofillprop":"title"},
{"field": "url"},
{"field": "website", "autofillprop":"journal"},
{"field": "yayıncı"},
{"field": "erişimtarihi"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
[ // Expanded fields
{"field": "yazar<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "yazarlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "arşivURL"},
{"field": "arşivtarihi"},
{"field": "yer"},
{"field": "sayfa", "tooltip":"cite-page-tooltip"},
{"field": "sayfalar", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "dil"},
{"field": "biçim"},
{"field": "doi", "autofillid":"doi"},
{"field": "tarih", "autofillprop":"date"},
{"field": "alıntı"}
]);

new citeTemplate('haber kaynağı', 'news',
[ // Basic fields
{"field": "soyadı<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "ad<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "başlık", "autofillprop":"title"},
{"field": "url"},
{"field": "erişimtarihi"},
{"field": "eser", "tooltip":"cite-work-tooltip", "autofillprop":"journal"},
{"field": "ajans"},
{"field": "sayı"},
{"field": "yayıncı"},
{"field": "tarih", "autofillprop":"date"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}
],
[ // Expanded fields
{"field": "yazar<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "yazarlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "arşivurl"},
{"field": "arşivtarihi"},
{"field": "yer"},
{"field": "sayfa", "tooltip":"cite-page-tooltip"},
{"field": "sayfalar", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "dil"},
{"field": "biçim"},
{"field": "doi", "autofillid":"doi"},
{"field": "alıntı"}
]);

new citeTemplate('kitap kaynağı', 'book',
[ // Basic fields
{"field": "soyadı<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "ad<N>", "autofillprop":"first-incr", 'increment_group':'author', 'increment_button':true}, 
{"field": "başlık", "autofillprop":"title"},
{"field": "tarih", "autofillprop":"year"},
{"field": "yayıncı", "autofillprop":"publisher"},
{"field": "yer", "autofillprop":"location"},
{"field": "isbn", "autofillid":"isbn"},
{"field": "sayfa", "tooltip":"cite-page-tooltip"},
{"field": "sayfalar", "autofillprop":"sayfalar", "tooltip":"cite-pages-tooltip"},
{"field": "basım", "autofillprop":"edition"},
{"field": "url"},
{"field": "erişimtarihi"},
{"field": "ref", "tooltip":"cite-ref-tooltip"}

],
[ // Expanded fields
{"field": "yazar<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "yazarlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "editör<N>-soyadı", "increment_group":"editor"},
{"field": "editör<N>-ad", "increment_group":"editor", "increment_button":true},
{"field": "editör<N>-bağı", 'increment_group':'editorlink', 'increment_button':true},
{"field": "arşivurl"},
{"field": "arşivtarihi"},
{"field": "dil"},
{"field": "biçim"},
{"field": "çeviribölüm"},
{"field": "alıntı"}
]);

new citeTemplate('dergi kaynağı', 'journal',
[ // Basic fields
{"field": "ad<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "soyadı<N>", "autofillprop":"last-incr", 'increment_group':'author'},
{"field": "başlık", "autofillprop":"title"},
{"field": "dergi", "autofillprop":"journal"},
{"field": "tarih", "autofillprop":"date"},
{"field": "cilt", "autofillprop":"volume"},
{"field": "sayı", "autofillprop":"issue"},
{"field": "sayfa", "tooltip":"cite-page-tooltip"},
{"field": "sayfalar", "autofillprop":"pages", "tooltip":"cite-pages-tooltip"},
{"field": "doi", "autofillid":"doi"},
{"field": "pmid", "autofillid":"pmid"},
{"field": "url"},
{"field": "erişimtarihi"},
{"field": "ref", "tooltip":"cite-ref-tooltip"},
],
[ // Expanded fields
{"field": "yazar<N>", 'increment_group':'author_alt', 'increment_button':true},
{"field": "yazarlink<N>", "tooltip":"cite-authorlink-tooltip", 'increment_group':'authorlink', 'increment_button':true},
{"field": "editör<N>-soyadı", "increment_group":"editor"},
{"field": "editör<N>-ad", "increment_group":"editor", "increment_button":true},
{"field": "editör<N>-bağı", 'increment_group':'editorlink', 'increment_button':true},
{"field": "seri"},
{"field": "konum", "tooltip":"cite-at-tooltip"},
{"field": "çeviribaşlık"},
{"field": "yayıncı"},
{"field": "yer"},
{"field": "dil"},
{"field": "biçim"},
{"field": "issn"},
{"field": "pmc"},
{"field": "oclc"},
{"field": "bibcode"},
{"field": "id"},
{"field": "alıntı"},
{"field": "postscript", "tooltip":"cite-postscript-tooltip"}
]);

new citeErrorCheck({'type':'reflist', 'testname':'samecontent', 'desc': 'cite-samecontent-desc',
'func': function(reflist) {
  var errors = [];
  var refs2 = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag) {
      if ($.inArray(reflist[i].content, refs2) != -1) {
        if ($.inArray(reflist[i].content, errors) == -1) {
          errors.push(reflist[i].content);
        }
      } else {
        refs2.push(reflist[i].content);
      }
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-samecontent-error', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'repeated', 'desc':'cite-repeated-desc',
'func': function(reflist) {
  var errors = [];
  var refs2 = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag && reflist[i].refname) {
      if ($.inArray(reflist[i].refname, refs2) != -1) {
        if ($.inArray(reflist[i].refname, errors) == -1) {
          errors.push(reflist[i].refname);
        }
      } else {
        refs2.push(reflist[i].refname);
      }
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-repeated-error', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'undefined', 'desc':'cite-undefined-desc',
'func': function(reflist) {
  var errors = [];
  var longrefs = [];
  for(var i=0; i<reflist.length; i++) {
    if (!reflist[i].shorttag && reflist[i].refname) {
      longrefs.push(reflist[i].refname);
    }
  }
  for(var j=0; i<reflist.length; j++) {
    if (reflist[i].shorttag && $.inArray(reflist[i].refname, errors) == -1 && $.inArray(reflist[i].refname, longrefs) == -1) {
      errors.push(reflist[i].refname);
    }
  }
  ret = [];
  for(var j=0; j<errors.length; j++) {
    ret.push({'msg':'cite-undefined-error', 'err':errors[j]});
  }
  return ret;
}}
);

CiteTB.init();