/**
* Perforce Swarm, Community Development
*
* @copyright 2015 Perforce Software. All rights reserved.
* @license Please see LICENSE.txt in top-level folder of this distribution.
* @version <release>/<patch>
*/
$(document).ready( function() {
// load readme files via ajax
if ($('body').hasClass('route-project')) {
var url = window.location.pathname;
if (url.substr(-1, 1) == '/') {
url = url.slice(0, -1);
}
var projectId = url.split('/').pop();
// fetch current readme, if available
$.ajax({
url: swarm.url('/project/readme/' + projectId),
type: "GET",
global: false,
success: function(data) {
if (data.readme) {
$('.project-readme').html(data.readme);
// fix images
$('.project-readme img').each(function() {
var href = $(this).attr('src');
// look for external references, if not, assume local
if (href.indexOf('/') !== 0) {
$(this).attr('src', swarm.url(data.baseUrl + href));
}
});
}
}
});
}
// update toolbar
if ($('body').hasClass('route-project')
|| $('body').hasClass('route-project-activity')
|| $('body').hasClass('route-project-reviews')
|| $('body').hasClass('route-project-browse')
|| $('body').hasClass('route-project-jobs')) {
var url = window.location.pathname;
if (url.substr(-1, 1) == '/') {
url = url.slice(0, -1);
}
var urlRoute = url.split('/');
var projectId = urlRoute[urlRoute.length - 2];
if ($('body').hasClass('route-project')) {
projectId = urlRoute.pop();
}
// add Activity link
var activity = '<li';
if ($('body').hasClass('route-project-activity')) {
activity += ' class="active"';
}
activity += '><a class="activity-link" href="' + swarm.url('/projects/' + projectId + '/activity/') + '">Activity</a></li>';
$('.project-navbar .navbar-inner .nav li a.overview-link').parent().after(activity);
}
});
# |
Change |
User |
Description |
Committed |
|
#1
|
24084 |
simonrenger |
"Forking branch Main of perforce-software-workshop to simonrenger-workshop." |
|
|
//guest/perforce_software/workshop/main/markdown/public/custom/Markdown/markdown.js |
#1
|
15568 |
Matt Attaway |
Move all of the workshop files into main branch to make Workshop happy |
|
|
//guest/perforce_software/workshop/markdown/public/custom/Markdown/markdown.js |
#1
|
12233 |
Matt Attaway |
Move public files to match with other projects |
|
|
//guest/perforce_software/workshop/markdown/public/markdown.js |
#1
|
12228 |
Thomas Gray |
Publish the source code for the Workshop markdown module |
|
|