remove keyworded function arguments and fix JS hints
This commit is contained in:
parent
59bfde7c03
commit
f3a7f65687
@ -78,7 +78,8 @@ define(["app/lib/promise", "app/globals"], function(Q, globals) {
|
||||
var qs = function(params) {
|
||||
var rv = "";
|
||||
for (var key in params) {
|
||||
if (params.hasOwnProperty(key) && params[key]) {
|
||||
if (params.hasOwnProperty(key) &&
|
||||
params[key] !== null && typeof(params[key]) !== "undefined") {
|
||||
rv += key + "=" + encodeURIComponent(params[key]) + "&";
|
||||
}
|
||||
}
|
||||
@ -129,16 +130,19 @@ define(["app/lib/promise", "app/globals"], function(Q, globals) {
|
||||
};
|
||||
|
||||
var fetch = function(tid, limit, nested_limit, parent, lastcreated) {
|
||||
if(typeof(limit) == 'undefined') limit = "inf";
|
||||
if(typeof(nested_limit) == 'undefined') nested_limit = "inf";
|
||||
if(typeof(parent) == 'undefined') parent = null;
|
||||
if (typeof(limit) === 'undefined') { limit = "inf"; }
|
||||
if (typeof(nested_limit) === 'undefined') { nested_limit = "inf"; }
|
||||
if (typeof(parent) === 'undefined') { parent = null; }
|
||||
|
||||
var query_dict = {uri: tid || location, after: lastcreated, parent: parent};
|
||||
if(limit != "inf") {
|
||||
|
||||
if(limit !== "inf") {
|
||||
query_dict['limit'] = limit;
|
||||
}
|
||||
if(nested_limit != "inf"){
|
||||
if(nested_limit !== "inf"){
|
||||
query_dict['nested_limit'] = nested_limit;
|
||||
}
|
||||
|
||||
var deferred = Q.defer();
|
||||
curl("GET", endpoint + "/?" +
|
||||
qs(query_dict), null, function(rv) {
|
||||
|
@ -101,11 +101,11 @@ define(["app/text/html", "app/dom", "app/utils", "app/config", "app/api", "app/m
|
||||
function() {
|
||||
el.remove();
|
||||
api.fetch($("#isso-thread").getAttribute("data-isso-id"),
|
||||
limit = config["reveal-on-click"], nested_limit="0",
|
||||
parent=commentWrapper.id,
|
||||
lastcreated=lastcreated).then(
|
||||
config["reveal-on-click"], "0",
|
||||
commentWrapper.id,
|
||||
lastcreated).then(
|
||||
function(rv) {
|
||||
if (rv.total_replies == 0) {
|
||||
if (rv.total_replies === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -172,7 +172,7 @@ define(["app/text/html", "app/dom", "app/utils", "app/config", "app/api", "app/m
|
||||
$("a.reply", footer).textContent = msgs["comment-close"];
|
||||
},
|
||||
function() {
|
||||
form.remove()
|
||||
form.remove();
|
||||
$("a.reply", footer).textContent = msgs["comment-reply"];
|
||||
}
|
||||
);
|
||||
|
@ -26,10 +26,9 @@ require(["app/lib/ready", "app/config", "app/api", "app/isso", "app/count", "app
|
||||
$("#isso-thread").append(new isso.Postbox(null));
|
||||
$("#isso-thread").append('<div id="isso-root"></div>');
|
||||
|
||||
api.fetch($("#isso-thread").getAttribute("data-isso-id"),
|
||||
limit = config["max-comments-top"],
|
||||
nested_limit = config["max-comments-nested"],
|
||||
parent='NULL').then(
|
||||
api.fetch($("#isso-thread").getAttribute("data-isso-id"),
|
||||
config["max-comments-top"],
|
||||
config["max-comments-nested"]).then(
|
||||
function(rv) {
|
||||
if (rv.total_replies == 0) {
|
||||
$("#isso-thread > h4").textContent = Mark.up("{{ i18n-no-comments }}");
|
||||
|
Loading…
Reference in New Issue
Block a user