Author: tchemit Date: 2012-04-13 02:48:09 +0200 (Fri, 13 Apr 2012) New Revision: 535 Url: http://forge.codelutin.com/repositories/revision/echobase/535 Log: improve js Modified: trunk/src/site/resources/maven-site-forge.codelutin.com.js Modified: trunk/src/site/resources/maven-site-forge.codelutin.com.js =================================================================== --- trunk/src/site/resources/maven-site-forge.codelutin.com.js 2012-04-13 00:39:14 UTC (rev 534) +++ trunk/src/site/resources/maven-site-forge.codelutin.com.js 2012-04-13 00:48:09 UTC (rev 535) @@ -28,7 +28,7 @@ if (piwikEnabled) { //Piwik Tracking Code var piwikId = metas.attr('piwikId'); - if (!!piwikId) { + if (!piwikId) { // default piwikId for forge.codelutin.com piwikId = 4; @@ -51,16 +51,23 @@ if (scmwebeditorenabled && scm.indexOf("/trunk") > -1) { // allow scmwebeditor is enabled and on trunk - + var scmurl = metas.attr('scmwebeditorurl'); var projectId = metas.attr('projectId'); var siteSourcesType = metas.attr('siteSourcesType'); var path; var pathname = document.location.pathname; if (pathname.indexOf('target/site') > 0) { - path = pathname.substr(pathname.indexOf('/site')).replace('/site/', ''); + path = pathname.substr(pathname.indexOf('/site')). + replace('/site/', ''); } else { - path = pathname.substr(pathname.indexOf('/' + projectId)).replace('/' + projectId, ''); + if (pathname == '/' + projectId + '/') { + // on / page + path = 'install.html'; + } else { + path = pathname.substr(pathname.indexOf('/' + projectId)). + replace('/' + projectId + '/', ''); + } } path = path.replace('.html', '.' + siteSourcesType); var url = scmurl + "?address=" + scm + "/src/site/" + siteSourcesType + "/" + path;
participants (1)
-
tchemit@users.forge.codelutin.com