사용자:Shyang23/RefToolBar 2.0.js/RefToolbarConfig.js

위키백과, 우리 모두의 백과사전.

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다. 구글 크롬, 파이어폭스, 마이크로소프트 엣지, 사파리: ⇧ Shift 키를 누른 채 "새로 고침" 버튼을 클릭하십시오. 더 자세한 정보를 보려면 위키백과:캐시 무시하기 항목을 참고하십시오.

/* Original : [[en:MediaWiki:RefToolbarConfig.js]] */
/* translated by [[ko:user:shyang23]] */
/* 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" : "<year>-<zmonth>-<zdate>",
"autodate fields" : ['확인날짜'],
// "months" : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
"modal" : true,
"autoparse" : false,
"expandtemplates" : false
};

// Cite template definitions
new citeTemplate('웹 인용', 'web',
[ // Basic fields
{"field": "제목", "autofillprop":"title"},
{"field": "url"},
{"field": "저자"},
{"field": "날짜", "autofillprop":"date"},
{"field": "확인날짜"}
],
[ // Expanded fields
{"field": "성", "autofillprop":"last1"},
{"field": "이름", "autofillprop":"first1"},
{"field": "저자고리", "tooltip":"저자에 대한 위키문서 제목. 고리를 만들 필요없이 문서의 제목만을 쓰면 됩니다."},
{"field": "공저자", "autofillprop":"coauthors"},
{"field": "연도"},
{"field": "월"},
{"field": "형식"},
{"field": "언어고리"},
{"field": "언어"},
{"field": "꺾쇠표", "tooltip":"'1' 등의 문자를 입력하면 동양서 인용 관례에 따라 저널명이 겹꺾쇠표로 표시됩니다. 입력하지 않으면 서양서 인용 관례에 따라 제목이 이탤릭체로 표시됩니다."},
{"field": "작품명", "tooltip": "해당 문서가 더 큰 저작물의 일부일 경우, 저작물의 이름", "autofillprop":"journal"},
{"field": "출판사"},
{"field": "쪽", "autofillprop":"pages"},
{"field": "보존url"},
{"field": "보존날짜"},
{"field": "인용문"}
]);

new citeTemplate('뉴스 인용', 'news',
[ // Basic fields
{"field": "제목"},
{"field": "url"}, 
{"field": "출판사"},
{"field": "저자"},
{"field": "쪽"},
{"field": "날짜"},
{"field": "확인날짜"}
],
[ // Expanded fields
{"field": "언어고리"},
{"field": "성"},
{"field": "이름"},
{"field": "공저자"},
{"field": "형식"},
{"field": "언어"},
{"field": "인용문"}
]);

new citeTemplate('서적 인용', 'book',
[ // Basic fields
{"field": "언어고리"},
{"field": "성", "autofillprop":"last1"},
{"field": "이름", "autofillprop":"first1"},
{"field": "저자고리", "tooltip":"저자에 대한 위키문서 제목. 고리를 만들 필요없이 문서의 제목만을 쓰면 됩니다."},
{"field": "공저자", "autofillprop":"coauthors"},
{"field": "저자"},
{"field": "제목", "autofillprop":"title"},
{"field": "꺾쇠표", "tooltip":"'1' 등의 문자를 입력하면 동양서 인용 관례에 따라 저널명이 겹꺾쇠표로 표시됩니다. 입력하지 않으면 서양서 인용 관례에 따라 제목이 이탤릭체로 표시됩니다."},
{"field": "연도", "autofillprop":"year"},
{"field": "출판사", "autofillprop":"publisher"},
{"field": "위치", "autofillprop":"location"},
{"field": "id"}
],
[ // Expanded fields
{"field": "편집자"},
{"field": "기타"},
{"field": "초판날짜"},
{"field": "초판연도"},
{"field": "초판월"},
{"field": "url"},
{"field": "형식"},
{"field": "확인날짜"},
{"field": "확인월"},
{"field": "판", "autofillprop":"edition"},
{"field": "날짜"},
{"field": "월"},
{"field": "언어"},
{"field": "isbn", "autofillid":"isbn"},
{"field": "doi"},
{"field": "쪽"},
{"field": "장"},
{"field": "장고리", "tooltip":"온라인상으로 확인할 수 있는 해당 '장'의 주소를 표시합니다."},
{"field": "인용문"}
]);

new citeTemplate('저널 인용', 'journal',
[ // Basic fields
{"field": "저자"},
{"field": "날짜", "autofillprop":"date"},
{"field": "제목", "autofillprop":"title"},
{"field": "저널", "autofillprop":"journal"},
{"field": "권", "autofillprop":"volume"},
{"field": "호", "autofillprop":"issue"},
{"field": "쪽", "autofillprop":"pages"},
{"field": "id"},
{"field": "url"},
{"field": "확인날짜"}
],
[ // Expanded fields
{"field": "성", "autofillprop":"last1"},
{"field": "이름", "autofillprop":"first1"},
{"field": "저자고리", "tooltip":"저자에 대한 위키문서 제목. 고리를 만들 필요없이 문서의 제목만을 쓰면 됩니다."},
{"field": "공저자", "autofillprop":"coauthors"},
{"field": "연도"},
{"field": "월"},
{"field": "계절", "tooltip":"꺾쇠표로 표시되는 동양서에 한하여 월이 없을 경우 '겨울', '여름' 등을 넣으면 '겨울호', '여름호'로 표시해 줍니다."},
{"field": "pmid", "autofillid":"pmid"},
{"field": "doi", "autofillid":"doi"},
{"field": "issn"},
{"field": "언어고리"},
{"field": "형식"},
{"field": "꺾쇠표", "tooltip":"'1' 등의 문자를 입력하면 동양서 인용 관례에 따라 저널명이 겹꺾쇠표로 표시됩니다. 입력하지 않으면 서양서 인용 관례에 따라 제목이 이탤릭체로 표시됩니다."},
{"field": "인용문"}
]);

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();