How to remove loading window from Jasper Server - jasperserver

I want to remove the loading window, that appears when report loads/refresh.
How to do this?
Can anyone tell me the file name in the jasper server installation directory that should I change at least?

On loading.jsp file in the Jasper Server installation directory(tomcat\webapps\jasperserver\WEB-INF\jsp\templates\loading.jsp) comment below part
<t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
<t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
<t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
<t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
<t:putAttribute name="headerClass" value="mover"/>
<t:putAttribute name="bodyContent" >
<p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
<button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
</t:putAttribute>
</t:insertTemplate>
When you do like above example, loading window will be disappear from everywhere.
To remove loading for a specific report,
put two div tags with id attribute. then hide the div using js code.
Below I shown the example;
<div id="prabu">
<div id="x3">
<t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
<t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
<t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
<t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
<t:putAttribute name="headerClass" value="mover"/>
<t:putAttribute name="bodyContent" >
<p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
<button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
</t:putAttribute>
</t:insertTemplate>
</div>
</div>
Then add below javascript code;
<script>
var url = window.location.href; //take current tab url
var dash = 'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Original__2_&standAlone=true';
if(url === dash ){
removeElement("x3");
}
function removeElement(elementId) {
// Removes an element from the document
var element = document.getElementById(elementId);
element.parentNode.removeChild(element);
}
</script>
In my case, I use a report as my dashboard and I refresh it in every 1 minute.So I want to remove loading window for my dashboard report only.
On js code,
url is current url from the browser.
dash is the my dashboard report url.

Related

Fetching dynamic id and url from image with JS

I'm implementing a fancybox into my project and I'm writing a script to automatically wrap an anchor around the images with the url to the image and a "data-fancybox" attribute to let the fancybox script do its thing. However, I'm only getting the url to the very first image, since they all share the same class. There is a dynamic figure id that seems to be the one to get.
My question is - how do I use this figure id to fetch the appropriate img src?
The html is like this:
<figure id="XXXXXXX">
<div>
<img src="image.jpg" />
</div>
</figure>
... other stuff ...
<figure id="YYYYYYY">
<div>
<img src="image2.jpg" alt="">
</div>
</figure>
My code right now is as follows (which works, but only returns the first image url):
$(document).ready(function() {
var src = $("figure img").attr("src");
var a = $("<a/>").attr( { href:src , "data-fancybox":"" } );
$("figure img").wrap(a);
});
I know I can use
var id = $("figure").attr("id");
to get the id I need, but I'm pretty new to coding so I'm not sure how I implement this and use it to get the correct url. Any help is appreciated!
If your goal is to make your images clickable, then you can do smth like this:
$('figure img').each(function() {
$(this).parent().css({cursor: 'pointer'}).attr('data-fancybox', 'gallery').attr('data-src', this.src);
});
DEMO - https://jsfiddle.net/1jznsL7x/
Tip: There is no need to create anchor elements, you can add data-fancybox and data-src attributes to any element and it will work automagically.

How to show button on selection of a value from the angular material select dropdown

Once i select a dropdown value from a dropdown field i want a section in another div to be loaded
ngif would help me do this, but how could i add this as a condition for the display of that section
Any dropdown selected should open that section
Later would customise it to different other sections in a div to load based on selection of the different dropdowns values accordingly
This can be solve by using selectionchange event emmiter function, whenever you select a value from the dropdown you can call an eventemmiter function. See the code below:
Html Code:
<div>
<mat-select placeholder="Options"
(selectionChange)="onSelecetionChange($event.value)">
<mat-option value="individual ">Individual </mat-option>
<mat-option value="business">Business</mat-option>
</mat-select>
</div>
<div *ngIf="individual">
Individual Div
</div>
<div *ngIf="business">
Business Div
</div>
My ts code:
individual: boolean;
business: boolean;
onSelecetionChange( value: string ) {
if( value === 'individual') {
// You can add some service call or customize your data from here
this.individual = true;
}
if( value === 'business') {
// You can add some service call or customize your data from here
this.business = true;
}
}

Create a subpart menu for a one page template in typo3

