ผลต่างระหว่างรุ่นของ "ผู้ใช้:ZilentFyld/Zilentscriptwp.js"

เนื้อหาที่ลบ เนื้อหาที่เพิ่ม
ZilentFyld (คุย | ส่วนร่วม)
ไม่มีความย่อการแก้ไข
ZilentFyld (คุย | ส่วนร่วม)
ไม่มีความย่อการแก้ไข
บรรทัด 60:
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'testother': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Script อื่น ๆ'
บรรทัด 78:
'options': {
'pre': '[[', 'peri': 'ลิงค์', 'post': ']]'
}
}
},
'date':{
label:'วันที่จากอัง-ไทย',
type:'button',
icon: commonsUrl +'/thumb/3/34/US_to_Thai_date_format_with_BE.svg/37px-US_to_Thai_date_format_with_BE.svg.png',
action:{
type:'replace',
options:{
regex:/^(.*?)$/g,
regexReplace: function(match) {
var exp = match;
exp = exp.replace(/([0-9]+) ([A-z]+) (|[1-2])(|[0-9])(|[0-9])([0-9])/g,function(match,d,m,y) {
return d+' '+thmonth[m]+' พ.ศ.'+(parseInt(y)+543);
});
exp = exp.replace(/([A-z]+) ([0-9]+), ([0-9]+)/g,function(match,m,d,y) {
return d+' '+thmonth[m]+' พ.ศ.'+(parseInt(y)+543);
});
return exp;
}
}
}
},
'datece':{
label:'วันที่จากอัง-ไทยมี ค.ศ.',
type:'button',
icon: commonsUrl +'/thumb/9/9c/US_to_Thai_date_format_with_CE.svg/37px-US_to_Thai_date_format_with_CE.svg.png',
action:{
type:'replace',
options:{
regex:/^(.*?)$/g,
regexReplace: function(match) {
var exp = match;
exp = exp.replace(/([0-9]+) ([A-z]+) (|[1-2])(|[0-9])(|[0-9])([0-9])/g,function(match,d,m,y) {
return d+' '+thmonth[m]+' ค.ศ. '+(parseInt(y));
});
exp = exp.replace(/([A-z]+) ([0-9]+), ([0-9]+)/g,function(match,m,d,y) {
return d+' '+thmonth[m]+' ค.ศ. '+(parseInt(y));
});
return exp;
}
}
}
},
'year':{
label:'คศ-พศ',
type:'button',
icon: commonsUrl +'/thumb/c/ca/Calendar_icon_2.svg/22px-Calendar_icon_2.svg.png',
action:{
type:'replace',
options:{
regex:/([0-9]+)/g,
regexReplace: function(match,y) {
return 'พ.ศ. ' + (parseInt(y)+543)
}
}
}
เส้น 262 ⟶ 206:
$('#anchorbox').val(data.responseData.translatedText);
});
}
}
}
}
});
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'other',
'groups': {
'่dateformat': {
'label': "เปลี่ยนวันที่"
}
}
});
$('#wpTextbox1').wikiEditor('addToToolbar', {
'section': 'other',
'group': 'dateformat',
'tools': {
'date':{
label:'วันที่จากอัง-ไทย',
type:'button',
icon: commonsUrl +'/thumb/3/34/US_to_Thai_date_format_with_BE.svg/37px-US_to_Thai_date_format_with_BE.svg.png',
action:{
type:'replace',
options:{
regex:/^(.*?)$/g,
regexReplace: function(match) {
var exp = match;
exp = exp.replace(/([0-9]+) ([A-z]+) (|[1-2])(|[0-9])(|[0-9])([0-9])/g,function(match,d,m,y) {
return d+' '+thmonth[m]+' พ.ศ.'+(parseInt(y)+543);
});
exp = exp.replace(/([A-z]+) ([0-9]+), ([0-9]+)/g,function(match,m,d,y) {
return d+' '+thmonth[m]+' พ.ศ.'+(parseInt(y)+543);
});
return exp;
}
}
}
},
'datece':{
label:'วันที่จากอัง-ไทยมี ค.ศ.',
type:'button',
icon: commonsUrl +'/thumb/9/9c/US_to_Thai_date_format_with_CE.svg/37px-US_to_Thai_date_format_with_CE.svg.png',
action:{
type:'replace',
options:{
regex:/^(.*?)$/g,
regexReplace: function(match) {
var exp = match;
exp = exp.replace(/([0-9]+) ([A-z]+) (|[1-2])(|[0-9])(|[0-9])([0-9])/g,function(match,d,m,y) {
return d+' '+thmonth[m]+' ค.ศ. '+(parseInt(y));
});
exp = exp.replace(/([A-z]+) ([0-9]+), ([0-9]+)/g,function(match,m,d,y) {
return d+' '+thmonth[m]+' ค.ศ. '+(parseInt(y));
});
return exp;
}
}
}
},
'year':{
label:'คศ-พศ',
type:'button',
icon: commonsUrl +'/thumb/c/ca/Calendar_icon_2.svg/22px-Calendar_icon_2.svg.png',
action:{
type:'replace',
options:{
regex:/([0-9]+)/g,
regexReplace: function(match,y) {
return 'พ.ศ. ' + (parseInt(y)+543)
}
}
}