Quantcast

[sonar-dev] Question about the management of global widget's title

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[sonar-dev] Question about the management of global widget's title

David François

Hi all,

 

I’m working on a plugin to display the number of projects and the number of LOC by language.

I want to display the result in a global widget.

 

My problem is on the management of the widget title. When I look the _widget_title.html.erb file, I see the title can be either the name of one filter or the name of the resource associated to the widget.

But my widget is not a filter and is not associated with one resource. Is there another way to define the title because if I use directly this instruction : <div class="widget-title">Number of projects</div>', I have spacing between the widget border and the title bloc :

 

 

Thanks.

 

Regards,

David FRANCOIS


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Question about the management of global widget's title

David Gageot
Hi David,

I've got too options for you:

 + It's not possible.
 + You can hack it anyway by adding this piece of code in your widget.
    Beware, this is really a hack and will sure be broken in any future version.

<script type="text/javascript">
var title=document.createElement('div');
title.setAttribute('class', 'widget-title');
title.setAttribute('className', 'widget-title');
title.appendChild(document.createTextNode('NICE TITLE'));

var block=document.getElementById('block_<%= widget.id -%>');
block.insertBefore(title, block.firstChild) ;
</script>

David.


On 26 June 2012 13:51, Francois, David <[hidden email]> wrote:

Hi all,

 

I’m working on a plugin to display the number of projects and the number of LOC by language.

I want to display the result in a global widget.

 

My problem is on the management of the widget title. When I look the _widget_title.html.erb file, I see the title can be either the name of one filter or the name of the resource associated to the widget.

But my widget is not a filter and is not associated with one resource. Is there another way to define the title because if I use directly this instruction : <div class="widget-title">Number of projects</div>', I have spacing between the widget border and the title bloc :

 

 

Thanks.

 

Regards,

David FRANCOIS


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



--
-- David
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [sonar-dev] Question about the management of global widget's title

Simon Brandhof
Hi,

Could you please create a JIRA issue in order to provide custom widget titles ?

Thanks

On 28 June 2012 09:37, David Gageot <[hidden email]> wrote:
Hi David,

I've got too options for you:

 + It's not possible.
 + You can hack it anyway by adding this piece of code in your widget.
    Beware, this is really a hack and will sure be broken in any future version.

<script type="text/javascript">
var title=document.createElement('div');
title.setAttribute('class', 'widget-title');
title.setAttribute('className', 'widget-title');
title.appendChild(document.createTextNode('NICE TITLE'));

var block=document.getElementById('block_<%= widget.id -%>');
block.insertBefore(title, block.firstChild) ;
</script>

David.


On 26 June 2012 13:51, Francois, David <[hidden email]> wrote:

Hi all,

 

I’m working on a plugin to display the number of projects and the number of LOC by language.

I want to display the result in a global widget.

 

My problem is on the management of the widget title. When I look the _widget_title.html.erb file, I see the title can be either the name of one filter or the name of the resource associated to the widget.

But my widget is not a filter and is not associated with one resource. Is there another way to define the title because if I use directly this instruction : <div class="widget-title">Number of projects</div>', I have spacing between the widget border and the title bloc :

 

 

Thanks.

 

Regards,

David FRANCOIS


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



--
-- David

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: [sonar-dev] Question about the management of global widget's title

David François

Hi,

 

JIRA issue created : http://jira.codehaus.org/browse/SONAR-3628

 

Regards,

David FRANCOIS

 

De : Simon Brandhof [mailto:[hidden email]]
Envoyé : jeudi 28 juin 2012 09:58
À : [hidden email]
Objet : Re: [sonar-dev] Question about the management of global widget's title

 

Hi,

Could you please create a JIRA issue in order to provide custom widget titles ?

Thanks

On 28 June 2012 09:37, David Gageot <[hidden email]> wrote:

Hi David,

 

I've got too options for you:

 

 + It's not possible.

 + You can hack it anyway by adding this piece of code in your widget.

    Beware, this is really a hack and will sure be broken in any future version.

 

<script type="text/javascript">

var title=document.createElement('div');

title.setAttribute('class', 'widget-title');

title.setAttribute('className', 'widget-title');

title.appendChild(document.createTextNode('NICE TITLE'));

 

var block=document.getElementById('block_<%= widget.id -%>');

block.insertBefore(title, block.firstChild) ;

</script>

 

David.

 

On 26 June 2012 13:51, Francois, David <[hidden email]> wrote:

Hi all,

 

I’m working on a plugin to display the number of projects and the number of LOC by language.

I want to display the result in a global widget.

 

My problem is on the management of the widget title. When I look the _widget_title.html.erb file, I see the title can be either the name of one filter or the name of the resource associated to the widget.

But my widget is not a filter and is not associated with one resource. Is there another way to define the title because if I use directly this instruction : <div class="widget-title">Number of projects</div>', I have spacing between the widget border and the title bloc :

 

 

Thanks.

 

Regards,

David FRANCOIS


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



 

--
-- David

 


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
Loading...