Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
Merge pull request #6 from lequal/dev
Browse files Browse the repository at this point in the history
Merge dev to master
  • Loading branch information
louisjdmartin authored Sep 10, 2019
2 parents 1f7e31a + 8b5d0e7 commit 2e953de
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ install: true
addons:
sonarcloud:
organization: "lequal"

jdk:
- openjdk8
- openjdk11

script:
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar

cache:
directories:
- '$HOME/.m2/repository'
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<jdk.min.version>1.8</jdk.min.version>
<pluginUrl>https://cnes.fr</pluginUrl>
<pluginOrganizationName>CNES</pluginOrganizationName>
<jacoco.version>0.7.9</jacoco.version>
<jacoco.version>0.8.4</jacoco.version>
</properties>

<licenses>
Expand Down
33 changes: 30 additions & 3 deletions src/main/resources/static/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,36 @@
* You should have received a copy of the GNU General Public License
* along with cnesexport. If not, see <http://www.gnu.org/licenses/>.
*/
var isDisplayedExporting;
window.registerExtension('cnesexport/export', function (options){
var jquery = document.createElement('script');
jquery.src = '/static/cnesexport/jquery.min.js';
if(window.jQuery==null)document.head.appendChild(jquery);
options.el.innerHTML = '<div id="cnesscanload" class="page-wrapper-simple"><div class="page-simple"><h1 class="maintenance-title text-center">cnes-export is loading, please wait...</h1></div></div>'
waitjQueryExport(options);

window.registerExtension('cnesexport/export', function (options) {

// return a function, which is called when the page is being closed
return function () {
isDisplayedExporting = false;
// clear elements of this page
options.el.textContent = '';
};
})

function waitjQueryExport(options){
// check if jquery is loaded...
if(window.jQuery == null){
setTimeout(waitjQueryExport, 100, options);
}
else{
registerCnesExport(options)
}
}

function registerCnesExport(options){
// let's create a flag telling if the page is still displayed
var isDisplayedExporting = true;
isDisplayedExporting = true;

/**
* Log information in the bottom text area
Expand Down Expand Up @@ -150,6 +176,7 @@ window.registerExtension('cnesexport/export', function (options) {
// Add html template
var template = document.createElement("div");
template.setAttribute("id", "template");
options.el.innerHTML = "";
options.el.appendChild(template);
// retrieve template from html
$('#template').load('../../static/cnesexport/templates/exportForm.html', function(){
Expand Down Expand Up @@ -193,4 +220,4 @@ window.registerExtension('cnesexport/export', function (options) {
// clean elements of this page
options.el.textContent = '';
};
});
}
2 changes: 2 additions & 0 deletions src/main/resources/static/jquery.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/main/resources/static/templates/exportForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ <h1 class="maintenance-title text-center">Export data as OpenXML</h1>
<select id="key"
name="key"
class="login-input" required></select>
<em style="color:grey;">
<br /><em style="color:grey;">
Tips: all quality profiles are available <a href="../../../profiles" target="_blank">here</a>.
</em>
</div>
<div class="big-spacer-bottom">
<div id="loading" class="text-center overflow-hidden" style="margin-bottom: 1em; display: none;">
<img src="../../static/cnesexport/images/loader.gif" alt="Working..."/>
</div>
<div class="text-center overflow-hidden">
<div class="overflow-hidden">
<input id="generation" name="generation" type="button" value="Export">
</div>
</div>
<textarea id="logging" name="logging" class="login-input" rows="15" style="background: black; color:white; resize: none;" readonly="">## Logging console ##</textarea>
<textarea id="logging" name="logging" class="login-input" rows="15" style="background: black; color:white; resize: none; width: 100%;" readonly="">## Logging console ##</textarea>
</form>
</div>
</div>
</div>
</div>

0 comments on commit 2e953de

Please sign in to comment.