Article previous html
Jump to navigation
Jump to search
Line 285: | Line 285: | ||
$('form').submit(function() { | $('form').submit(function() { | ||
− | var type = $(this).find('[name="Form article[Type]"]').val() | + | var type = $(this).find('[name="Form article[Type]"]').val(); |
− | var title = $(this).find('[name="Form article[Title]"]').val() | + | var title = $(this).find('[name="Form article[Title]"]').val(); |
− | var authors = $(this).find('[name="Form article[Authors]"]').val() | + | var authors = $(this).find('[name="Form article[Authors]"]').val(); |
+ | var month = $(this).find('[name="Form article[month]"]').val(); | ||
+ | var year = $(this).find('[name="Form article[year]"]').val(); | ||
+ | |||
+ | var obj_months = { | ||
+ | "1": "January", | ||
+ | "2": "February", | ||
+ | "3": "March", | ||
+ | "4": "April", | ||
+ | "5": "May", | ||
+ | "6": "June", | ||
+ | "7": "July", | ||
+ | "8": "August", | ||
+ | "9": "September", | ||
+ | "10": "October", | ||
+ | "11": "November", | ||
+ | "12": "December" | ||
+ | }; | ||
var pagename; | var pagename; | ||
Line 296: | Line 313: | ||
case 'post' : | case 'post' : | ||
− | pagename = 'Posts/' + title; | + | pagename = 'Posts/'; |
+ | if(month && year) { | ||
+ | pagename += obj_months[month] + ' ' + year + ' - ' + title; | ||
+ | } else if(year) { | ||
+ | pagename += title + ' (' + year + ')'; | ||
+ | } else { | ||
+ | pagename += title; | ||
+ | } | ||
break; | break; | ||
Line 313: | Line 337: | ||
*/ | */ | ||
− | $(this).find('[name="Form article[Page name]"]').val(pagename) | + | //$(this).find('[name="Form article[Page name]"]').val(pagename) |
// return false; | // return false; |
Revision as of 07:50, 12 March 2020