parent
77edc5105e
commit
b375bfa630
8 changed files with 17 additions and 15 deletions
|
|
@ -130,7 +130,7 @@ app.views.Hovercard = app.views.Base.extend({
|
||||||
// set hashtags
|
// set hashtags
|
||||||
this.hashtags.empty();
|
this.hashtags.empty();
|
||||||
this.hashtags.html($(_.map(person.profile.tags, function(tag) {
|
this.hashtags.html($(_.map(person.profile.tags, function(tag) {
|
||||||
return $("<a/>", {href: Routes.tag(tag)}).text("#" + tag)[0];
|
return $("<a></a>", {href: Routes.tag(tag)}).text("#" + tag)[0];
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ app.views.Location = Backbone.View.extend({
|
||||||
var locator = new OSM.Locator();
|
var locator = new OSM.Locator();
|
||||||
locator.getAddress(function(address, latlng){
|
locator.getAddress(function(address, latlng){
|
||||||
$(element).empty();
|
$(element).empty();
|
||||||
$("<input/>",
|
$("<input></input>",
|
||||||
{ id: "location_address",
|
{ id: "location_address",
|
||||||
value: address,
|
value: address,
|
||||||
type: "text",
|
type: "text",
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
};
|
};
|
||||||
|
|
||||||
var previewPost = new app.views.PreviewPost({model: new app.models.Post(previewMessage)}).render().el;
|
var previewPost = new app.views.PreviewPost({model: new app.models.Post(previewMessage)}).render().el;
|
||||||
return $("<div/>").append(previewPost).html();
|
return $("<div></div>").append(previewPost).html();
|
||||||
},
|
},
|
||||||
|
|
||||||
keyDown : function(evt) {
|
keyDown : function(evt) {
|
||||||
|
|
|
||||||
|
|
@ -185,8 +185,8 @@
|
||||||
|
|
||||||
addNewComments: function(bottomBar, data) {
|
addNewComments: function(bottomBar, data) {
|
||||||
if ($(".comment-container", bottomBar).length === 0) {
|
if ($(".comment-container", bottomBar).length === 0) {
|
||||||
$(".show-comments", bottomBar).after($("<div/>", {"class": "comment-container"}));
|
$(".show-comments", bottomBar).after($("<div></div>", {"class": "comment-container"}));
|
||||||
$(".comment-container", bottomBar).append($("<ul/>", {"class": "comments"}));
|
$(".comment-container", bottomBar).append($("<ul></ul>", {"class": "comments"}));
|
||||||
}
|
}
|
||||||
$(".comment-container .comments", bottomBar).append(data);
|
$(".comment-container .comments", bottomBar).append(data);
|
||||||
},
|
},
|
||||||
|
|
@ -212,8 +212,10 @@
|
||||||
var postGuid = bottomBar.parents(".stream-element").data("guid");
|
var postGuid = bottomBar.parents(".stream-element").data("guid");
|
||||||
|
|
||||||
toggleReactionsLink.remove();
|
toggleReactionsLink.remove();
|
||||||
toggleReactionsLink = $("<a/>", {"class": "show-comments", "href": Routes.postComments(postGuid) + ".mobile"})
|
toggleReactionsLink = $("<a></a>", {
|
||||||
.html(text + "<i class='entypo-chevron-up'/>");
|
"class": "show-comments",
|
||||||
|
"href": Routes.postComments(postGuid) + ".mobile"
|
||||||
|
}).html(text + "<i class='entypo-chevron-up'/>");
|
||||||
parent.prepend(toggleReactionsLink);
|
parent.prepend(toggleReactionsLink);
|
||||||
bottomBar.removeClass("inactive").addClass("active");
|
bottomBar.removeClass("inactive").addClass("active");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ $(document).ready(function(){
|
||||||
if(hiddenField.length > 0) { hiddenField.remove(); }
|
if(hiddenField.length > 0) { hiddenField.remove(); }
|
||||||
else {
|
else {
|
||||||
$("#new_status_message").append(
|
$("#new_status_message").append(
|
||||||
$("<input/>", {
|
$("<input></input>", {
|
||||||
name: "services[]",
|
name: "services[]",
|
||||||
type: "hidden",
|
type: "hidden",
|
||||||
value: provider
|
value: provider
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ describe("app", function() {
|
||||||
|
|
||||||
describe("setupForms", function() {
|
describe("setupForms", function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
spec.content().append("<textarea/> <input/>");
|
spec.content().append("<textarea></textarea> <input></input>");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("calls jQuery.placeholder() for inputs", function() {
|
it("calls jQuery.placeholder() for inputs", function() {
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ describe("app.views.Base", function(){
|
||||||
},
|
},
|
||||||
|
|
||||||
postRenderTemplate : function(){
|
postRenderTemplate : function(){
|
||||||
$(this.el).append("<div class=subview1/>");
|
$(this.el).append("<div class=subview1></div>");
|
||||||
$(this.el).append("<div class=subview2/>");
|
$(this.el).append("<div class=subview2></div>");
|
||||||
},
|
},
|
||||||
|
|
||||||
createSubview2 : function(){
|
createSubview2 : function(){
|
||||||
|
|
@ -121,7 +121,7 @@ describe("app.views.Base", function(){
|
||||||
it("replaces .time with relative time ago in words", function() {
|
it("replaces .time with relative time ago in words", function() {
|
||||||
this.view.templateName = false;
|
this.view.templateName = false;
|
||||||
spyOn($.fn, "timeago");
|
spyOn($.fn, "timeago");
|
||||||
this.view.$el.append("<time/>");
|
this.view.$el.append("<time></time>");
|
||||||
this.view.render();
|
this.view.render();
|
||||||
expect($.fn.timeago).toHaveBeenCalled();
|
expect($.fn.timeago).toHaveBeenCalled();
|
||||||
expect($.fn.timeago.calls.mostRecent().object.first().is("time")).toBe(true);
|
expect($.fn.timeago.calls.mostRecent().object.first().is("time")).toBe(true);
|
||||||
|
|
@ -145,7 +145,7 @@ describe("app.views.Base", function(){
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
this.view.$el.htmlOriginal = this.view.$el.html;
|
this.view.$el.htmlOriginal = this.view.$el.html;
|
||||||
spyOn(this.view.$el, "html").and.callFake(function() {
|
spyOn(this.view.$el, "html").and.callFake(function() {
|
||||||
this.htmlOriginal("<input><textarea/></input>");
|
this.htmlOriginal("<input><textarea></textarea></input>");
|
||||||
return this;
|
return this;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ describe("Diaspora.Mobile.Comments", function(){
|
||||||
var parent = this.toggleReactionsLink.parent();
|
var parent = this.toggleReactionsLink.parent();
|
||||||
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
|
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
|
||||||
this.toggleReactionsLink.remove();
|
this.toggleReactionsLink.remove();
|
||||||
parent.prepend($("<span/>", {"class": "show-comments"}).text("0 comments"));
|
parent.prepend($("<span></span>", {"class": "show-comments"}).text("0 comments"));
|
||||||
|
|
||||||
Diaspora.Mobile.Comments.increaseReactionCount(this.bottomBar);
|
Diaspora.Mobile.Comments.increaseReactionCount(this.bottomBar);
|
||||||
this.toggleReactionsLink = this.bottomBar.find(".show-comments").first();
|
this.toggleReactionsLink = this.bottomBar.find(".show-comments").first();
|
||||||
|
|
@ -160,7 +160,7 @@ describe("Diaspora.Mobile.Comments", function(){
|
||||||
var parent = this.toggleReactionsLink.parent();
|
var parent = this.toggleReactionsLink.parent();
|
||||||
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
|
var postGuid = this.bottomBar.parents(".stream-element").data("guid");
|
||||||
this.toggleReactionsLink.remove();
|
this.toggleReactionsLink.remove();
|
||||||
parent.prepend($("<span/>", {"class": "show-comments"}).text("Aucun commentaire"));
|
parent.prepend($("<span></span>", {"class": "show-comments"}).text("Aucun commentaire"));
|
||||||
|
|
||||||
Diaspora.Mobile.Comments.increaseReactionCount(this.bottomBar);
|
Diaspora.Mobile.Comments.increaseReactionCount(this.bottomBar);
|
||||||
this.toggleReactionsLink = this.bottomBar.find(".show-comments").first();
|
this.toggleReactionsLink = this.bottomBar.find(".show-comments").first();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue