Sửa đổi Mô đun:Citation/Configuration

Chú ý: Bạn chưa đăng nhập và địa chỉ IP của bạn sẽ hiển thị công khai khi lưu các sửa đổi.

Bạn có thể tham gia như người biên soạn chuyên nghiệp và lâu dài ở Bách khoa Toàn thư Việt Nam, bằng cách đăng ký và đăng nhập - IP của bạn sẽ không bị công khai và có thêm nhiều lợi ích khác.

Các sửa đổi có thể được lùi lại. Xin hãy kiểm tra phần so sánh bên dưới để xác nhận lại những gì bạn muốn làm, sau đó lưu thay đổi ở dưới để hoàn tất việc lùi lại sửa đổi.

Bản hiện tại Nội dung bạn nhập
Dòng 467: Dòng 467:
 
end
 
end
  
--local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
+
local df_template_patterns = { -- table of redirects to {{Use dmy dates}} and {{Use mdy dates}}
-- '{{ *[Uu]se (dmy) dates *[|}]', -- 915k -- sorted by approximate transclusion count
+
'{{ *[Uu]se (dmy) dates *[|}]', -- 915k -- sorted by approximate transclusion count
-- '{{ *[Uu]se *(mdy) *dates *[|}]', -- 161k
+
'{{ *[Uu]se *(mdy) *dates *[|}]', -- 161k
-- '{{ *[Uu]se (DMY) dates *[|}]', -- 2929
+
'{{ *[Uu]se (DMY) dates *[|}]', -- 2929
-- '{{ *[Uu]se *(dmy) *[|}]', -- 250 + 34
+
'{{ *[Uu]se *(dmy) *[|}]', -- 250 + 34
-- '{{ *([Dd]my) *[|}]', -- 272
+
'{{ *([Dd]my) *[|}]', -- 272
-- '{{ *[Uu]se (MDY) dates *[|}]', -- 173
+
'{{ *[Uu]se (MDY) dates *[|}]', -- 173
-- '{{ *[Uu]se *(mdy) *[|}]', -- 59 + 12
+
'{{ *[Uu]se *(mdy) *[|}]', -- 59 + 12
-- '{{ *([Mm]dy) *[|}]', -- 9
+
'{{ *([Mm]dy) *[|}]', -- 9
-- '{{ *[Uu]se (MDY) *[|}]', -- 3
+
'{{ *[Uu]se (MDY) *[|}]', -- 3
-- '{{ *([Dd]MY) *[|}]', -- 2
+
'{{ *([Dd]MY) *[|}]', -- 2
-- '{{ *([Mm]DY) *[|}]', -- 0
+
'{{ *([Mm]DY) *[|}]', -- 0
-- '{{ *(vdvmvy) *[|}]', -- 0
+
'{{ *(vdvmvy) *[|}]', -- 0
-- '{{ *(dvmvy) *[|}]', -- 0
+
'{{ *(dvmvy) *[|}]', -- 0
---- '{{ *[Uu]se(mdy) *[|}]',
+
-- '{{ *[Uu]se(mdy) *[|}]',
---- '{{ *[Uu]se(mdy)dates *[|}]',
+
-- '{{ *[Uu]se(mdy)dates *[|}]',
---- '{{ *[Uu]se(dmy) *[|}]',
+
-- '{{ *[Uu]se(dmy) *[|}]',
-- }
+
}
  
--local function get_date_format ()
+
local function get_date_format ()
-- local content = mw.title.getCurrentTitle():getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
+
local content = mw.title.getCurrentTitle():getContent() or ''; -- get the content of the article or ''; new pages edited w/ve do not have 'content' until saved; ve does not preview; phab:T221625
-- for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
+
for _, pattern in ipairs (df_template_patterns) do -- loop through the patterns looking for {{Use dmy dates}} or {{Use mdy dates}} or any of their redirects
-- local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
+
local start, _, match = content:find(pattern); -- match is the three letters indicating desired date format
-- if match then
+
if match then
-- content = content:match ('%b{}', start); -- get the whole template
+
content = content:match ('%b{}', start); -- get the whole template
-- if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
+
if content:match ('| *cs1%-dates *= *[lsy][sy]?') then -- look for |cs1-dates=publication date length access-/archive-date length
-- return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
+
return match:lower() .. '-' .. content:match ('| *cs1%-dates *= *([lsy][sy]?)');
-- else
+
else
-- return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
+
return match:lower() .. '-all'; -- no |cs1-dates= k/v pair; return value appropriate for use in |df=
-- end
+
end
-- end
+
end
-- end
+
end
--end
+
end
 +
 
 +
local global_df = get_date_format ();
  
--local global_df = get_date_format ();
 
local global_df = 'vdvmvy-all';
 
  
 
--[[--------------------------< V O L U M E ,  I S S U E ,  P A G E S >----------------------------------------
 
--[[--------------------------< V O L U M E ,  I S S U E ,  P A G E S >----------------------------------------

Lưu ý rằng tất cả các đóng góp của bạn tại Bách khoa Toàn thư Việt Nam sẽ được phát hành theo giấy phép Creative Commons Ghi công–Chia sẻ tương tự (xem thêm Bản quyền). Nếu bạn không muốn những gì mình viết ra sẽ có thể được bình duyệt và có thể bị sửa đổi, và không sẵn lòng cho phép phát hành lại, xin đừng nhấn nút “Lưu trang”. Đảm bảo rằng chính bạn là tác giả của những gì mình viết ra, hoặc chép nó từ một nguồn thuộc phạm vi công cộng hoặc tự do tương đương. ĐỪNG ĐĂNG NỘI DUNG CÓ BẢN QUYỀN MÀ CHƯA XIN PHÉP!

Hủy bỏ Trợ giúp sửa đổi (mở cửa sổ mới)

Bản mẫu dùng trong trang này: