Skip to content

Commit

Permalink
JSLint Reply Replies
Browse files Browse the repository at this point in the history
  • Loading branch information
jcutler committed Nov 17, 2011
1 parent 37118c1 commit df3064d
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 32 deletions.
31 changes: 21 additions & 10 deletions chrome/replyReplies/replyReplies.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global $,chrome,locale */
/*global $,chrome,getLocale */

function reply_setValue(st) {
localStorage.setItem('trr_ReplyText',st);
Expand Down Expand Up @@ -297,8 +297,10 @@ $('div.notification_type_icon').live('mousedown', function(e) {
var rebtxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(rebtxt)) {
rebtxt = getLocale(lang).notificationChanges[anstype][rebtxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(rebtxt)) {
rebtxt = getLocale(lang)
.notificationChanges[anstype][rebtxt];
}
newcode += ' <a href="' + reblnk + '">' +
rebtxt + '</a>';
Expand All @@ -323,8 +325,10 @@ $('div.notification_type_icon').live('mousedown', function(e) {
newcode += ' ';
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang).notificationChanges[anstype][posttypetxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang)
.notificationChanges[anstype][posttypetxt];
}
if (y === postType.length - 1) {
newcode += '<a href="' + postlnk + '">' +
Expand All @@ -339,17 +343,24 @@ $('div.notification_type_icon').live('mousedown', function(e) {
var othertxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(othertxt)) {
othertxt = getLocale(lang).notificationChanges[anstype][othertxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(othertxt)) {
othertxt = getLocale(lang)
.notificationChanges[anstype][othertxt];
}
newcode += ' ' + othertxt;
}
}
if (getLocale(lang).postNotificationChanges &&
getLocale(lang).postNotificationChanges[anstype]) {
for (findtxt in getLocale(lang).postNotificationChanges[anstype]) {
if (getLocale(lang).postNotificationChanges[anstype].hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt, getLocale(lang).postNotificationChanges[anstype][findtxt]);
var findtxt;
for (findtxt in getLocale(lang)
.postNotificationChanges[anstype]) {
if (getLocale(lang).postNotificationChanges[anstype]
.hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt,
getLocale(lang)
.postNotificationChanges[anstype][findtxt]);
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions chrome/replyReplies/replyReplies_fill.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global $,escapeHTML,locale */
/*global $,escapeHTML,getLocale */

function reply_getValue() {
var retval = localStorage.getItem("trr_ReplyText");
Expand Down Expand Up @@ -72,8 +72,9 @@ function getAsLinks(lang, type) {
return getLocale(lang).replyType[type+"Title"] + "\n" +
'<span class="as_links"><a href="#" id="the_as_link" ' +
'onclick="Element.hide(this);Element.show(\'the_as_links\');' +
'return false;" style="font-weight:bold;" >' + getLocale(lang).replyType.as +
'</a><span id="the_as_links" style="display:none;"><a id="as_switch" ' +
'return false;" style="font-weight:bold;" >' +
getLocale(lang).replyType.as + '</a>' +
'<span id="the_as_links" style="display:none;"><a id="as_switch" ' +
'href="' + urlPref + '/new/' + othertype + '">' +
getLocale(lang).replyType[othertype] + '</a>' +
'<a href="#" onclick="Element.hide(\'the_as_links\');' +
Expand Down
27 changes: 18 additions & 9 deletions firefox/missinge/data/replyReplies/replyReplies.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global jQuery,locale,self */
/*global getLocale,jQuery,self */

function reply_setValue(st) {
localStorage.setItem('trr_ReplyText',st);
Expand Down Expand Up @@ -268,8 +268,10 @@ function replyRepliesSettings(message) {
var rebtxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(rebtxt)) {
rebtxt = getLocale(lang).notificationChanges[anstype][rebtxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(rebtxt)) {
rebtxt = getLocale(lang)
.notificationChanges[anstype][rebtxt];
}
newcode += ' <a href="' + reblnk + '">' +
rebtxt + '</a>';
Expand All @@ -294,8 +296,10 @@ function replyRepliesSettings(message) {
newcode += ' ';
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang).notificationChanges[anstype][posttypetxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang)
.notificationChanges[anstype][posttypetxt];
}
if (y === postType.length - 1) {
newcode += '<a href="' + postlnk + '">' +
Expand All @@ -310,17 +314,22 @@ function replyRepliesSettings(message) {
var othertxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(othertxt)) {
othertxt = getLocale(lang).notificationChanges[anstype][othertxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(othertxt)) {
othertxt = getLocale(lang)
.notificationChanges[anstype][othertxt];
}
newcode += ' ' + othertxt;
}
}
if (getLocale(lang).postNotificationChanges &&
getLocale(lang).postNotificationChanges[anstype]) {
var findtxt;
for (findtxt in getLocale(lang).postNotificationChanges[anstype]) {
if (getLocale(lang).postNotificationChanges[anstype].hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt, getLocale(lang).postNotificationChanges[anstype][findtxt]);
if (getLocale(lang).postNotificationChanges[anstype]
.hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt,
getLocale(lang).postNotificationChanges[anstype][findtxt]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion firefox/missinge/data/replyReplies/replyReplies_fill.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global escapeHTML,jQuery,locale */
/*global escapeHTML,getLocale,jQuery */

function reply_getValue() {
var retval = localStorage.getItem("trr_ReplyText");
Expand Down
24 changes: 16 additions & 8 deletions missinge.safariextension/replyReplies/replyReplies.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global $,locale,safari */
/*global $,getLocale,safari */

function reply_setValue(st) {
localStorage.setItem('trr_ReplyText',st);
Expand Down Expand Up @@ -267,7 +267,8 @@ function replyRepliesSettings(response) {
var rebtxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(rebtxt)) {
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(rebtxt)) {
rebtxt = getLocale(lang).notificationChanges[anstype][rebtxt];
}
newcode += ' <a href="' + reblnk + '">' +
Expand All @@ -293,8 +294,10 @@ function replyRepliesSettings(response) {
newcode += ' ';
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang).notificationChanges[anstype][posttypetxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(posttypetxt)) {
posttypetxt = getLocale(lang)
.notificationChanges[anstype][posttypetxt];
}
if (y === postType.length - 1) {
newcode += '<a href="' + postlnk + '">' +
Expand All @@ -309,17 +312,22 @@ function replyRepliesSettings(response) {
var othertxt = getLocale(lang).notifications[anstype][x];
if (getLocale(lang).notificationChanges &&
getLocale(lang).notificationChanges[anstype] &&
getLocale(lang).notificationChanges[anstype].hasOwnProperty(othertxt)) {
othertxt = getLocale(lang).notificationChanges[anstype][othertxt];
getLocale(lang).notificationChanges[anstype]
.hasOwnProperty(othertxt)) {
othertxt = getLocale(lang)
.notificationChanges[anstype][othertxt];
}
newcode += ' ' + othertxt;
}
}
if (getLocale(lang).postNotificationChanges &&
getLocale(lang).postNotificationChanges[anstype]) {
var findtxt;
for (findtxt in getLocale(lang).postNotificationChanges[anstype]) {
if (getLocale(lang).postNotificationChanges[anstype].hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt, getLocale(lang).postNotificationChanges[anstype][findtxt]);
if (getLocale(lang).postNotificationChanges[anstype]
.hasOwnProperty(findtxt)) {
newcode = newcode.replace(findtxt,
getLocale(lang).postNotificationChanges[anstype][findtxt]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion missinge.safariextension/replyReplies/replyReplies_fill.js
Expand Up @@ -21,7 +21,7 @@
* along with 'Missing e'. If not, see <http://www.gnu.org/licenses/>.
*/

/*global $,escapeHTML,locale */
/*global $,escapeHTML,getLocale */

function reply_getValue() {
var retval = localStorage.getItem("trr_ReplyText");
Expand Down

0 comments on commit df3064d

Please sign in to comment.