can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r22031: LJSUP-12126: Port choose date widget fro...

Committer: dpetrov
LJSUP-12126: Port choose date widget from the old update.bml page
U   trunk/htdocs/js/basic.js
U   trunk/htdocs/js/entry.js
U   trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js
Modified: trunk/htdocs/js/basic.js
===================================================================
--- trunk/htdocs/js/basic.js	2012-05-23 08:33:58 UTC (rev 22030)
+++ trunk/htdocs/js/basic.js	2012-05-23 08:50:42 UTC (rev 22031)
@@ -468,7 +468,7 @@
  */
 LJ.pageVar = function(name) {
 	if (Site.page && Site.page.hasOwnProperty(name)) {
-		return Site.page;
+		return Site.page[name];
 	} else {
 		return void(0);
 	}

Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2012-05-23 08:33:58 UTC (rev 22030)
+++ trunk/htdocs/js/entry.js	2012-05-23 08:50:42 UTC (rev 22031)
@@ -20,7 +20,10 @@
 	jQuery('#entrydate').entryDatePicker({
 		//flag is set to true for new posts
 		updateDate: !!window.updatePostTime,
-		customTimeFlag: jQuery('#journal_time_edited')
+		classNames: {
+			'infutureedit': Site.is_delayed_post === 1 ? 'entrydate-changeit' : 'entrydate-until',
+			'future': Site.is_delayed_post === 1 ? 'entrydate-changeit' : 'entrydate-until',
+		}
 	});
 }
 

Modified: trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js	2012-05-23 08:33:58 UTC (rev 22030)
+++ trunk/htdocs/js/jquery/jquery.lj.entryDatePicker.js	2012-05-23 08:50:42 UTC (rev 22031)
@@ -98,8 +98,7 @@
 			state: 'default',
 			//when the widget is in inedit or infutureedit states, the timers are paused.
 			states: ['default', 'edit', 'inedit', 'infutureedit', 'future'],
-			monthNames: Site.ml_text['month.names.long'] || ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
-			updateDate: !Site.is_edit,
+			updateDate: true,
 			//if true, widget sets custom_time flag if user clicks on edit link. Otherwise it
 			//does so only on real time change from user.
 			disableOnEdit: false,
@@ -107,8 +106,8 @@
 				'default': 'entrydate-date',
 				'edit': 'entrydate-changeit',
 				'inedit': 'entrydate-changeit',
-				'infutureedit': Site.is_delayed_post === 1 ? 'entrydate-changeit' : 'entrydate-until',
-				'future': Site.is_delayed_post === 1 ? 'entrydate-changeit' : 'entrydate-until',
+				'infutureedit': 'entrydate-until',
+				'future': 'entrydate-until',
 				'delayed': 'entrydate-delayed'
 			},
 			selectors: {
@@ -158,7 +157,7 @@
 						timeParts[1],
 						timeParts[2]);
 				} else {
-					this.currentDate = LJ.Util.Date.parse(inputs._date);
+					this.currentDate = LJ.Util.Date.parse(inputs.date.val());
 					this.currentDate.setHours(timeParts[1]);
 					this.currentDate.setMinutes(timeParts[2]);
 				}
@@ -186,7 +185,7 @@
 				currentDate: this.currentDate,
 				dateFormat: LiveJournal.getLocalizedStr('format.date.short'),
 				ml: {
-					caption: Site.ml_text['entryform.choose_date'] || 'Choose date:'
+					caption: LiveJournal.getLocalizedStr('entryform.choose_date', null, 'Choose date:')
 				},
 				endMonth: new Date(2037, 11, 31),
 				showCellHovers: true

Tags: can3p, dpetrov, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments