Author: tchemit Date: 2012-04-18 11:06:28 +0200 (Wed, 18 Apr 2012) New Revision: 545 Url: http://forge.codelutin.com/repositories/revision/echobase/545 Log: use common maven-site js script Removed: trunk/src/site/resources/maven-site-forge.codelutin.com.js Modified: trunk/src/site/site_fr.xml Deleted: trunk/src/site/resources/maven-site-forge.codelutin.com.js =================================================================== --- trunk/src/site/resources/maven-site-forge.codelutin.com.js 2012-04-13 13:14:54 UTC (rev 544) +++ trunk/src/site/resources/maven-site-forge.codelutin.com.js 2012-04-18 09:06:28 UTC (rev 545) @@ -1,82 +0,0 @@ -/* - * #%L - * EchoBase - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2011 - 2012 Ifremer, Codelutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * #L% - */ -$(document).ready(function () { - - var metas = $('#projectMetas'); - var piwikEnabled = metas.attr('piwikEnabled'); - if (piwikEnabled) { - //Piwik Tracking Code - var piwikId = metas.attr('piwikId'); - if (!piwikId) { - - // default piwikId for forge.codelutin.com - piwikId = 4; - } - - console.log("use Piwik with id = " + piwikId); - var pkBaseURL = "https:" == document.location.protocol ? - "https://piwik.codelutin.com/" : - "http://piwik.codelutin.com/"; - $.getScript(pkBaseURL + "piwik.js", function (data, textStatus, jqxhr) { - var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", piwikId); - piwikTracker.trackPageView(); - piwikTracker.enableLinkTracking(); - console.log("piwikTracker loaded = " + piwikTracker); - }); - //Piwik Tracking Code - } - var scmwebeditorenabled = metas.attr('scmwebeditorenabled'); - var scm = metas.attr('scm'); - 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/', ''); - } else { - if (pathname == '/' + projectId + '/') { - // on / page - path = 'index.html'; - } else { - path = pathname.substr(pathname.indexOf('/' + projectId)). - replace('/' + projectId + '/', ''); - } - } - path = path.replace('.html', '.' + siteSourcesType); - var url = scmurl + "?address=" + scm + "/src/site/" + siteSourcesType + "/" + path; - console.log("Add scmwebeditor with url = " + url); - var html = "<li class='pull-right'><a href='" + url + - "'>Éditer la page</a></li>" + - "<li class='divider pull-right'>|</li>"; - var ul = $('#publishDate'); - ul.prepend(html); - - } -}); \ No newline at end of file Modified: trunk/src/site/site_fr.xml =================================================================== --- trunk/src/site/site_fr.xml 2012-04-13 13:14:54 UTC (rev 544) +++ trunk/src/site/site_fr.xml 2012-04-18 09:06:28 UTC (rev 545) @@ -101,11 +101,12 @@ <menu ref="reports"/> - <menu ref="modules"/> + <!--menu ref="modules"/--> <footer> - <script type="text/javascript" src="./maven-site-forge.codelutin.com.js"> + <script type="text/javascript" + src="http://maven-site.forge.codelutin.com/public/js/maven-site-forge.codelutin.com.js"> </script> <div id='projectMetas'