Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

136 lines (117 sloc) 6.55 kB
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Copyright (C) 2009 eXo Platform SAS.
This is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of
the License, or (at your option) any later version.
This software 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this software; if not, write to the Free
Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->
<Module>
<ModulePrefs author="Jeremi Joslin - eXo Platform"
title="Sonar - Code overview"
directory_title="Sonar - Code overview"
title_url="http://www.exoplatform.com"
description="Sonar gadget."
author_email="jeremi23@gmail.com">
<Require feature="dynamic-height" />
<Require feature="setprefs"/>
<Require feature="settitle"/>
</ModulePrefs>
<UserPref name="sonar_url" datatype="string" default_value="http://sonar.exoplatform.org/"/>
<UserPref name="sonar_project" datatype="string"/>
<UserPref name="is_configured" datatype="hidden" default_value="0"/>
<Content type="html">
<![CDATA[
<link href="http://exogadgets.appspot.com/static/sonar/style.css" media="all" rel="stylesheet" type="text/css" />
<!-- use the full URL because Jira does not rewrite them -->
<script type="text/javascript" src="http://exogadgets.appspot.com/static/sonar/jquery.js"></script>
<script type="text/javascript" src="http://exogadgets.appspot.com/static/sonar/sonar.js"></script>
<script type="text/javascript">
function update_metrics() {
sonar.GetMetrics("ncloc,lines,classes,packages,functions,accessors", function(res) {
var resource = res.data[0];
var prefs = new gadgets.Prefs();
var sonar_url = prefs.getString("sonar_url");
$("#resource_name").text(resource.name);
$("#resource_description").text(resource.description);
for (var i = 0; i < resource.msr.length; i++) {
var metric = resource.msr[i];
$("#m_" + metric.key).text(metric.frmt_val);
$("#l_" + metric.key).attr("href", sonar_url + "drilldown/measures/" + resource.id + "?metric=" + metric.key);
if (metric["var"]) {
$("#t_" + metric.key).attr("src", sonar_url + "images/tendency/" + metric["var"] + "-black-small.png");
$("#t_" + metric.key).show();
} else {
$("#t_" + metric.key).hide();
}
}
gadgets.window.adjustHeight($(document).height());
}, {includetrends: "true"});
}
$(function() {
$("#preferences").bind("finish_edit", function(){update_metrics();});
var prefs = new gadgets.Prefs();
$("#edit").click(sonar.EditPreferences);
if (prefs.getString("is_configured") === "0"){
sonar.EditPreferences();
} else {
update_metrics();
}
});
</script>
<div id="container">
<!-- our template of code -->
<div id="body">
<h1 id="resource_name"></h1>
<span id="resource_description"></span> <a href="#" id="edit">Edit</a>
<table width="100%" style="margin-top:10px">
<tr>
<td valign="top" width="48%" nowrap>
<div class="dashbox">
<h3>Lines of code</h3>
<p><span class="big">
<a href='' id='l_ncloc' target="_blank"><span id='m_ncloc' class=''></span></a><img src="" id="t_ncloc" style="display:none;"/></span></p>
<p><a href='' id='l_lines' target="_blank"><span id='m_lines' class=''></span> lines</a><img src="" id="t_lines" style="display:none;"/></p>
</div>
</td>
<td width="10"> </td>
<td valign="top">
<div class="dashbox">
<h3>Classes</h3>
<p><span class="big"><a href='' id='l_classes' target="_blank"><span id='m_classes' class=''></span></a><img src="" id="t_classes" style="display:none;"/></p>
<p><a href='' id='l_packages' target="_blank"><span id='m_packages' class=''></span> packages</a><img src="" id="t_packages" style="display:none;"/></p>
<p><a href='' id='l_functions' target="_blank"><span id='m_functions' class=''></span> methods</a><img src="" id="t_functions" style="display:none;"/></p>
<p><a href='' id='l_accessors' target="_blank">+<span id='m_accessors' class=''></span> accessors</a><img src="" id="t_accessors" style="display:none;"/></p>
</div>
</td>
</tr>
</table>
</div>
<!-- The template of preferences -->
<div id="preferences" style="display:none;">
<form>
<fieldset>
<label for="id_url">Sonar Server: </label>
<span class="help">e.g.: http://sonar.exoplatform.org/</span>
<input type="text" name="url" id="id_url" />
<label for="id_project" style="margin-top:10px">Project</label>
<div><select name="project" id="id_project"></select></div>
</fieldset>
<input type="submit" value="Save" />
</form>
<div id="footer">
<a href="http://www.exoplatform.com" style="float:left;" target="_blank"><img src="http://www.exoplatform.com/portal/favicon.ico" style="margin-right:5px;"/>eXo Platform</a>
</div>
</div>
</div>
]]>
</Content>
</Module>
Jump to Line
Something went wrong with that request. Please try again.