I integrate a one page parallax template in typo 3 in this i want to get a menu like below so i can access specific content on click , in a subpart of page object.
<ul class="nav navbar-nav navbar-right">
<li>HOME</li>
<li>ABOUT</li>
<li>PRICING</li>
<li>CONTACT</li>
<li>Call: +23-689-90 </li>
</ul>
Try
temp.contentnav = CONTENT
temp.contentnav {
table = tt_content
select {
pidInList = this
orderBy = sorting
where = colPos=0
languageField=sys_language_uid
}
renderObj = TEXT
renderObj {
field = header
wrap=|
typolink.parameter.field=pid
typolink.parameter.dataWrap=|#{field:uid}
if.isTrue.field=header
}
}
So you will get an menu of all items. Then again, you won't like that the menu item's title is taken from the header field. If your site is very small and you keep control over it, why don't you just hardcode this (look at the source, by default, each article has an id).
PS I copied that from http://www.typo3wizard.com/en/snippets/menus/content-element-navigation.html
EDIT on your getting started with TS question:
In your HTML Template:
<html>...
<!-- ###CONTENTNAV### START --><!-- ###CONTENTRIGHT### END -->
...</html>
In your TypoScript setup:
page.10.subparts {
# we fill the "subpart" (that's how this type of marker is called) with the temp object
CONTENTNAV < temp.contentnav
}
So the caret pointing left tells TYPO3 that in that region ("subpart"), it should add the content menu you've created with the TS snippet.
Note that you can also use "Marks" (###CONTENTNAV###, don't need start and end commentary, assign with page.10.marks) and the more modern fluid templates (<f:format.html>{contentnav}</f:format.html>), which are the future. You could start here: http://typo3buddy.com/typo3-template-tutorial/fluid/

Jquery Accordion choosing correct selector

I'm struggling with plugging in the correct selector into jquery. When I plug in ".accordionButton" the entire div is clickable and the functionality works great. However, I want to make only the "h3.toggle a" clickable, but plugging that selector in doesn't work. Is there something else in the jquery I need to change here? Any advice is greatly appreciated. Thanks!
The HTML:
<div class="accordionButton">
<div class="case-top">
<div class="case-left"></div>
<div class="case-right">
<h3 class="toggle">Our Strategy and Results</h3>
</div>
</div><!--end case-top-->
</div><!--end button-->
<div class="accordionContent">sliding content here</div>
The JQUERY:
$(document).ready(function() {
//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
$('.accordionButton h3.toggle a').click(function() {
//REMOVE THE ON CLASS FROM ALL BUTTONS
$('.accordionButton h3.toggle a').removeClass('on');
//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
$('.accordionContent').slideUp('normal');
//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
if($(this).next().is(':hidden') == true) {
//ADD THE ON CLASS TO THE BUTTON
$(this).addClass('on');
//OPEN THE SLIDE
$(this).next().slideDown('normal');
}
});
/*** REMOVE IF MOUSEOVER IS NOT REQUIRED ***/
//ADDS THE .OVER CLASS FROM THE STYLESHEET ON MOUSEOVER
$('.accordionButton h3.toggle a').mouseover(function() {
$(this).addClass('over');
//ON MOUSEOUT REMOVE THE OVER CLASS
}).mouseout(function() {
$(this).removeClass('over');
});
$('.accordionContent').hide();
});
You are using
$(this)
but you change the selector, you need to change all $(this) selectors to
$('.accordionButton')
FIDDLE
Ok, here is where I'm at... the buttons are now working correctly, but on click all the instances of .accordionContent open, not just next one. ( FYI, I removed the mouseover from this code snipped)
Jquery
$(document).ready(function() {
//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
$('.accordionButton h3.toggle a').click(function() {
//REMOVE THE ON CLASS FROM ALL BUTTONS
$('.accordionButton h3.toggle a').removeClass('on');
//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
$('.accordionContent').slideUp('normal');
//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
if($('.accordionButton').next().is(':hidden') == true) {
//ADD THE ON CLASS TO THE BUTTON (correct)
$(this).addClass('on');
//OPEN THE SLIDE
$('.accordionButton').next().slideDown('normal');
}
});
I'm guessing the lines:
$('.accordionButton').next().slideDown('normal');
and
if($('.accordionButton').next().is(':hidden') == true) {
are the lines which need editing. I need these two lines to open and close just the "next" .accordionContent instances not all of the instances together.

Get the button clicked ID in the same function in dojo?

I don't know if it is an easy question but i couldn't find the solution. I want to create 10 buttons in dojo like the button below.
<div style="right: 1px">
<button data-dojo-type="dijit.form.Button" id="SaveChangesDataGrid1" onclick="SaveChanges()">
Save</button>
</div>
but each button with different ID but the same function onClick. so what i want is when the button is clicked the id of the clicked button will be known in the function.
I am using dojo 1.8 any ideas?.
Change your onclick="SaveChanges()" to onclick="SaveChanges(event)" or get rid of it and use data-dojo-props:
<button
data-dojo-type="dijit.form.Button"
data-dojo-props="onClick:SaveChanges"
id="SaveChangesDataGrid2"
>
SaveChangesDataGrid2
</button>
Start your SaveChanges() this way to get id:
require([
"dijit/registry",
"dijit/form/Button",
], function(
registry
) {
window.SaveChanges = function(event) {
var button = registry.getEnclosingWidget(event.target);
console.log("onclick id:", button.id);
}
});
​
See it in action at jsFiddle: http://jsfiddle.net/phusick/WfdKF/