Browse Source

misc typo fixes

Andrew Dolgov 8 years ago
parent
commit
e331188f76
15 changed files with 49 additions and 67 deletions
  1. 4 4
      FeedTree.js
  2. 1 4
      PrefFeedTree.js
  3. 4 2
      digest.js
  4. 2 10
      feedlist.js
  5. 6 11
      functions.js
  6. 2 2
      lib/CheckBoxTree.js
  7. 3 3
      lib/position.js
  8. 1 1
      mobile/login_form.php
  9. 4 5
      prefs.js
  10. 2 2
      prefs.php
  11. 2 2
      register.php
  12. 6 8
      tt-rss.js
  13. 1 1
      tt-rss.php
  14. 1 1
      twitter.php
  15. 10 11
      viewfeed.js

+ 4 - 4
FeedTree.js

@@ -67,14 +67,14 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
 		for (var i = 0; i < items.length; i++) {
 			if (items[i] == treeItem) {
 
-				for (j = i+1; j < items.length; j++) {
+				for (var j = i+1; j < items.length; j++) {
 					var unread = this.store.getValue(items[j], 'unread');
 					var id = this.store.getValue(items[j], 'id');
 
 					if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
 				}
 
-				for (j = 0; j < i; j++) {
+				for (var j = 0; j < i; j++) {
 					var unread = this.store.getValue(items[j], 'unread');
 					var id = this.store.getValue(items[j], 'id');
 
@@ -365,7 +365,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
 		for (var i = 0; i < items.length; i++) {
 			if (items[i] == treeItem) {
 
-				for (j = i+1; j < items.length; j++) {
+				for (var j = i+1; j < items.length; j++) {
 					var id = String(items[j].id);
 					var box = this._itemNodesMap[id];
 
@@ -403,7 +403,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
 		for (var i = 0; i < items.length; i++) {
 			if (items[i] == treeItem) {
 
-				for (j = i-1; j > 0; j--) {
+				for (var j = i-1; j > 0; j--) {
 					var id = String(items[j].id);
 					var box = this._itemNodesMap[id];
 

+ 1 - 4
PrefFeedTree.js

@@ -52,7 +52,7 @@ dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, {
 		var item = dijit.getEnclosingWidget(target).item;
 
 		// disable copying items
-		source.copyState = function() { return false; }
+		source.copyState = function() { return false; };
 
 		var source_item = false;
 
@@ -62,9 +62,6 @@ dojo.declare("fox.PrefFeedTree", lib.CheckBoxTree, {
 
 		if (!source_item || !item) return false;
 
-		var id = String(item.id);
-		var source_id = String(source_item.id);
-
 		var id = this.tree.model.store.getValue(item, 'id');
 		var source_id = source.tree.model.store.getValue(source_item, 'id');
 

+ 4 - 2
digest.js

@@ -321,8 +321,10 @@ function viewfeed(feed_id, offset, replace, no_effects, no_indicator, callback)
 
 		console.log(query);
 
+		var img = false;
+		
 		if ($("F-" + feed_id)) {
-			var img = $("F-" + feed_id).getElementsByTagName("IMG")[0];
+			img = $("F-" + feed_id).getElementsByTagName("IMG")[0];
 
 			if (img && !no_indicator) {
 				img.setAttribute("orig_src", img.src);
@@ -545,7 +547,7 @@ function parse_feeds(transport) {
 			feeds.sort( function (a,b)
 				{
 					if (b.unread != a.unread)
-						return (b.unread - a.unread)
+						return (b.unread - a.unread);
 					else
 						if (a.title > b.title)
 							return 1;

+ 2 - 10
feedlist.js

@@ -104,8 +104,6 @@ function viewfeed(feed, subop, is_cat, offset, background, infscrol_req) {
 			dijit.byId("content-tabs").selectChild(
 				dijit.byId("content-tabs").getChildren()[0]);
 
-		var force_nocache = false;
-
 		if (!background) {
 			if (getActiveFeedId() != feed || offset == 0) {
 				active_post_id = 0;
@@ -312,18 +310,14 @@ function displayNewContentPrompt(id) {
 
 function parse_counters(elems, scheduled_call) {
 	try {
-
-		var feeds_found = 0;
-
 		for (var l = 0; l < elems.length; l++) {
 
-			var id = elems[l].id
+			var id = elems[l].id;
 			var kind = elems[l].kind;
-			var ctr = parseInt(elems[l].counter)
+			var ctr = parseInt(elems[l].counter);
 			var error = elems[l].error;
 			var has_img = elems[l].has_img;
 			var updated = elems[l].updated;
-			var title = elems[l].title;
 
 			if (id == "global-unread") {
 				global_unread = ctr;
@@ -336,8 +330,6 @@ function parse_counters(elems, scheduled_call) {
 				continue;
 			}
 
-			var treeItem;
-
 			// TODO: enable new content notification for categories
 
 			if (!activeFeedIsCat() && id == getActiveFeedId()

+ 6 - 11
functions.js

@@ -8,7 +8,7 @@ Array.prototype.remove = function(s) {
 	for (var i=0; i < this.length; i++) {
 		if (s == this[i]) this.splice(i, 1);
 	}
-}
+};
 
 /* create console.log if it doesn't exist */
 
@@ -302,7 +302,7 @@ function gotoExportOpml(filename, settings) {
     if(x.length>1) {
       // remove negative sign
       x=Math.abs(x)+"";
-      for(j=0;j<x.length;j++) {
+      for(var j=0;j<x.length;j++) {
         // call isNumeric recursively for each character
         number=isNumeric(x.substring(j,j+1));
         if(!number) return number;
@@ -368,7 +368,7 @@ function checkboxToggleElement(elem, id) {
 }
 
 function dropboxSelect(e, v) {
-	for (i = 0; i < e.length; i++) {
+	for (var i = 0; i < e.length; i++) {
 		if (e[i].value == v) {
 			e.selectedIndex = i;
 			break;
@@ -435,11 +435,6 @@ function infobox_callback2(transport) {
 		//console.log("infobox_callback2");
 		notify('');
 
-		var content;
-		var dtitle = "Dialog";
-
-		var dlg = transport.responseXML.getElementsByTagName("dlg")[0];
-
 		var title = transport.responseXML.getElementsByTagName("title")[0];
 		if (title)
 			title = title.firstChild.nodeValue;
@@ -1012,7 +1007,7 @@ function quickAddFilter() {
 											if (inPreferences()) {
 												updateFilterList();
 											}
-									}})
+									}});
 								}
 							}
 					}});
@@ -1354,7 +1349,7 @@ function getSelectedTableRowIds(id) {
 	try {
 		var elem_rows = $(id).rows;
 
-		for (i = 0; i < elem_rows.length; i++) {
+		for (var i = 0; i < elem_rows.length; i++) {
 			if (elem_rows[i].hasClassName("Selected")) {
 				var bare_id = elem_rows[i].id.replace(/^[A-Z]*?-/, "");
 				rows.push(bare_id);
@@ -1397,7 +1392,7 @@ function editFeed(feed, event) {
 							dialog.hide();
 							notify('');
 							updateFeedList();
-					}})
+					}});
 				}
 			},
 			href: query});

+ 2 - 2
lib/CheckBoxTree.js

@@ -131,7 +131,7 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
 			currState = this.checkboxState;
 		}
 
-		return currState  // the current state of the checkbox (true/false or undefined)
+		return currState;  // the current state of the checkbox (true/false or undefined)
 	},
 
 	_setCheckboxState: function(/*dojo.data.Item*/ storeItem, /*Boolean*/ newState ) {
@@ -277,7 +277,7 @@ dojo.declare( "lib.CheckBoxStoreModel", dijit.tree.TreeStoreModel,
 				parents.push(this.root);
 			}
 		}
-		return parents // parent(s) of a dojo.data.item (Array of dojo.data.items)
+		return parents; // parent(s) of a dojo.data.item (Array of dojo.data.items)
 	},
 
 	validateData: function(/*dojo.data.Item*/ storeItem, /*thisObject*/ scope ) {

+ 3 - 3
lib/position.js

@@ -4,8 +4,8 @@ Position.GetWindowSize = function(w) {
         w = w ? w : window;
         var width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
         var height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
-        return [width, height]
-}
+        return [width, height];
+};
 
 /* http://textsnippets.com/posts/show/836 */
 
@@ -25,7 +25,7 @@ Position.Center = function(element, parent) {
         }
         element.style.top = (ph/2) - (h/2) -  Position.deltaY + "px";
         element.style.left = (pw/2) - (w/2) -  Position.deltaX + "px";
-}
+};
 
 
 

+ 1 - 1
mobile/login_form.php

@@ -28,7 +28,7 @@ function do_login() {
         <a class="button blueButton" onclick='do_login()'><?php echo __('Log in') ?></a>
     </div>
 
-	<form target="_self" title="Login" action="index.php" id="login" class="panel" method="POST" name="login" selected="true">
+	<form target="_self" title="Login" action="index.php" id="login" class="panel" method="post" name="login" selected="true">
 
 	<fieldset>
 

+ 4 - 5
prefs.js

@@ -250,7 +250,7 @@ function editFilter(id) {
 										onComplete: function(transport) {
 											dialog.hide();
 											updateFilterList();
-									}})
+									}});
 								}
 							}
 					}});
@@ -701,7 +701,7 @@ function editSelectedFeeds() {
 					title: __("Edit Multiple Feeds"),
 					style: "width: 600px",
 					getChildByName: function (name) {
-						var rv = null
+						var rv = null;
 						this.getChildren().each(
 							function(child) {
 								if (child.name == name) {
@@ -773,7 +773,7 @@ function editSelectedFeeds() {
 								onComplete: function(transport) {
 									dialog.hide();
 									updateFeedList();
-							}})
+							}});
 						}
 					},
 					content: transport.responseText});
@@ -985,7 +985,7 @@ function pref_hotkey_handler(e) {
 	try {
 		if (e.target.nodeName == "INPUT") return;
 
-		var keycode;
+		var keycode = false;
 		var shift_key = false;
 
 		var cmdline = $('cmdline');
@@ -1724,7 +1724,6 @@ function editLabel(id, event) {
 			},
 			execute: function() {
 				if (this.validate()) {
-					var caption = this.attr('value').id;
 					var caption = this.attr('value').caption;
 					var fg_color = this.attr('value').fg_color;
 					var bg_color = this.attr('value').bg_color;

+ 2 - 2
prefs.php

@@ -56,11 +56,11 @@
 
 </head>
 
+<body id="ttrssPrefs" class="claro">
+
 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
 <div id="cmdline" style="display : none"></div>
 
-<body id="ttrssPrefs" class="claro">
-
 <div id="overlay">
 	<div id="overlay_inner">
 		<div class="insensitive"><?php echo __("Loading, please wait...") ?></div>

+ 2 - 2
register.php

@@ -218,10 +218,10 @@
 	</td><td>
 		<input type="submit" value="<?php echo __('Check availability') ?>" onclick='return checkUsername()'>
 	</td></tr>
-	<td><?php echo __('Email:') ?></td><td>
+	<tr><td><?php echo __('Email:') ?></td><td>
 		<input name="email">
 	</td></tr>
-	<td><?php echo __('How much is two plus two:') ?></td><td>
+	<tr><td><?php echo __('How much is two plus two:') ?></td><td>
 		<input name="turing_test"></td></tr>
 	<tr><td colspan="2" align="right">
 	<input type="submit" name="sub_btn" value="<?php echo __('Submit registration') ?>"

+ 6 - 8
tt-rss.js

@@ -490,8 +490,6 @@ function parse_runtime_info(data) {
 			return;
 		}
 
-		var error_flag;
-
 		if (k == "daemon_is_running" && v != 1) {
 			notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not running.</span>", true);
 			return;
@@ -521,7 +519,7 @@ function catchupCurrentFeed() {
 	var str = __("Mark all articles in %s as read?").replace("%s", fn);
 
 	if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
-		return viewCurrentFeed('MarkAllRead')
+		return viewCurrentFeed('MarkAllRead');
 	}
 }
 
@@ -534,7 +532,7 @@ function catchupFeedInGroup(id) {
 		var str = __("Mark all articles in %s as read?").replace("%s", title);
 
 		if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
-			return viewCurrentFeed('MarkAllReadGR:' + id)
+			return viewCurrentFeed('MarkAllReadGR:' + id);
 		}
 
 	} catch (e) {
@@ -566,11 +564,11 @@ function collapse_feedlist() {
 }
 
 function viewModeChanged() {
-	return viewCurrentFeed('')
+	return viewCurrentFeed('');
 }
 
 function viewLimitChanged() {
-	return viewCurrentFeed('')
+	return viewCurrentFeed('');
 }
 
 /* function adjustArticleScore(id, score) {
@@ -628,7 +626,7 @@ function hotkey_handler(e) {
 
 		if (e.target.nodeName == "INPUT" || e.target.nodeName == "TEXTAREA") return;
 
-		var keycode;
+		var keycode = false;
 		var shift_key = false;
 
 		var cmdline = $('cmdline');
@@ -780,7 +778,7 @@ function hotkey_handler(e) {
 			}
 
 			if (keycode == 85) { // u
-				selectionToggleUnread(undefined, false, true)
+				selectionToggleUnread(undefined, false, true);
 				return;
 			}
 

+ 1 - 1
tt-rss.php

@@ -102,7 +102,7 @@
 
 <div id="feeds-holder" dojoType="dijit.layout.ContentPane" region="leading" style="width : 20%" splitter="true">
 	<div id="feedlistLoading">
-		<img src='images/indicator_tiny.gif'>
+		<img src='images/indicator_tiny.gif'/>
 		<?php echo  __("Loading, please wait..."); ?></div>
 	<div id="feedTree"></div>
 </div>

+ 1 - 1
twitter.php

@@ -100,7 +100,7 @@
 
 <?php } else if ($op == 'callback') { ?>
 
-	<?php print_notice(__('Congratulations! You have successfully registered with Twitter.')) ?>
+	<p><?php print_notice(__('Congratulations! You have successfully registered with Twitter.')) ?>
 		</p>
 
 	<form method="GET" action="prefs.php">

+ 10 - 11
viewfeed.js

@@ -27,7 +27,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 		var is_cat = false;
 		var feed_id = false;
 
-		var reply;
+		var reply = false;
 
 		try {
 			reply = JSON.parse(transport.responseText);
@@ -71,7 +71,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
 
 			var counters = reply['counters'];
 			var articles = reply['articles'];
-			var runtime_info = reply['runtime-info'];
+			//var runtime_info = reply['runtime-info'];
 
 			if (offset == 0 && infscroll_req == false) {
 				dijit.byId("headlines-frame").attr('content',
@@ -630,7 +630,7 @@ function toggleUnread(id, cmode, effect) {
 function selectionRemoveLabel(id, ids) {
 	try {
 
-		if (!ids) var ids = getSelectedArticleIds2();
+		if (!ids) ids = getSelectedArticleIds2();
 
 		if (ids.length == 0) {
 			alert(__("No articles are selected."));
@@ -692,7 +692,7 @@ function selectionToggleUnread(set_state, callback, no_error) {
 			return;
 		}
 
-		for (i = 0; i < rows.length; i++) {
+		for (var i = 0; i < rows.length; i++) {
 			var row = $("RROW-" + rows[i]);
 			if (row) {
 				if (set_state == undefined) {
@@ -754,7 +754,7 @@ function selectionToggleMarked() {
 			return;
 		}
 
-		for (i = 0; i < rows.length; i++) {
+		for (var i = 0; i < rows.length; i++) {
 			toggleMark(rows[i], true, true);
 		}
 
@@ -786,7 +786,7 @@ function selectionTogglePublished() {
 			return;
 		}
 
-		for (i = 0; i < rows.length; i++) {
+		for (var i = 0; i < rows.length; i++) {
 			togglePub(rows[i], true, true);
 		}
 
@@ -887,7 +887,7 @@ function catchupPage() {
 	}
 
 	selectArticles('all');
-	selectionToggleUnread(false, 'viewCurrentFeed()', true)
+	selectionToggleUnread(false, 'viewCurrentFeed()', true);
 	selectArticles('none');
 }
 
@@ -904,7 +904,6 @@ function deleteSelection() {
 
 		var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
 		var str;
-		var op;
 
 		if (getActiveFeedId() != 0) {
 			str = __("Delete %d selected articles in %s?");
@@ -1007,7 +1006,7 @@ function catchupSelection() {
 			return;
 		}
 
-		selectionToggleUnread(false, 'viewCurrentFeed()', true)
+		selectionToggleUnread(false, 'viewCurrentFeed()', true);
 
 	} catch (e) {
 		exception_error("catchupSelection", e);
@@ -1315,7 +1314,7 @@ function cdmExpandArticle(id) {
 						var reply = JSON.parse(transport.responseText);
 
 						reply.each(function(article) {
-							$("CWRAP-" + article['id']).innerHTML = article['content']
+							$("CWRAP-" + article['id']).innerHTML = article['content'];
 							cids_requested.remove(article['id']);
 						});
 				}});
@@ -1665,7 +1664,7 @@ function getVisibleArticleIds() {
 
 function cdmClicked(event, id) {
 	try {
-		var shift_key = event.shiftKey;
+		//var shift_key = event.shiftKey;
 
 		hideAuxDlg();