Skip to content

Commit

Permalink
v0.9.3
Browse files Browse the repository at this point in the history
fix - downloading the serialized app file works in IE 11+
  • Loading branch information
countnazgul committed Jan 18, 2016
1 parent 541bc0b commit 458e7f8
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ After the restore process is finished the app will be saved to preserve the chan
* press the "Restore" button and wait for the process to finish. After the process is done the result table will be populated with more detail about the objects that were processed.
* That's it! If you have the app already open just refresh the browser tabs where this app is open.

#### Note

If the file is unable to download in IE please make sure that your "File download" option is set to "Enabled" in IE Security Settings for Internet

#### Change log
v0.9.3 (18/01/2016)
* fix - downloading the serialized app file works in IE 11+

v0.9.2 (17/01/2016)
* fix - opening multiple apps is performed correctly

Expand Down
6 changes: 3 additions & 3 deletions backup-and-restore.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Qlik sense app
<select id="docList"></select>
<button id="open">Open</button> &nbsp
<img id="loadingImg" src="images/loading.gif" style="width: 21px; height: 21px; vertical-align: middle; display: inline-block">
<img id="loadingImg" src="images/loading.gif" style="width: 21px; height: 21px; vertical-align: middle; display: inline-block;">
<span id="openDoc">No active document</span>
<span id="version" style="float: right; color: gainsboro"></span>
</div>
Expand All @@ -29,8 +29,8 @@
<input id="json" type="file">
<button id="go">Restore</button>
<button id="serialize">Backup</button>
</br>
</br>
<br/>
<br/>
<div id="prestatus"></div>
</div>

Expand Down
43 changes: 36 additions & 7 deletions backup-and-restore.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,16 +384,45 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function($, qsocks,

$('#loadingImg').css('display', 'none');
data = JSON.stringify(data, null, 2);
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([data], {
type: 'text/json'
}));
a.download = selectedAppText + '_' + dformat + '.json';
a.text = 'Download';
a.click();
var fileName = selectedAppText + '_' + dformat + '.json';

if( IEversion == false ) {
var a = window.document.createElement('a');
a.href = window.URL.createObjectURL(new Blob([data], {
type: 'text/json'
}));
a.download = fileName;
a.text = 'Download';
a.click();
} else {
window.navigator.msSaveOrOpenBlob(new Blob([data], {type:"text/json"}), fileName);
}
})
})

var IEversion = detectIE();

// detect IE --> returns version of IE or false, if browser is not Internet Explorer http://codepen.io/gapcode/pen/vEJNZN
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); // IE 10 or older => return version number
}

var trident = ua.indexOf('Trident/');
if (trident > 0) {
var rv = ua.indexOf('rv:');
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); // IE 11 => return version number
}

var edge = ua.indexOf('Edge/');
if (edge > 0) {
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); // Edge (IE 12+) => return version number
}
return false; // other browser
}

$("#go").on("click", function() {
$('#loadingImg').css('display', 'inline-block');
var table = $('#resultTable').DataTable();
Expand Down
2 changes: 1 addition & 1 deletion backup-and-restore.qext
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "mashup",
"name": "Backup and Restore",
"version": "0.9.2",
"version": "0.9.3",
"description": "Bachup and restore QS app",
"preview": "images/preview.png",
"homepage": "https://github.com/countnazgul/QS-backup-and-restore-app",
Expand Down
Binary file modified backup-and-restore.zip
Binary file not shown.

0 comments on commit 458e7f8

Please sign in to comment.