Konstantin Azizov 2017-06-15 05:21:06 +00:00 zatwierdzone przez GitHub
commit 911c446667
1 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -115,8 +115,11 @@
<div class="row">
<div class="col-xs-12">
<h2>Encrypted HTML</h2>
<p><a href="#" class="btn btn-success download" target="_blank" download="encrypted.html"
disabled="disabled">Download html file with password prompt</a></p>
<form method="get" id="download-form" action="encrypted.html">
<p>
<button disabled="disabled" class="btn btn-success download" type="submit">Download html file with password prompt</button>
</p>
</form>
<pre id="encrypted_html_display">
Your encrypted string</pre>
</div>
@ -142,9 +145,11 @@ crossorigin="anonymous"></script>
var renderedTmpl = $.render.tmpl(data);
var downloadLink = $('a.download');
downloadLink.attr('href', 'data:attachment/text,' + encodeURIComponent(renderedTmpl));
downloadLink.removeAttr('disabled');
var downloadForm = $('#download-form');
downloadForm.attr('action', 'data:attachment/text,' + encodeURIComponent(renderedTmpl));
var downloadButton = $('#download-form .download');
downloadButton.removeAttr('disabled');
});
};