can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r19468: LJINT-442: Error on kommersant (05.07.11...

Committer: dpetrov
LJINT-442: Error on kommersant (05.07.11) - rollback previous commit
U   trunk/htdocs/js/quickreply.js
Modified: trunk/htdocs/js/quickreply.js
===================================================================
--- trunk/htdocs/js/quickreply.js	2011-07-12 07:36:12 UTC (rev 19467)
+++ trunk/htdocs/js/quickreply.js	2011-07-12 09:27:53 UTC (rev 19468)
@@ -1,7 +1,6 @@
 QuickReply = {
 	lastDiv: 'qrdiv',
-
-
+	
 	reply: function(dtid, pid, newsubject)
 	{
 		var targetname = 'ljqrt' + dtid,
@@ -15,7 +14,7 @@
 			subject = $('subject');
 		
 		// Is this a dumb browser?
-		if (! QuickReply._checkElements(qr_ptid, qr_rto, qr_dtid, qr_div, cur_div, qr_form, qr_form_div, subject)) {
+		if (!qr_ptid || !qr_rto || !qr_dtid || !qr_div || !cur_div || !qr_form || !qr_form_div || !subject) {
 			return true;
 		}
 		
@@ -24,7 +23,7 @@
 		qr_rto.value = pid;
 		
 		if (QuickReply.lastDiv == 'qrdiv') {
-			qr_div.css('display', 'inline');
+			qr_div.style.display = 'inline';
 			// Only one swap
 			cur_div.parentNode.insertBefore(qr_div, cur_div);
 		} else if (QuickReply.lastDiv != dtid) {
@@ -56,7 +55,7 @@
 			pidform = $('parenttalkid');
 		
 		// do not do the default form action (post comment) if something is broke
-		if (! QuickReply._checkElements(qr_form, basepath, dtid, pidform)) {
+		if (!qr_form || !basepath || !dtid || !pidform) {
 			return false;
 		}
 		
@@ -78,7 +77,7 @@
 		var submitmore = $('submitmoreopts'),
 			submit = $('submitpost');
 		
-		if (! QuickReply._checkElements(submitmore, submit)) {
+		if (!submitmore || !submit) {
 			return false;
 		}
 		
@@ -115,13 +114,12 @@
 	save: function()
 	{
 		var qr_form = $('qrform');
-		var do_spellcheck = $('do_spellcheck'),
-			qr_upic = $('prop_picture_keyword');
-	
-		if (! QuickReply._checkElements(qr_form, do_spellcheck, qr_upic)) {
+		if (!qr_form) {
 			return false;
 		}
-
+		var do_spellcheck = $('do_spellcheck'),
+			qr_upic = $('prop_picture_keyword');
+		
 		$('saved_body').value = qr_form.body.value;
 		$('saved_subject').value = $('subject').value;
 		$('saved_dtid').value = $('dtid').value;
@@ -146,12 +144,9 @@
 				subject = $('saved_subject'),
 				subject_str = '',
 				qr_form = $('qrform');
-			if (! QuickReply._checkElements(saved_body, qr_form, dtid)) {
+			if (!saved_body || saved_body.value == '' || !qr_form || !dtid) {
 				return;
 			}
-			if (saved_body.value == '') {
-				return;
-			}
 			
 			if (subject) {
 				subject_str = subject.value;
@@ -199,15 +194,6 @@
 			}
 		});
 		ups.show();
-	},
-
-	_checkElements:  function () {
-		for (var i = 0; i < arguments.length; ++i) {
-			if (!arguments[i] || !arguments[i].length) {
-				return false;
-			}
-		}
-		return true;
 	}
 }
 

Tags: can3p, 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