MediaWiki:RefToolbarConfig.js

Από τη Βικιπαίδεια, την ελεύθερη εγκυκλοπαίδεια

Μετά την αποθήκευση πρέπει να καθαρίσετε την κρυφή μνήμη (cache) του browser σας για να δείτε τις αλλαγές: Σε Chrome, Firefox, Safari, Internet Explorer και Edge: Κρατήστε πατημένο το Shift και κάντε κλικ στο κουμπί Ανανέωση στην μπάρα εργαλείων.

/* 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.
* Its 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" : ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'],
"modal" : true,
"autoparse" : false,
"expandtemplates" : false
};

// Cite template definitions
new citeTemplate('cite web', 'Web',
[ // Basic fields
{"field": "last", "label":"Επώνυμο", "autofillprop":"last1"},
{"field": "first", "label":"Όνομα", "autofillprop":"first1"}, 
{"field": "title", "autofillprop":"title"},
{"field": "url", "label":"URL"},
{"field": "work", "tooltip": "Ποιού ευρύτερου έργου είναι μέρος", "autofillprop":"journal"},
{"field": "publisher"},
{"field": "accessdate", "label":"Ημνία πρόσβασης"}
],
[ // Expanded fields
{"field": "author"},
{"field": "authorlink", "label":"Λήμμα συγγραφέα", "tooltip":"Αν ο συγγραφέας έχει λήμμα, ο τίτλος του λήμματος"},
{"field": "coauthors", "autofillprop":"coauthors"},
{"field": "archiveurl", "label":"URL αρχειοθέτησης"},
{"field": "archivedate", "label":"Ημνία αρχειοθέτησης"},
{"field": "location"},
{"field": "page"},
{"field": "pages", "autofillprop":"pages"},
{"field": "language"},
{"field": "format"},
{"field": "doi", "label":"DOI", "autofillid":"doi"},
{"field": "date", "autofillprop":"date"},
{"field": "month"},
{"field": "year"},
{"field": "quote"}
]);

new citeTemplate('cite news', 'News',
[ // Basic fields
{"field": "last", "label":"Επώνυμο"},
{"field": "first", "label":"Όνομα"}, 
{"field": "title"},
{"field": "url", "label":"URL"},
{"field": "accessdate", "label":"Ημνία πρόσβασης"},
{"field": "newspaper"},
{"field": "date"}
],
[ // Expanded fields
{"field": "author"},
{"field": "author2", 'label': "2ος συγγραφέας"},
{"field": "author3", 'label': "3ος συγγραφέας"},
{"field": "author4", 'label': "4ος συγγραφέας"},
{"field": "author5", 'label': "5ος συγγραφέας"},
{"field": "authorlink", "label":"Λήμμα συγγραφέα", "tooltip":"Αν ο συγγραφέας έχει λήμμα, ο τίτλος του λήμματος"},
{"field": "agency"},
{"field": "archiveurl", "label":"URL αρχειοθέτησης"},
{"field": "archivedate", "label":"Ημνία αρχειοθέτησης"},
{"field": "location"},
{"field": "page"},
{"field": "pages"},
{"field": "language"},
{"field": "format"},
{"field": "doi", "label":"DOI"},
{"field": "month"},
{"field": "year"},
{"field": "quote"}
]);

new citeTemplate('cite book', 'Book',
[ // Basic fields
{"field": "last", "label":"Επώνυμο", "autofillprop":"last1"},
{"field": "first", "label":"Όνομα", "autofillprop":"first1"}, 
{"field": "title", "autofillprop":"title"},
{"field": "year", "autofillprop":"year"},
{"field": "publisher", "autofillprop":"publisher"},
{"field": "location", "autofillprop":"location"},
{"field": "isbn", "label":"ISBN", "autofillid":"isbn"},
{"field": "pages"},
{"field": "url", "label":"URL"}
],
[ // Expanded fields
{"field": "author"},
{"field": "edition", "autofillprop":"edition"},
{"field": "authorlink", "label":"Λήμμα συγγραφέα", "tooltip":"Αν ο συγγραφέας έχει λήμμα, ο τίτλος του λήμματος"},
{"field": "coauthors", "autofillprop":"coauthors"},
{"field": "editor"},
{"field": "accessdate", "label":"Ημνία πρόσβασης"},
{"field": "archiveurl", "label":"URL αρχειοθέτησης"},
{"field": "archivedate", "label":"Ημνία αρχειοθέτησης"},
{"field": "page"},
{"field": "language"},
{"field": "format"},
{"field": "chapter"},
{"field": "date"},
{"field": "month"},
{"field": "quote"}
]);

new citeTemplate('cite journal', 'Journal',
[ // Basic fields
{"field": "last", "label":"Επώνυμο", "autofillprop":"last1"},
{"field": "first", "label":"Όνομα", "autofillprop":"first1"},
{"field": "coauthors", "autofillprop":"coauthors"},
{"field": "title", "autofillprop":"title"},
{"field": "journal", "autofillprop":"journal"},
{"field": "date", "autofillprop":"date"},
{"field": "year"},
{"field": "month"},
{"field": "volume", "autofillprop":"volume"},
{"field": "series"},
{"field": "issue", "autofillprop":"issue"},
{"field": "pages", "autofillprop":"pages"},
{"field": "doi", "label":"DOI", "autofillid":"doi"},
{"field": "pmid", "label":"PMID", "autofillid":"pmid"},
{"field": "url", "label":"URL"},
{"field": "accessdate", "label":"Ημνία πρόσβασης"}
],
[ // Expanded fields
{"field": "author"},
{"field": "authorlink", "label":"Λήμμα συγγραφέα"},
{"field": "editor1-first", "label":"Όνομα επιμελητή"},
{"field": "editor1-last", "label":"Επώνυμο επιμελητή"},
{"field": "editor1-link", "label":"Λήμμα επιμελητή"},
{"field": "page"},
{"field": "at"},
{"field": "trans_title", "label":"Μεταφρασμένος τίτλος"},
{"field": "publisher"},
{"field": "location"},
{"field": "language"},
{"field": "format"},
{"field": "issn", "label":"ISSN"},
{"field": "pmc", "label":"PMC"},
{"field": "oclc", "label":"OCLC"},
{"field": "bibcode"},
{"field": "id", "label":"ID"},
{"field": "laysummary", "label":"Lay summary"},
{"field": "laysource", "label":"Lay source"},
{"field": "laydate", "label":"Lay date"},
{"field": "quote"},
{"field": "ref"},
{"field": "postscript"}
]);


new citeErrorCheck({'type':'reflist', 'testname':'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':'Πολλαπλές παραπομπές περιέχουν το ίδιο περιεχόμενο', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'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':'Πολλαπλές παραπομπές χρησιμοποιούν το ίδιο όνομα', 'err':errors[j]});
  }
  return ret;
}}
);

new citeErrorCheck({'type':'reflist', 'testname':'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(j=0; j<errors.length; j++) {
    ret.push({'msg':'Μια ονομασμένη παραπομπή χρησιμοποιείται αλλά δεν έχει οριστεί', 'err':errors[j]});
  }
  return ret;
}}
);

// All user-facing messages
// TODO: Document usage
$( function() {
mw.usability.addMessages( { "cite-section-label" : "Παραπομπή",
"cite-template-list" : "Πρότυπα",
"cite-named-refs-label" : "Ονομασμένες παραπομπές",
"cite-named-refs-title" : "Εισαγωγή ονομασμένης παραπομπής",
"cite-named-refs-button" : "Ονομασμένες παραπομπές",
"cite-named-refs-dropdown" : "Ονομασμένες παραπομπές", // Used on the top of the named refs list dropsown
'cite-errorcheck-label' : 'Έλεγχος σφαλμάτων',
'cite-errorcheck-button' : 'Έλεγχος για σφάλματα',
"cite-dialog-base" : "παραπομπή",
"cite-form-submit" : "Εισαγωγή",
"cite-form-showhide" : "Εμφάνιση/απόκρυψη επιπλέον πεδίων",
"cite-no-namedrefs" : "Δεν μπορούν να βρεθούν ονομασμένες παραπομπές στη σελίδα",
"cite-namedrefs-intro" : "Επιλέξτε ένα όνομα από τη λίστα για να δείτε το περιεχόμενο της παραπομπής. Πατήστε «Εισαγωγή» για να εισαγάγετε μια παραπομπη προς αυτήν στο κείμενο.",
"cite-raw-preview" : "Κώδικας wiki:",
"cite-parsed-label" : "Parsed wikitext:",
"cite-form-parse" : "Show parsed preview",
"cite-refpreview" : "Προεπισκόπηση",
"cite-name-label" : "Όνομα παραπομπής",
"cite-group-label" : "Ομάδα παραπομπών",
"cite-errorcheck-submit" : "Έλεγχος",
"cite-errorcheck-heading" : "Έλεγχος για τα παρακάτω σφάλματα:",
"cite-error-unclosed" : "Ανοιχτά <span style='font-family:monospace'>&lt;ref&gt;</span> tags",
"cite-error-samecontent" : "Παραπομπές με το ίδιο περιεχόμενο",
"cite-error-templates" : "Παραπομπές που δεν χρησιμοποιούν <a href='//en.wikipedia.org/wiki/Wikipedia:Citation_templates'>πρότυπο παραπομπής</a>",
"cite-error-repeated" : "Πολλαπλές παραπομπές με το ίδιο όνομα",
"cite-error-undef" : "Χρήση με ορισμένων ονομασμένων παραπομπών",
"cite-error-samecontent-msg" : "Πολλαπλές παραπομπές περιέχουν το ίδιο περιεχόμενο: $1",
"cite-error-repeated-msg" : "Πολλαπλές παραπομπές έχουν το όνομα: \"$1\"",
"cite-error-templates-msg" : "Δεν χρησιμοποιεί πρότυπο: $1",
"cite-form-reset" : "Εκκαθάριση φόρμας",
"cite-loading" : "Φόρτωση δεδομένων", // Shown while pagetext is being downloaded from the API
"cite-insert-date" : "Εισαγωγή τρέχουσας ημερομηνίας", // Alt/title text for "insert date" icon
"cite-err-report-heading" : "Αναφορά σφαλμάτων παραπομπών", // Heading for error report table
"cite-err-report-close" : "Κλείσιμο", // Alt/title text for "close" icon on error report
"cite-err-report-empty" : "Δεν βρέθηκαν σφάλματα", // Message displayed in the error report list if there are no errors
"cite-autofill-alt" : "Αυτόματη συμπλήρωση" // Alt text for autofill button image
});

CiteTB.init();
});

$(window).on( 'load', function() {
  CiteTB.init();
});