-
Notifications
You must be signed in to change notification settings - Fork 512
[WIP] Fix issue 2012: Make remix button working #2027
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,12 +188,15 @@ define(["jquery", "analytics"], function($, analytics) { | |
newItem.find(".description").text(activity.description); | ||
|
||
// Check if activity_url ends with a slash, if it doesn't - add one before adding "remix" | ||
var remix = "remix"; | ||
/*var remix = "remix"; | ||
var endsWithSlash = (activity.url.charAt(activity.url.length-1) === "/"); | ||
if(!endsWithSlash) { | ||
remix = "/remix"; | ||
} | ||
newItem.find(".remix").attr("href", activity.url + remix); | ||
*/ | ||
//WIP: see the discussion on: https://github.com/mozilla/thimble.mozilla.org/issues/2012 | ||
newItem.find(".remix").attr("href", "https://thimble.mozilla.org/projects/" + (activity.url).match(/\d+/)[0] + "/remix"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to suggest another fix here because regexing urls can be brittle. {
"title" : "Back to School Postcard",
"thumbnail_url" : "https://thimble.mozilla.org/img/thumbnail-postcard.png",
"url" : "https://thimbleprojects.org/mozillalearning/220079/",
"description" : "Add your own content to this interactive postcard.",
"tags" : ["images","code","javascript","interactive","js"],
"teaching_kit_url" : "https://thimbleprojects.org/mozillalearning/62/",
"featured" : true,
"author" : "mozilla",
"author_url" : "http://learning.mozilla.org"
} would change to {
"title" : "Back to School Postcard",
"thumbnail_url" : "https://thimble.mozilla.org/img/thumbnail-postcard.png",
"url" : "https://thimbleprojects.org/mozillalearning/220079/",
"projectID" : 220079,
"description" : "Add your own content to this interactive postcard.",
"tags" : ["images","code","javascript","interactive","js"],
"teaching_kit_url" : "https://thimbleprojects.org/mozillalearning/62/",
"featured" : true,
"author" : "mozilla",
"author_url" : "http://learning.mozilla.org"
} Then, out here, change this line to: newItem.find(".remix").attr("href", "/projects/" + activity.projectID + "/remix"); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gideonthomas There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because it stores the username part of the url which is needed. |
||
if(activity.teaching_kit_url) { | ||
newItem.find(".teaching-kit").attr("href", activity.teaching_kit_url).removeClass("hidden"); | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to comment out all of this, just remove it.