JSHint eqeqeq
This commit is contained in:
parent
5fa6b8253e
commit
ab6732cac1
37 changed files with 62 additions and 62 deletions
|
|
@ -61,7 +61,7 @@ Handlebars.registerHelper('sharingMessage', function(person) {
|
||||||
// allow hovercards for users that are not the current user.
|
// allow hovercards for users that are not the current user.
|
||||||
// returns the html class name used to trigger hovercards.
|
// returns the html class name used to trigger hovercards.
|
||||||
Handlebars.registerHelper('hovercardable', function(person) {
|
Handlebars.registerHelper('hovercardable', function(person) {
|
||||||
if( app.currentUser.get('guid') != person.guid ) {
|
if( app.currentUser.get('guid') !== person.guid ) {
|
||||||
return 'hovercardable';
|
return 'hovercardable';
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
|
@ -104,7 +104,7 @@ Handlebars.registerHelper('fmtText', function(text) {
|
||||||
|
|
||||||
Handlebars.registerHelper('isCurrentPage', function(path_helper, id, options){
|
Handlebars.registerHelper('isCurrentPage', function(path_helper, id, options){
|
||||||
var currentPage = "/"+Backbone.history.fragment;
|
var currentPage = "/"+Backbone.history.fragment;
|
||||||
if (currentPage == Handlebars.helpers.urlTo(path_helper, id, options.data)) {
|
if (currentPage === Handlebars.helpers.urlTo(path_helper, id, options.data)) {
|
||||||
return options.fn(this);
|
return options.fn(this);
|
||||||
} else {
|
} else {
|
||||||
return options.inverse(this);
|
return options.inverse(this);
|
||||||
|
|
@ -121,7 +121,7 @@ Handlebars.registerHelper('aspectMembershipIndicator', function(contact,in_aspec
|
||||||
if(!app.aspect || !app.aspect.get('id')) return '<div class="aspect_membership_dropdown placeholder"></div>';
|
if(!app.aspect || !app.aspect.get('id')) return '<div class="aspect_membership_dropdown placeholder"></div>';
|
||||||
|
|
||||||
var html = '<i class="entypo ';
|
var html = '<i class="entypo ';
|
||||||
if( in_aspect == 'in_aspect' ) {
|
if( in_aspect === 'in_aspect' ) {
|
||||||
html += 'circled-cross contact_remove-from-aspect" ';
|
html += 'circled-cross contact_remove-from-aspect" ';
|
||||||
html += 'title="' + Diaspora.I18n.t('contacts.remove_contact') + '" ';
|
html += 'title="' + Diaspora.I18n.t('contacts.remove_contact') + '" ';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
if (!o_embed_cache) { return "" }
|
if (!o_embed_cache) { return "" }
|
||||||
|
|
||||||
var data = o_embed_cache.data;
|
var data = o_embed_cache.data;
|
||||||
if (data.type == "photo") {
|
if (data.type === "photo") {
|
||||||
return '<img src="' + data.url + '" width="' + data.width + '" height="' + data.height + '" />';
|
return '<img src="' + data.url + '" width="' + data.width + '" height="' + data.height + '" />';
|
||||||
} else {
|
} else {
|
||||||
return data.html || "";
|
return data.html || "";
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
var punycodeURL = function(url){
|
var punycodeURL = function(url){
|
||||||
try {
|
try {
|
||||||
while(url.indexOf("%") !== -1 && url != decodeURI(url)) url = decodeURI(url);
|
while(url.indexOf("%") !== -1 && url !== decodeURI(url)) url = decodeURI(url);
|
||||||
}
|
}
|
||||||
catch(e){}
|
catch(e){}
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
url = // rebuild the url
|
url = // rebuild the url
|
||||||
(!addr.scheme ? '' : addr.scheme +
|
(!addr.scheme ? '' : addr.scheme +
|
||||||
( (addr.scheme.toLowerCase()=="mailto" || addr.scheme.toLowerCase()=="xmpp") ? ':' : '://')) +
|
( (addr.scheme.toLowerCase() === "mailto" || addr.scheme.toLowerCase() === "xmpp") ? ':' : '://')) +
|
||||||
(!addr.user ? '' : addr.user +
|
(!addr.user ? '' : addr.user +
|
||||||
(!addr.pass ? '' : ':'+addr.pass) + '@') +
|
(!addr.pass ? '' : ':'+addr.pass) + '@') +
|
||||||
punycode.toASCII(addr.host) +
|
punycode.toASCII(addr.host) +
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ app.models.Contact = Backbone.Model.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
inAspect : function(id) {
|
inAspect : function(id) {
|
||||||
return this.aspect_memberships.any(function(membership){ return membership.get('aspect').id == id; });
|
return this.aspect_memberships.any(function(membership){ return membership.get('aspect').id === id; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// @license-end
|
// @license-end
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,20 @@ app.models.Person = Backbone.Model.extend({
|
||||||
|
|
||||||
isSharing: function() {
|
isSharing: function() {
|
||||||
var rel = this.get('relationship');
|
var rel = this.get('relationship');
|
||||||
return (rel == 'mutual' || rel == 'sharing');
|
return (rel === 'mutual' || rel === 'sharing');
|
||||||
},
|
},
|
||||||
|
|
||||||
isReceiving: function() {
|
isReceiving: function() {
|
||||||
var rel = this.get('relationship');
|
var rel = this.get('relationship');
|
||||||
return (rel == 'mutual' || rel == 'receiving');
|
return (rel === 'mutual' || rel === 'receiving');
|
||||||
},
|
},
|
||||||
|
|
||||||
isMutual: function() {
|
isMutual: function() {
|
||||||
return (this.get('relationship') == 'mutual');
|
return (this.get('relationship') === 'mutual');
|
||||||
},
|
},
|
||||||
|
|
||||||
isBlocked: function() {
|
isBlocked: function() {
|
||||||
return (this.get('relationship') == 'blocked');
|
return (this.get('relationship') === 'blocked');
|
||||||
},
|
},
|
||||||
|
|
||||||
block: function() {
|
block: function() {
|
||||||
|
|
|
||||||
|
|
@ -44,12 +44,12 @@ app.models.Post.Interactions = Backbone.Model.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
userLike : function(){
|
userLike : function(){
|
||||||
return this.likes.select(function(like){ return like.get("author").guid == app.currentUser.get("guid")})[0];
|
return this.likes.select(function(like){ return like.get("author").guid === app.currentUser.get("guid")})[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
userReshare : function(){
|
userReshare : function(){
|
||||||
return this.reshares.select(function(reshare){
|
return this.reshares.select(function(reshare){
|
||||||
return reshare.get("author") && reshare.get("author").guid == app.currentUser.get("guid")})[0];
|
return reshare.get("author") && reshare.get("author").guid === app.currentUser.get("guid")})[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleLike : function() {
|
toggleLike : function() {
|
||||||
|
|
@ -126,11 +126,11 @@ app.models.Post.Interactions = Backbone.Model.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
userCanReshare : function(){
|
userCanReshare : function(){
|
||||||
var isReshare = this.post.get("post_type") == "Reshare"
|
var isReshare = this.post.get("post_type") === "Reshare"
|
||||||
, rootExists = (isReshare ? this.post.get("root") : true)
|
, rootExists = (isReshare ? this.post.get("root") : true)
|
||||||
, publicPost = this.post.get("public")
|
, publicPost = this.post.get("public")
|
||||||
, userIsNotAuthor = this.post.get("author").diaspora_id != app.currentUser.get("diaspora_id")
|
, userIsNotAuthor = this.post.get("author").diaspora_id !== app.currentUser.get("diaspora_id")
|
||||||
, userIsNotRootAuthor = rootExists && (isReshare ? this.post.get("root").author.diaspora_id != app.currentUser.get("diaspora_id") : true)
|
, userIsNotRootAuthor = rootExists && (isReshare ? this.post.get("root").author.diaspora_id !== app.currentUser.get("diaspora_id") : true)
|
||||||
, notReshared = !this.userReshare();
|
, notReshared = !this.userReshare();
|
||||||
|
|
||||||
return publicPost && app.currentUser.authenticated() && userIsNotAuthor && userIsNotRootAuthor && notReshared;
|
return publicPost && app.currentUser.authenticated() && userIsNotAuthor && userIsNotRootAuthor && notReshared;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ app.models.Stream = Backbone.Collection.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
isFetching : function() {
|
isFetching : function() {
|
||||||
return (this.deferred && this.deferred.state() == "pending");
|
return (this.deferred && this.deferred.state() === "pending");
|
||||||
},
|
},
|
||||||
|
|
||||||
triggerFetchedEvents : function(resp){
|
triggerFetchedEvents : function(resp){
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ app.models.User = Backbone.Model.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
isAuthorOf: function(model) {
|
isAuthorOf: function(model) {
|
||||||
return this.authenticated() && model.get("author").id == this.id;
|
return this.authenticated() && model.get("author").id === this.id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// @license-end
|
// @license-end
|
||||||
|
|
|
||||||
|
|
@ -143,10 +143,10 @@ app.Router = Backbone.Router.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_hideInactiveStreamLists: function() {
|
_hideInactiveStreamLists: function() {
|
||||||
if(this.aspects_list && Backbone.history.fragment != "aspects")
|
if(this.aspects_list && Backbone.history.fragment !== "aspects")
|
||||||
this.aspects_list.hideAspectsList();
|
this.aspects_list.hideAspectsList();
|
||||||
|
|
||||||
if(this.followedTagsView && Backbone.history.fragment != "followed_tags")
|
if(this.followedTagsView && Backbone.history.fragment !== "followed_tags")
|
||||||
this.followedTagsView.hideFollowedTags();
|
this.followedTagsView.hideFollowedTags();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,11 +157,11 @@ app.views.AspectMembershipBlueprint = Backbone.View.extend({
|
||||||
_pluralSummaryTxt: function(cnt) {
|
_pluralSummaryTxt: function(cnt) {
|
||||||
var all_aspects_cnt = this.dropdown.find('li').length;
|
var all_aspects_cnt = this.dropdown.find('li').length;
|
||||||
|
|
||||||
if( cnt == 1 ) {
|
if( cnt === 1 ) {
|
||||||
return this.dropdown.find('li.selected').first().text();
|
return this.dropdown.find('li.selected').first().text();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( cnt == all_aspects_cnt ) {
|
if( cnt === all_aspects_cnt ) {
|
||||||
return Diaspora.I18n.t('aspect_dropdown.all_aspects');
|
return Diaspora.I18n.t('aspect_dropdown.all_aspects');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ app.views.AspectsDropdown = app.views.Base.extend({
|
||||||
buttonText = Diaspora.I18n.t("aspect_dropdown.select_aspects");
|
buttonText = Diaspora.I18n.t("aspect_dropdown.select_aspects");
|
||||||
} else {
|
} else {
|
||||||
button.removeClass('btn-default').addClass(inAspectClass);
|
button.removeClass('btn-default').addClass(inAspectClass);
|
||||||
if (selectedAspects == 1) {
|
if (selectedAspects === 1) {
|
||||||
buttonText = this.$(".dropdown-menu > li.selected .text").first().text();
|
buttonText = this.$(".dropdown-menu > li.selected .text").first().text();
|
||||||
} else {
|
} else {
|
||||||
buttonText = Diaspora.I18n.t("aspect_dropdown.toggle", { count: selectedAspects.toString() });
|
buttonText = Diaspora.I18n.t("aspect_dropdown.toggle", { count: selectedAspects.toString() });
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ app.views.CommentStream = app.views.Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
keyDownOnCommentBox: function(evt) {
|
keyDownOnCommentBox: function(evt) {
|
||||||
if(evt.keyCode == 13 && evt.ctrlKey) {
|
if(evt.keyCode === 13 && evt.ctrlKey) {
|
||||||
this.$("form").submit();
|
this.$("form").submit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@ app.views.Comment = app.views.Content.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
ownComment : function() {
|
ownComment : function() {
|
||||||
return app.currentUser.authenticated() && this.model.get("author").diaspora_id == app.currentUser.get("diaspora_id");
|
return app.currentUser.authenticated() && this.model.get("author").diaspora_id === app.currentUser.get("diaspora_id");
|
||||||
},
|
},
|
||||||
|
|
||||||
postOwner : function() {
|
postOwner : function() {
|
||||||
return app.currentUser.authenticated() && this.model.get("parent").author.diaspora_id == app.currentUser.get("diaspora_id");
|
return app.currentUser.authenticated() && this.model.get("parent").author.diaspora_id === app.currentUser.get("diaspora_id");
|
||||||
},
|
},
|
||||||
|
|
||||||
canRemove : function() {
|
canRemove : function() {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ app.views.Contact = app.views.Base.extend({
|
||||||
removeContactFromAspect: function(){
|
removeContactFromAspect: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
this.model.aspect_memberships
|
this.model.aspect_memberships
|
||||||
.find(function(membership){ return membership.get('aspect').id == app.aspect.id; })
|
.find(function(membership){ return membership.get('aspect').id === app.aspect.id; })
|
||||||
.destroy({
|
.destroy({
|
||||||
success: function(){
|
success: function(){
|
||||||
self.render();
|
self.render();
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ app.views.Header = app.views.Base.extend({
|
||||||
toggleSearchActive: function(ev) {
|
toggleSearchActive: function(ev) {
|
||||||
// jQuery produces two events for focus/blur (for bubbling)
|
// jQuery produces two events for focus/blur (for bubbling)
|
||||||
// don't rely on which event arrives first, by allowing for both variants
|
// don't rely on which event arrives first, by allowing for both variants
|
||||||
var is_active = (_.indexOf(['focus','focusin'], ev.type) != -1);
|
var is_active = (_.indexOf(['focus','focusin'], ev.type) !== -1);
|
||||||
$(ev.target).toggleClass('active', is_active);
|
$(ev.target).toggleClass('active', is_active);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ app.views.Hovercard = app.views.Base.extend({
|
||||||
el = el.parents('a');
|
el = el.parents('a');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( el.attr('href').indexOf('/people') == -1 ) {
|
if( el.attr('href').indexOf('/people') === -1 ) {
|
||||||
// can't fetch data from that URL, aborting
|
// can't fetch data from that URL, aborting
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ app.views.InfScroll = app.views.Base.extend({
|
||||||
|
|
||||||
createPostView : function(post){
|
createPostView : function(post){
|
||||||
var postView = new this.postClass({ model: post, stream: this.stream });
|
var postView = new this.postClass({ model: post, stream: this.stream });
|
||||||
if (this.collection.at(0).id == post.id) {
|
if (this.collection.at(0).id === post.id) {
|
||||||
// post is first in collection - insert view at top of the list
|
// post is first in collection - insert view at top of the list
|
||||||
this.postViews.unshift(postView);
|
this.postViews.unshift(postView);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -46,7 +46,7 @@ app.views.InfScroll = app.views.Base.extend({
|
||||||
// called for every item inserted in this.collection
|
// called for every item inserted in this.collection
|
||||||
addPostView : function(post) {
|
addPostView : function(post) {
|
||||||
var el = this.createPostView(post).render().el;
|
var el = this.createPostView(post).render().el;
|
||||||
if (this.collection.at(0).id == post.id) {
|
if (this.collection.at(0).id === post.id) {
|
||||||
this.prependedPosts.insertBefore(el, this.prependedPosts.firstChild);
|
this.prependedPosts.insertBefore(el, this.prependedPosts.firstChild);
|
||||||
} else {
|
} else {
|
||||||
this.appendedPosts.appendChild(el);
|
this.appendedPosts.appendChild(el);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ app.views.PublisherAspectSelector = app.views.AspectsDropdown.extend({
|
||||||
|
|
||||||
// update the globe or lock icon
|
// update the globe or lock icon
|
||||||
var icon = this.$('#visibility-icon');
|
var icon = this.$('#visibility-icon');
|
||||||
if (target.find('.text').text().trim() == Diaspora.I18n.t('stream.public')) {
|
if (target.find('.text').text().trim() === Diaspora.I18n.t('stream.public')) {
|
||||||
icon.removeClass('lock');
|
icon.removeClass('lock');
|
||||||
icon.addClass('globe');
|
icon.addClass('globe');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ app.views.PublisherGettingStarted = Backbone.View.extend({
|
||||||
var close = $(popup).find('.close');
|
var close = $(popup).find('.close');
|
||||||
|
|
||||||
close.click(function() {
|
close.click(function() {
|
||||||
if( $('.popover').length==1 ) {
|
if( $('.popover').length === 1 ) {
|
||||||
$.get('/getting_started_completed', {success: function() {
|
$.get('/getting_started_completed', {success: function() {
|
||||||
$("#welcome-to-diaspora, #welcome-to-diaspora~br").remove();
|
$("#welcome-to-diaspora, #welcome-to-diaspora~br").remove();
|
||||||
}});
|
}});
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
var _this = this;
|
var _this = this;
|
||||||
$('body').on('click', function(event){
|
$('body').on('click', function(event){
|
||||||
// if the click event is happened outside the publisher view, then try to close the box
|
// if the click event is happened outside the publisher view, then try to close the box
|
||||||
if( _this.el && $(event.target).closest('#publisher').attr('id') != _this.el.id){
|
if( _this.el && $(event.target).closest('#publisher').attr('id') !== _this.el.id){
|
||||||
_this.tryClose();
|
_this.tryClose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -245,7 +245,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
|
|
||||||
// avoid submitting form when pressing Enter key
|
// avoid submitting form when pressing Enter key
|
||||||
avoidEnter: function(evt){
|
avoidEnter: function(evt){
|
||||||
if(evt.keyCode == 13)
|
if(evt.keyCode === 13)
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -276,7 +276,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
user;
|
user;
|
||||||
while( (user = regexp.exec(serializedForm["status_message[text]"])) ){
|
while( (user = regexp.exec(serializedForm["status_message[text]"])) ){
|
||||||
// user[1]: name, user[2]: handle
|
// user[1]: name, user[2]: handle
|
||||||
var mentioned_user = Mentions.contacts.filter(function(item) { return item.handle == user[2];})[0];
|
var mentioned_user = Mentions.contacts.filter(function(item) { return item.handle === user[2];})[0];
|
||||||
if(mentioned_user){
|
if(mentioned_user){
|
||||||
mentioned_people.push({
|
mentioned_people.push({
|
||||||
"id":mentioned_user["id"],
|
"id":mentioned_user["id"],
|
||||||
|
|
@ -309,7 +309,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
var previewMessage = {
|
var previewMessage = {
|
||||||
"id" : 0,
|
"id" : 0,
|
||||||
"text" : serializedForm["status_message[text]"],
|
"text" : serializedForm["status_message[text]"],
|
||||||
"public" : serializedForm["aspect_ids[]"]=="public",
|
"public" : serializedForm["aspect_ids[]"] === "public",
|
||||||
"created_at" : date,
|
"created_at" : date,
|
||||||
"interacted_at" : date,
|
"interacted_at" : date,
|
||||||
"post_type" : "StatusMessage",
|
"post_type" : "StatusMessage",
|
||||||
|
|
@ -350,7 +350,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
keyDown : function(evt) {
|
keyDown : function(evt) {
|
||||||
if( evt.keyCode == 13 && evt.ctrlKey ) {
|
if( evt.keyCode === 13 && evt.ctrlKey ) {
|
||||||
this.$("form").submit();
|
this.$("form").submit();
|
||||||
this.open();
|
this.open();
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -484,7 +484,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_beforeUnload: function(e) {
|
_beforeUnload: function(e) {
|
||||||
if(this._submittable() && this.el_input.val() != this.prefillText){
|
if(this._submittable() && this.el_input.val() !== this.prefillText){
|
||||||
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
|
var confirmationMessage = Diaspora.I18n.t("confirm_unload");
|
||||||
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
|
(e || window.event).returnValue = confirmationMessage; //Gecko + IE
|
||||||
return confirmationMessage; //Webkit, Safari, Chrome, etc.
|
return confirmationMessage; //Webkit, Safari, Chrome, etc.
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ app.views.SinglePostActions = app.views.Feedback.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
authorIsNotCurrentUser: function() {
|
authorIsNotCurrentUser: function() {
|
||||||
return app.currentUser.authenticated() && this.model.get("author").id != app.user().id;
|
return app.currentUser.authenticated() && this.model.get("author").id !== app.user().id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// @license-end
|
// @license-end
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ app.views.SinglePostModeration = app.views.Feedback.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
authorIsCurrentUser: function() {
|
authorIsCurrentUser: function() {
|
||||||
return app.currentUser.authenticated() && this.model.get("author").id == app.user().id;
|
return app.currentUser.authenticated() && this.model.get("author").id === app.user().id;
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyModel: function(evt) {
|
destroyModel: function(evt) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ app.views.TagFollowingList = app.views.Base.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$("input").bind('keydown', function(evt){
|
this.$("input").bind('keydown', function(evt){
|
||||||
if(evt.keyCode == 13 || evt.keyCode == 9 || evt.keyCode == 32){
|
if(evt.keyCode === 13 || evt.keyCode === 9 || evt.keyCode === 32){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
if( $('li.as-result-item.active').length === 0 ){
|
if( $('li.as-result-item.active').length === 0 ){
|
||||||
$('li.as-result-item').first().click();
|
$('li.as-result-item').first().click();
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ var AspectsDropdown = {
|
||||||
message = Diaspora.I18n.t("aspect_dropdown.stopped_sharing_with", {name: dropdown.data('person-short-name')});
|
message = Diaspora.I18n.t("aspect_dropdown.stopped_sharing_with", {name: dropdown.data('person-short-name')});
|
||||||
Diaspora.page.flashMessages.render({success: true, notice: message});
|
Diaspora.page.flashMessages.render({success: true, notice: message});
|
||||||
}
|
}
|
||||||
} else if (selectedAspects == allAspects) {
|
} else if (selectedAspects === allAspects) {
|
||||||
replacement = Diaspora.I18n.t('aspect_dropdown.all_aspects');
|
replacement = Diaspora.I18n.t('aspect_dropdown.all_aspects');
|
||||||
} else if (number == 1) {
|
} else if (number === 1) {
|
||||||
button.addClass(inAspectClass);
|
button.addClass(inAspectClass);
|
||||||
replacement = dropdown.find(".selected").first().text();
|
replacement = dropdown.find(".selected").first().text();
|
||||||
/* flash message prompt */
|
/* flash message prompt */
|
||||||
|
|
@ -40,7 +40,7 @@ var AspectsDropdown = {
|
||||||
// if we are in the publisher, we add the visibility icon
|
// if we are in the publisher, we add the visibility icon
|
||||||
if (isInPublisher) {
|
if (isInPublisher) {
|
||||||
var icon = $('#visibility-icon');
|
var icon = $('#visibility-icon');
|
||||||
if (replacement.trim() == Diaspora.I18n.t('stream.public')) {
|
if (replacement.trim() === Diaspora.I18n.t('stream.public')) {
|
||||||
icon.removeClass('lock');
|
icon.removeClass('lock');
|
||||||
icon.addClass('globe');
|
icon.addClass('globe');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ $.fn.clearForm = function() {
|
||||||
$(this).attr('checked', false);
|
$(this).attr('checked', false);
|
||||||
} else if ($(this).is('select')) {
|
} else if ($(this).is('select')) {
|
||||||
this.selectedIndex = -1;
|
this.selectedIndex = -1;
|
||||||
} else if ($(this).attr('name') == 'photos[]') {
|
} else if ($(this).attr('name') === 'photos[]') {
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
}
|
}
|
||||||
$(this).blur();
|
$(this).blur();
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ Diaspora.I18n = {
|
||||||
pluralizationKey: function(n) { return this.fallback.pluralizationKey(n); },
|
pluralizationKey: function(n) { return this.fallback.pluralizationKey(n); },
|
||||||
data: {},
|
data: {},
|
||||||
fallback: {
|
fallback: {
|
||||||
pluralizationKey: function(n) { return n == 1 ? "one" : "other"; },
|
pluralizationKey: function(n) { return n === 1 ? "one" : "other"; },
|
||||||
data: {}
|
data: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ $(document).ready(function(){
|
||||||
cBadge.html().replace(/\d+/, function(num){
|
cBadge.html().replace(/\d+/, function(num){
|
||||||
num = parseInt(num);
|
num = parseInt(num);
|
||||||
cBadge.html(parseInt(num)-1);
|
cBadge.html(parseInt(num)-1);
|
||||||
if(num == 1) {
|
if(num === 1) {
|
||||||
cBadge.addClass("hidden");
|
cBadge.addClass("hidden");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ Diaspora.Pages.UsersGettingStarted = function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
autocompleteInput.bind('keydown', function(evt){
|
autocompleteInput.bind('keydown', function(evt){
|
||||||
if(evt.keyCode == 13 || evt.keyCode == 9 || evt.keyCode == 32){
|
if(evt.keyCode === 13 || evt.keyCode === 9 || evt.keyCode === 32){
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
if( $('li.as-result-item.active').length === 0 ){
|
if( $('li.as-result-item.active').length === 0 ){
|
||||||
$('li.as-result-item').first().click();
|
$('li.as-result-item').first().click();
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ var View = {
|
||||||
$(this).attr('checked', false);
|
$(this).attr('checked', false);
|
||||||
} else if ($(this).is('select')) {
|
} else if ($(this).is('select')) {
|
||||||
this.selectedIndex = -1;
|
this.selectedIndex = -1;
|
||||||
} else if ($(this).attr('name') == 'photos[]') {
|
} else if ($(this).attr('name') === 'photos[]') {
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
}
|
}
|
||||||
$(this).blur();
|
$(this).blur();
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ jQuery.fn.center = (function() {
|
||||||
"data-full-photo": image.attr("data-full-photo")
|
"data-full-photo": image.attr("data-full-photo")
|
||||||
});
|
});
|
||||||
|
|
||||||
if(image.attr("data-full-photo") == imageUrl) {
|
if(image.attr("data-full-photo") === imageUrl) {
|
||||||
imageThumb = thumb;
|
imageThumb = thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
$('.notifications').scroll(function() {
|
$('.notifications').scroll(function() {
|
||||||
var bottom = $('.notifications').prop('scrollHeight') - $('.notifications').height();
|
var bottom = $('.notifications').prop('scrollHeight') - $('.notifications').height();
|
||||||
var currentPosition = $('.notifications').scrollTop();
|
var currentPosition = $('.notifications').scrollTop();
|
||||||
isLoading = ($('.loading').length == 1);
|
isLoading = ($('.loading').length === 1);
|
||||||
if (currentPosition + 50 >= bottom && notificationsLoaded <= self.notifications.length && !isLoading) {
|
if (currentPosition + 50 >= bottom && notificationsLoaded <= self.notifications.length && !isLoading) {
|
||||||
$('.notifications').addClass("loading");
|
$('.notifications').addClass("loading");
|
||||||
++currentPage;
|
++currentPage;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
var itemID = data["guid"];
|
var itemID = data["guid"];
|
||||||
var isUnread = data["unread"];
|
var isUnread = data["unread"];
|
||||||
self.notificationMenu.find('.read,.unread').each(function() {
|
self.notificationMenu.find('.read,.unread').each(function() {
|
||||||
if ( $(this).data("guid") == itemID ) {
|
if ( $(this).data("guid") === itemID ) {
|
||||||
if ( isUnread ) {
|
if ( isUnread ) {
|
||||||
self.notificationMenu.find('a#mark_all_read_link').removeClass('disabled');
|
self.notificationMenu.find('a#mark_all_read_link').removeClass('disabled');
|
||||||
self.setUpUnread( $(this) );
|
self.setUpUnread( $(this) );
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
$.timeago.settings.lang = Diaspora.I18n.language;
|
$.timeago.settings.lang = Diaspora.I18n.language;
|
||||||
$.timeago.settings.strings[Diaspora.I18n.language] = {};
|
$.timeago.settings.strings[Diaspora.I18n.language] = {};
|
||||||
$.each($.timeago.settings.strings["en"], function(index) {
|
$.each($.timeago.settings.strings["en"], function(index) {
|
||||||
if(index == "numbers") {
|
if(index === "numbers") {
|
||||||
$.timeago.settings.strings[Diaspora.I18n.language][index] = [];
|
$.timeago.settings.strings[Diaspora.I18n.language][index] = [];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ options:
|
||||||
bitwise: false
|
bitwise: false
|
||||||
camelcase: false
|
camelcase: false
|
||||||
curly: false
|
curly: false
|
||||||
eqeqeq: false
|
eqeqeq: true
|
||||||
forin: true
|
forin: true
|
||||||
freeze: true
|
freeze: true
|
||||||
immed: true
|
immed: true
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ describe("app.views.Help", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should initially show getting help section', function(){
|
it('should initially show getting help section', function(){
|
||||||
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_getting_help').toBeTruthy();
|
expect(this.view.$el.find('#faq').children().first().data('template')).toBe('faq_getting_help');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show account and data management section', function(){
|
it('should show account and data management section', function(){
|
||||||
|
|
@ -39,7 +39,7 @@ describe("app.views.Help", function(){
|
||||||
|
|
||||||
it('should show posts and posting section', function(){
|
it('should show posts and posting section', function(){
|
||||||
this.view.$el.find('a[data-section=posts_and_posting]').trigger('click');
|
this.view.$el.find('a[data-section=posts_and_posting]').trigger('click');
|
||||||
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_posts_and_posting').toBeTruthy();
|
expect(this.view.$el.find('#faq').children().first().data('template')).toBe('faq_posts_and_posting');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show private posts section', function(){
|
it('should show private posts section', function(){
|
||||||
|
|
@ -69,17 +69,17 @@ describe("app.views.Help", function(){
|
||||||
|
|
||||||
it('should show sharing section', function(){
|
it('should show sharing section', function(){
|
||||||
this.view.$el.find('a[data-section=sharing]').trigger('click');
|
this.view.$el.find('a[data-section=sharing]').trigger('click');
|
||||||
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_sharing').toBeTruthy();
|
expect(this.view.$el.find('#faq').children().first().data('template')).toBe('faq_sharing');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show tags section', function(){
|
it('should show tags section', function(){
|
||||||
this.view.$el.find('a[data-section=tags]').trigger('click');
|
this.view.$el.find('a[data-section=tags]').trigger('click');
|
||||||
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_tags').toBeTruthy();
|
expect(this.view.$el.find('#faq').children().first().data('template')).toBe('faq_tags');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show keyboard shortcuts section', function(){
|
it('should show keyboard shortcuts section', function(){
|
||||||
this.view.$el.find('a[data-section=keyboard_shortcuts]').trigger('click');
|
this.view.$el.find('a[data-section=keyboard_shortcuts]').trigger('click');
|
||||||
expect(this.view.$el.find('#faq').children().first().data('template') == 'faq_keyboard_shortcuts').toBeTruthy();
|
expect(this.view.$el.find('#faq').children().first().data('template')).toBe('faq_keyboard_shortcuts');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show miscellaneous section', function(){
|
it('should show miscellaneous section', function(){
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
url_to_match(requests[i])) {
|
url_to_match(requests[i])) {
|
||||||
matching_requests.push(requests[i]);
|
matching_requests.push(requests[i]);
|
||||||
} else {
|
} else {
|
||||||
if (requests[i].url == url_to_match) {
|
if (requests[i].url === url_to_match) {
|
||||||
matching_requests.push(requests[i]);
|
matching_requests.push(requests[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ describe("Locator", function(){
|
||||||
};
|
};
|
||||||
|
|
||||||
$.getJSON = function(url, myCallback){
|
$.getJSON = function(url, myCallback){
|
||||||
if(url == "https://nominatim.openstreetmap.org/reverse?format=json&lat=1&lon=2&addressdetails=3")
|
if(url === "https://nominatim.openstreetmap.org/reverse?format=json&lat=1&lon=2&addressdetails=3")
|
||||||
{
|
{
|
||||||
return myCallback({ display_name: 'locator address' });
|
return myCallback({ display_name: 'locator address' });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue